Skip to main content

Raster and vector tools for Remote Sensing and Classification

Project description

Documentation status PyPI version Build status Downloads DOI

MuseoToolBox logo

MuseoToolBox is a python library to simplify the use of raster/vector, especially for machine learning and remote sensing. It is now easy to extract raster values from vector polygons and to do some spatial/unspatial cross-validation for scikit-learn from raster.

One of the most meaningful contribution is, in my humble opinion, the rasterMath class which allows you to do any expression/function on a raster in a just few lines : compute the mean in all bands, the modal value, smooth a signal, compute the ndvi... all you have to do is to give your own function to MuseoToolBox, and rasterMath manages everything : the nodata value, reading the raster block per block, saving the result to a new raster with a fast compression. Examples to use rasterMath are available on readthedocs.

Using and citing the toolbox

If you use MuseoToolBox in your research and find it useful, please cite this library using the following bibtex reference:

@misc{karasiak2019mtb,
title={MuseoToolBox, a remote sensing python library},
author={Karasiak Nicolas},
url={https://github.com/nkarasiak/museotoolbox},
year={2019},
doi={10.5281/zenodo.3404728}
}

What's the point ?

Today, the main usages of MuseoToolBox are :

  • museotoolbox.cross_validation
    • Create validation/training sets from vector, and cross-validation compatible with Scikit-Learn GridSearchCV. The aim is here to promote the spatial cross-validation in order to better estimate a model (with a lower spatial auto-correlation overestimation).
  • museotoolbox.raster_tools
    • Extract bands values from vector ROI (polygons/points) (function : getSamplesFromROI)
    • rasterMath, allows you to do some math on your raster and save it. Just load rasterMath, then it will return you the value for each pixel (in all bands) and now you can do whatever you want : predicting a model, smooth signal (whittaker, double logistic...), modal value, mean... rasterMath read and write block per block to avoid loading the full image in memory. It is compatible with every python function (including numpy) as the first and only argument needed is an array.
  • museotoolbox.learn_tools
    • Based on Scikit-Learn. learndAndPredict simplifies the use of cross-validation by extracting each accuracy (kappa,F1,OA, and above all confusion matrix) from each fold. It also eases the way to predict a raster (just give the raster name and the model).

That seems cool, but is there some help to use this ?

I imagined MuseoToolBox as a tool to simplify raster processing and to promote spatial cross-validation, so of course there is some help : a complete documentation with a lot of examples is available on readthedocs.

How do I install it ?

A package is available on pip : python3 -m pip install museotoolbox --user

Alternatively, you can install museotoolbox directly from the git : python3 -m pip install git+https://github.com/nkarasiak/MuseoToolBox.git --user

Feel free to remove the --user if you like to install the library for every user on the machine.

Who built MuseoToolBox ?

I am Nicolas Karasiak, a Phd student at Dynafor Lab. I work tree species mapping from space throught dense satellite image time series, especially with Sentinel-2. A special thanks goes to Mathieu Fauvel who initiated me to the beautiful world of the open-source.

Why this name ?

As Orfeo ToolBox is one my favorite and most useful library to work with raster data, I choose to name my work as Museo because in ancient Greek religion and myth, Museo is the son and disciple of Orfeo. If you want an acronym, let's say MUSEO means 'Multiple Useful Services for Earth Observation'.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

museotoolbox-0.12rc4.tar.gz (396.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page