Code Monkey home page Code Monkey logo

pyosp's Introduction

pyosp logo

github release (latest by date) TravisCI Coverage Status Conda Downloads publication


intro

Intelligent and comprehensive swath analysis

Features

  • ๐Ÿ’Ž Intelligent: objectively identify irregular boundries using elevation, slope, TPI, or other raster analyses.
  • ๐ŸŒŒ Comprehensive: cuvilinear and circular swath analyses, reclassification of swath data, cross-swath, slice and histogram, etc.
  • ๐Ÿ‘ญ Compatible: work seamlessly with GIS software.
  • โš“ Dependencies: numpy, matplotlib, gdal, scipy and shapely.

Documentation

Read the documentation at: https://pyosp.readthedocs.io/en/latest/index.html

Introduction, methodology, and case studies: https://doi.org/10.1016/j.geomorph.2021.107778

Applications (starting from scratch):

  1. Topographic analysis of Teton Range, Wyoming
  2. Terrace correlation along the Licking River, Kentucky
  3. Circular swath analysis of Olympus Mons, Mars

Installation

We recommend to use the conda package manager to install pyosp. It will provide pre-built binaries for all dependencies of pyosp. If you have the miniconda (recommend; only containing python and the conda package manager), or anaconda distribution (a python distribution with many installed libraries for data science) installed, then simply execute the following command:

conda install -c conda-forge pyosp 

Installing in a new environment (recommended)

Although it is not required, installing the library in a clean environment represents good practice and helps avoid potential dependency conflicts. We also recommends install all dependencies with pyosp through conda-forge channel

conda create -n env_pyosp 
conda activate env_pyosp
conda config --env --add channels conda-forge
conda config --env --set channel_priority strict
conda install python=3 pyosp

You can also install from current branch:

git clone https://github.com/pyosp-devs/pyosp.git
cd pyosp
conda install --file requirements.txt
python setup.py install

You can verify installation by entering a python shell and typing:

import pyosp
print(pyosp.__version__)

Example

Here is a simple example of using pyosp to perform swath analysis on a synthetic mountain case. The cross-width of mountain is around 90m, and flat ground has elevation of zero.

homo_case

Original, elevation, slope and tpi based swath calculation.

import pyosp

baseline = pyosp.datasets.get_path("homo_baseline.shp") # the path to baseline shapefile
raster = pyosp.datasets.get_path("homo_mount.tif")  # the path to raster file

orig = pyosp.Orig_curv(baseline, raster, width=100,
                       line_stepsize=3, cross_stepsize=None)

elev = pyosp.Elev_curv(baseline, raster, width=100,
                       min_elev=0.01,
                       line_stepsize=3, cross_stepsize=None)

slope = pyosp.Slope_curv(baseline, raster, width=100,
                         min_slope=1,
                         line_stepsize=3, cross_stepsize=None)

tpi = pyosp.Tpi_curv(baseline, raster, width=100,
                     tpi_radius=50, min_tpi=0,
                     line_stepsize=3, cross_stepsize=None)

We can plot with matplotlib, or open in GIS software.

homo_polygon

Plot, for example, elevation based swath profile.

elev.profile_plot()

elev_sp

For more example and usage, please refer to our documentation.

Citing pyosp

If you use PyOSP for your work, please cite as:

Y. Zhu, J.M. Dortch, M.A. Massey, et al., An Intelligent Swath Tool to Characterize complex Topographic Features: Theory and Application in the Teton Range, Licking River, and Olympus Mons, Geomorphology (2021), https://doi.org/10.1016/j.geomorph.2021.107778

Contributing

Any contributions you make are greatly appreciated.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/amazingfeature)
  3. Commit your changes (git commit -m 'add some amazingfeature')
  4. Push to the branch (git push origin feature/amazingfeature)
  5. Open a pull request

Feedback

  • If you think pyosp is useful, consider giving it a star.
  • If something is not working, create an issue
  • If you need to get in touch for other reasons, send us an email

Credits

This work is supported by Kentucky Geological Survey.

License

Apache license, version 2.0

pyosp's People

Contributors

yzh211 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pyosp's Issues

Help Needed for new datasets

What is the best way to read a new/custom baseline and raster? I can use the pyosp.datasets.get_path for the datasets available, but struggle to read new datasets outside of the pyosp.dataset folder that will allow pyosp.Orig_curv to work

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.