Skip to main content

stactools package for MODIS data

Project description

stactools-modis

This repository will assist you in the generation of STAC files for MODIS datasets.

Examples

There is an example Catalog at examples/catalog.json. Inside that catalog are several MODIS v6.0 and v6.1 STAC Collections and Items.

Command-line Usage

To create a STAC Item:

$ stac modis create-item tests/data-files/MCD12Q1.A2001001.h00v08.006.2018142182903.hdf.xml build

To create a STAC Catalog from a list of MODIS asset hrefs:

$ stac modis create-catalog examples/file-list-061.txt examples/modis-061

Contributing

If you are making any changes to the item or collection structure, the tests will fail until you update the expected values. To update, run this script:

$ scripts/create_expected.py

This will create, validate, and save new test data items into tests/data-files/expected which are used for unit testing.

Once you've got a pull request ready, please update the examples as well (you'll need to download the external test data files first, see below):

$ stac modis create-catalog --cogify examples/file-list-061.txt examples/modis-061

Note that this will take a while (~5-10 minutes). If you need to update the examples later, you can omit the --cogify as the COGs will already be created.

Running tests

Because of the large number of MODIS products supported by this library and their asset file size, the default test suite does not download all HDF files. To run all tests, use the --runslow option for pytest:

pytest --runslow

This will download HDF files for all 061 products to tests/data-files/external. Note that these files are required to create the examples/ directory.

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

stactools-modis-0.2.0.tar.gz (42.2 kB view hashes)

Uploaded Source

Built Distribution

stactools_modis-0.2.0-py3-none-any.whl (94.1 kB view hashes)

Uploaded Python 3

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