callusgs

callusgs Aims To Be A Complete Implementation Of USGS's machine-to-machine API (v1.5.0)

https://github.com/florian-katerndahl/callusgs

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.8%) to scientific vocabulary

Keywords

api cli download earth-explorer eros geodata gis landsat machine-to-machine remote-sensing usgs
Last synced: 8 months ago · JSON representation ·

Repository

callusgs Aims To Be A Complete Implementation Of USGS's machine-to-machine API (v1.5.0)

Basic Info
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 5
  • Releases: 4
Topics
api cli download earth-explorer eros geodata gis landsat machine-to-machine remote-sensing usgs
Created almost 2 years ago · Last pushed about 1 year ago
Metadata Files
Readme Contributing License Citation

README.md

callusgs

Documentation Status DOI FAIR checklist badge

callusgs aims to be a complete and (mostly) typed implementation of USGS's machine-to-machine API (v1.5.0). In addition, callusgs provides a suite of command line tools that can be used to query and download scenes, use the geocoding service provided by the USGSS and convert WRS 1/2 coordinates to geographic coordinates.

Features

callusgs is both a Python package and a suite of command line tools that allows

  1. Downloading of select products (see table below)
  2. Access to the USGS geocoding API
  3. Conversion between the WRS1 and WRS2 grids to geographic coordinates and
  4. clean up of download order queues (mainly as utility functionality)

Currently supported products for download are:

| Product string | Prodcut Name | |:----------------------:|:------------------------------------:| | landsat_em_c2_l1 | Landsat 4/5 Collection 2 Level 1 | | landsat_em_c2_l2 | Landsat 4/5 Collection 2 Level 2 | | landsat_etm_c2_l1 | Landsat 7 Collection 2 Level 1 | | landsat_etm_c2_l2 | Landsat 7 Collection 2 Level 2 | | landsat_ot_c2_l1 | Landsat 8/9 Collection 2 Level 1 | | landsat_ot_c2_l2 | Landsat 8/9 Collection 2 Level 2 | | landsat_ba_tile_c2 | Landsat Burned Area Product | | landsat_dswe_tile_c2 | Landsat Dynamic Surface Water Extent | | landsat_fsca_tile_c2 | Landsat Fractional Snow Covered Area | | gmted2010 | GMTED 2010 DEM | | srtm | SRTM Non-Void Filled | | srtm_v2 | SRTM Void Filled | | srtm_v3 | SRTM 1 Arc-Second Global | | srtm_water_bodies | SRTM Water Body Data |

Installation

Install the package together with the respective command line applications from pip.

bash pip install callusgs

Alternatively, if you're only interested in the CLI functionality of this tool the best choice is probably to use pipx for installation.

bash pipx install callusgs

Usage

For more detailed usage instructions and/or examples, please refer to the documentation or see the section below.

Prerequisites

To fully use the package's/the API's functionality you need (1) an account at USGS and (2) access to M2M MACHINE role. While the first one is mandatory, the functionality without access to the M2M MACHINE role is restricted (see table below). The account credentials need to be passed to the command line tools via CLI arguments or by setting the environment variables USGS_USERNAME and USGS_AUTH.

| Feature/Functionality | Usable | Note | |:--------------------------------------------------:|:----------:|:--------------------------------------------------------------------------------:| | Searching for scenes | Yes | | | Creating scene lists out of search results | Yes | | | Generate orders from scene searches or scene lists | No | Downloading orders from list, when order was placed via webinterface is possible | | Geocoding | Yes | | | WRS1/WRS2 to coordinate transformation | Yes | |

Command Line Tool Examples

Download

[!NOTE] When supplying coordinates on the command line as is shown below, you need to end the coordinate string with two dashes (--). This stops the program from trying to parse any further arguments. In turn, this also means the AOI must be given as the last argument!

The snippet below queries the EarthExplorer catalogue for Landsat 8/9 Collection 2 Level 2 scenes between June 1st, 2020 and July 25th, 2024 for a small part of the southwest of Berlin, Germany. Additionally, only scenes for August and September are returned and they must have a cloudcover of no more than 15%. Results are stored in a directory called download. The user set the logging level to INFO with the -v flag.

bash callusgs -v download --product landsat_etm_c2_l2 \ --date 2020-06-01 2024-07-25 --month aug sep \ --cloudcover 0 15 --aoi-coordinates 52.5 13.4 52.5 13.2 52.7 13.2 52.5 13.4 -- download

The snippet below queries the EarthExplorer catalogue for Landsat 7 Collection 2 Level 1 scenes between January 1st, 2005 and January 1st, 2020 for Lima, Peru, and its surrounding region. For the given polygon, the minimum bound recatangle is build and used for the query. No further restrictions regarding the obervation months or cloudcouver are posed. Results would be stored in a directory called download, but as a dry run is requested, only the number of available scenes and their download size is reported. The user requested extended debug output with the -vv flag.

bash callusgs -vv --dry-run download --product landsat_etm_c2_l1 \ --date 2005-01-01 2020-01-01 --aoi-type Mbr \ --aoi-coordinates -11.99 -77.13 -11.97 -77.00 -12.01 -76.88 -12.07 -76.88 -12.13 -76.89 -12.07 -77.16 -11.99 -77.13 -- \ download

Geocode

The USGS supplies a simplistic geocoding/POI-search endpoint which can be queries using the geocode sub-program. The snippet below queries all U.S. features whos placename attribute matches "New York".

[!WARNING] Right now, the placename endpoint, which is called under the hood, does not return any results for features of type "world"!

bash callusgs geocode --feature-type US "New York"

Grid2ll

Get either centroids or polygons of the WRS2 or WRS2 coordinate system based on geographic coordinates in WGS84 (EPSG:4326) inputs. The snipped below queries the centroid coordinates for three points in the WRS2 system.

bash callusgs grid2ll --response-shape point 52,11 32,5 89,69

Clean

The clean subprogram is used to delete dangeling product/scene orders.

bash callusgs -v clean

Known Limitations

  • The download program will only start the download of orders once all scenes are available. Thus, your order might not get downloaded immediately if only one scene is still being processed.
  • The geocoding/place search endpoint of USGS's API currently does not seem to work with non-US features. This may be a bug in the program.

Documentation

See the docs folder for raw documentation or visit callusgs.readthedocs.io.

License

callusgs is licensed under the GPL-v2. You may copy, distribute and modify the software as long as you track changes/dates in source files. Any modifications to or software including (via compiler) GPL-licensed code must also be made available under the GPL along with build & install instructions[^1].

[^1]: Synopsis taken from tk;drLegal.

Citation

If you use this software, please use the bibtex entry below or refer to the citation file.

tex @software{Katerndahl2024, author = {Katerndahl, Florian}, doi = {10.5281/zenodo.13319174}, version = {v0.3.0}, month = {8}, title = {callusgs}, url = {https://github.com/Florian-Katerndahl/callusgs}, year = {2024} }

Acknowledgments

Owner

  • Name: Florian Katerndahl
  • Login: Florian-Katerndahl
  • Kind: user
  • Location: Berlin, DE
  • Company: Earth Observation Lab HU Berlin

Building little things because I want to!

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: callusgs
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Florian
    family-names: Katerndahl
    orcid: 'https://orcid.org/0000-0001-6137-061X'
    email: florian@katerndahl.com
identifiers:
  - type: doi
    value: 10.5281/zenodo.13319174
repository-code: 'https://github.com/Florian-Katerndahl/callusgs'
abstract: >-
  callusgs Aims To Be A Complete Implementation Of USGS's
  machine-to-machine API (v1.5.0)
keywords:
  - api
  - cli
  - gis
  - geodata
  - landsat
  - usgs
  - machine-to-machine
  - eros
  - download
  - earthexplorer
license: GPL-2.0
version: v0.3.0
date-released: '2024-08-20'

GitHub Events

Total
  • Create event: 2
  • Release event: 2
  • Issues event: 7
  • Watch event: 1
  • Delete event: 1
  • Issue comment event: 3
  • Push event: 22
Last Year
  • Create event: 2
  • Release event: 2
  • Issues event: 7
  • Watch event: 1
  • Delete event: 1
  • Issue comment event: 3
  • Push event: 22

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 5
  • Total pull requests: 0
  • Average time to close issues: 21 minutes
  • Average time to close pull requests: N/A
  • Total issue authors: 1
  • Total pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 5
  • Pull requests: 0
  • Average time to close issues: 21 minutes
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Florian-Katerndahl (6)
Pull Request Authors
Top Labels
Issue Labels
enhancement (3) bug (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 79 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 8
  • Total maintainers: 1
pypi.org: callusgs

Implementation of USGS's machine-to-machine API (v1.5.0)

  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 79 Last month
Rankings
Dependent packages count: 10.6%
Average: 35.1%
Dependent repos count: 59.6%
Maintainers (1)
Last synced: 9 months ago

Dependencies

pyproject.toml pypi
  • sphinx ^7.3.7 docs
  • sphinx-rtd-theme ^2.0.0 docs
  • fiona ^1.9.6
  • python ^3.9
  • requests ^2.32.3
  • tqdm ^4.66.4
  • pytest ^8.2.2 test
.github/workflows/codeql.yml actions
  • actions/checkout v4 composite
  • github/codeql-action/analyze v3 composite
  • github/codeql-action/init v3 composite