spymicmac.usgs

sPyMicMac.usgs is a collection of tools for interfacing with USGS Earth Explorer.

spymicmac.usgs.get_login_creds()[source]

Read a user’s .netrc file and return the login credentials.

Returns

  • creds – the netrc.netrc credentials.

spymicmac.usgs.get_usgs_footprints(imlist, dataset='DECLASSII')[source]

Search for a list of images on USGS Earth Explorer. Note that the image names should be the USGS entity ID (e.g., AR5840034159994 rather than AR5840034159994.tif).

Parameters
  • imlist (list) – a list of image names.

  • dataset (str) – the USGS dataset name to search (default: DECLASSII).

Returns

gdf (GeoDataFrame) – a GeoDataFrame of image footprints.

spymicmac.usgs.read_coords(result)[source]

Parse a search result returned from USGS and create a list of coordinates for the image footprint.

Parameters

result (dict) – the USGS search result

Returns

coords (list) – a list of coordinates