Giter VIP home page Giter VIP logo

lcmap-pyccd's Introduction

PyCCD - Python Continuous Change Detection

pyccd exists to provide the simplest possible implementation of ccd.

Using PyCCD

>>> import ccd
>>> results = ccd.detect(dates, blues, greens, reds, nirs, swir1s, swir2s, thermals, qas)
>>>
>>> type(results)
<class 'dict'>
>>>
>>> results
{algorithm: 'pyccd:x.x.x',
 processing_mask: [bool, bool, ...],
 snow_prob: float,
 water_prob: float,
 cloud_prob: float,
 change_models: [
     {start_day: int,
      end_day: int,
      break_day: int,
      observation_count: int,
      change_probability: float,
      curve_qa: int,
      blue:      {magnitude: float,
                  rmse: float,
                  coefficients: (float, float, ...),
                  intercept: float},
      green:     {magnitude: float,
                  rmse: float,
                  coefficients: (float, float, ...),
                  intercept: float},
      red:       {magnitude: float,
                  rmse: float,
                  coefficients: (float, float, ...),
                  intercept: float},
      nir:       {magnitude: float,
                  rmse: float,
                  coefficients: (float, float, ...),
                  intercept: float},
      swir1:     {magnitude: float,
                  rmse: float,
                  coefficients: (float, float, ...),
                  intercept: float},
      swir2:     {magnitude: float,
                  rmse: float,
                  coefficients: (float, float, ...),
                  intercept: float},
      thermal:   {magnitude: float,
                  rmse: float,
                  coefficients: (float, float, ...),
                  intercept: float}}
                 ]
}

Default processing parameters can be over-ridden using a dictionary (see parameters.yaml for valid keys):

>>> import ccd
>>> params = {'QA_BITPACKED': False,
              'QA_FILL': 255,
              'QA_CLEAR': 0,
              'QA_WATER': 1,
              'QA_SHADOW': 2,
              'QA_SNOW': 3,
              'QA_CLOUD': 4}
>>> results = ccd.detect(dates, blues, greens, reds, nirs, swir1s, swir2s, thermals, qas, params=params)

Installing

System requirements (Ubuntu)

  • python3-dev
  • gfortran
  • libopenblas-dev
  • liblapack-dev
  • graphviz
  • python-virtualenv

System requirements (Centos)

  • python3-devel
  • gfortran
  • blas-dev
  • lapack-dev
  • graphviz
  • python-virtualenv

It's highly recommended to do all your development & testing in a virtual environment.

user@dev:/home/user/$ mkdir pyccd
user@dev:/home/user/$ cd pyccd
user@dev:/home/user/pyccd$ virtualenv -p python3 .venv
user@dev:/home/user/pyccd$ . .venv/bin/activate
(.venv) user@dev:/home/user/pyccd$

The rest of the command prompts are truncated to $ for readability, but assume an activated virtual environment and pwd as above, or that you know what you are doing.

Clone the repo
$ git clone https://github.com/usgs-eros/lcmap-pyccd.git

or if you have ssh keys set up in github:

$ git clone [email protected]:usgs-eros/lcmap-pyccd.git
Install dev dependencies

Install jupyter notebook and line_profiler

$ pip install -e .[dev]
Install test dependencies
$ pip install -e .[test]

Testing & Running

$ pytest
$ pytest --profile
$ pytest --profile-svg

# pytest-watch
$ ptw

Profiling

Decorate the function to be profiled with @profile and run make profile. Remove decorations before committing code.

Contributing

Contributions to pyccd are most welcome, just be sure to thoroughly review the guidelines first.

Contributing

Developers Guide

Versions

PyCCD previously followed MAJOR.MINOR.PATCH.LABEL semantic versioning but has changed to date based semantic versioning, thus: YYYY.MM.DD[.HH.MM.SS][-label].

PyCCD's version is defined by the ccd/version.py/__version__ attribute ONLY.

See Semantic Versioning.

References

Links

lcmap-pyccd's People

Contributors

caffeine-potent avatar davidvhill avatar htollerud-usgs avatar kelcy-smith avatar klsmith-usgs avatar

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.