gedi
The GEDI Python API gedi.py
is used to access the services provided by the gedi plugin for SlideRule. From Python, the module can be imported via:
from sliderule import gedi
init
- sliderule.gedi.init(url='slideruleearth.io', verbose=False, loglevel=50, organization='sliderule', desired_nodes=None, time_to_live=60, bypass_dns=False)[source]
Initializes the Python client for use with SlideRule and should be called before other GEDI API calls. This function is a wrapper for the sliderule.init(…) function.
Examples
>>> from sliderule import gedi >>> gedi.init()
gedi04a
gedi04ap
- sliderule.gedi.gedi04ap(parm, callbacks={}, resources=None, keep_id=False, as_numpy_array=False, height_key=None)[source]
Performs subsetting in parallel on GEDI data and returns elevation footprints. This function expects that the parm argument includes a polygon which is used to fetch all available resources from the CMR system automatically. If resources is specified then any polygon or resource filtering options supplied in parm are ignored.
- Parameters:
parms (dict) – parameters used to configure subsetting process
asset (str) – data source asset
callbacks (dictionary) – a callback function that is called for each result record
resources (list) – a list of granules to process (e.g. [“GEDI04_A_2019229131935_O03846_02_T03642_02_002_02_V002.h5”, …])
keep_id (bool) – whether to retain the “extent_id” column in the GeoDataFrame for future merges
as_numpy_array (bool) – whether to provide all sampled values as numpy arrays even if there is only a single value
height_key (str) – identifies the name of the column provided for the 3D CRS transformation
- Returns:
geolocated footprints
- Return type:
GeoDataFrame
Examples
>>> from sliderule import gedi >>> gedi.init() >>> region = [ {"lon":-105.82971551223244, "lat": 39.81983728534918}, ... {"lon":-105.30742121965137, "lat": 39.81983728534918}, ... {"lon":-105.30742121965137, "lat": 40.164048017973755}, ... {"lon":-105.82971551223244, "lat": 40.164048017973755}, ... {"lon":-105.82971551223244, "lat": 39.81983728534918} ] >>> parms = { "poly": region } >>> resources = ["GEDI04_A_2019229131935_O03846_02_T03642_02_002_02_V002.h5"] >>> asset = "ornldaac-s3" >>> rsps = gedi.gedi04ap(parms, asset=asset, resources=resources)
gedi02a
gedi02ap
- sliderule.gedi.gedi02ap(parm, callbacks={}, resources=None, keep_id=False, as_numpy_array=False, height_key=None)[source]
Performs subsetting in parallel on GEDI data and returns geolocated footprints. This function expects that the parm argument includes a polygon which is used to fetch all available resources from the CMR system automatically. If resources is specified then any polygon or resource filtering options supplied in parm are ignored.
- Parameters:
parms (dict) – parameters used to configure subsetting process
asset (str) – data source asset
callbacks (dictionary) – a callback function that is called for each result record
resources (list) – a list of granules to process (e.g. [“GEDI04_A_2019229131935_O03846_02_T03642_02_002_02_V002.h5”, …])
keep_id (bool) – whether to retain the “extent_id” column in the GeoDataFrame for future merges
as_numpy_array (bool) – whether to provide all sampled values as numpy arrays even if there is only a single value
height_key (str) – identifies the name of the column provided for the 3D CRS transformation
- Returns:
geolocated footprints
- Return type:
GeoDataFrame
Examples
>>> from sliderule import gedi >>> gedi.init() >>> region = [ {"lon":-105.82971551223244, "lat": 39.81983728534918}, ... {"lon":-105.30742121965137, "lat": 39.81983728534918}, ... {"lon":-105.30742121965137, "lat": 40.164048017973755}, ... {"lon":-105.82971551223244, "lat": 40.164048017973755}, ... {"lon":-105.82971551223244, "lat": 39.81983728534918} ] >>> parms = { "poly": region } >>> resources = ["GEDI02_A_2019229131935_O03846_02_T03642_02_002_02_V002.h5"] >>> asset = "gedi-local" >>> rsps = gedi.gedi02ap(parms, asset=asset, resources=resources)
gedi01b
gedi01bp
- sliderule.gedi.gedi01bp(parm, callbacks={}, resources=None, keep_id=False, as_numpy_array=False, height_key=None)[source]
Performs subsetting in parallel on GEDI data and returns geolocated footprints. This function expects that the parm argument includes a polygon which is used to fetch all available resources from the CMR system automatically. If resources is specified then any polygon or resource filtering options supplied in parm are ignored.
- Parameters:
parms (dict) – parameters used to configure subsetting process
asset (str) – data source asset
callbacks (dictionary) – a callback function that is called for each result record
resources (list) – a list of granules to process (e.g. [“GEDI04_A_2019229131935_O03846_02_T03642_02_002_02_V002.h5”, …])
keep_id (bool) – whether to retain the “extent_id” column in the GeoDataFrame for future merges
as_numpy_array (bool) – whether to provide all sampled values as numpy arrays even if there is only a single value
height_key (str) – identifies the name of the column provided for the 3D CRS transformation
- Returns:
geolocated footprints
- Return type:
GeoDataFrame
Examples
>>> from sliderule import gedi >>> gedi.init() >>> region = [ {"lon":-105.82971551223244, "lat": 39.81983728534918}, ... {"lon":-105.30742121965137, "lat": 39.81983728534918}, ... {"lon":-105.30742121965137, "lat": 40.164048017973755}, ... {"lon":-105.82971551223244, "lat": 40.164048017973755}, ... {"lon":-105.82971551223244, "lat": 39.81983728534918} ] >>> parms = { "poly": region } >>> resources = ["GEDI01_B_2019229131935_O03846_02_T03642_02_002_02_V002.h5"] >>> asset = "gedi-local" >>> rsps = gedi.gedi01bp(parms, asset=asset, resources=resources)