podaacpy Level 2 Subsetting (L2SS) API¶
-
class
l2ss.
L2SS
¶ -
dataset_search
(dataset_id='', variable=None, sensor=None, provider=None, start_time='', end_time='', start_index='', items_per_page='50')¶ Dataset search service lists available datasets and returns them.
Parameters: - dataset_id (
string
) – Search dataset belong to given PODAAC Dataset persistent ID. - variable (
list
) – Search for datasets with variable name. For multi-value input, this input is taken as a list. Example: [ ‘Sea Surface Temperature’, ‘Surface Wind’] - sensor (
list
) – Search for datasets with sensor. For multi-value input, this input is taken as a list. - provider (
list
) – Search for datasets with provider. For multi-value input, this input is taken as a list. - start_time (
string
) – Lower time bound. If not specified, lower time bound of the dataset will be used. Example: ‘2011-12-31T23:59:59-06:00Z’ - end_time (
string
) – Upper time bound. If not specified, upper time bound of the dataset will be used. Example: 2019-12-31T23:59:59-06:00Z - items_per_page (
string
) – number of results to return. Defaults to 50. - start_index (
string
) – start index of result.
Returns: a json response containing the datasets.
- dataset_id (
-
dataset_variables
(dataset_id)¶ Dataset Variable retrieves dataset configuration information including variables.
Parameters: dataset_id ( string
) – datasetId for the configuration information.Returns: a json response containing the dataset variables.
-
granule_download
(query_string, path='')¶ Granule Download service submits a job to subset and download. Upon a successful request, token will be returned which can be used to check status.
Parameters: - query_string (
string
) – data collection query json as a string. - path (
string
) – path to a directory where you want the subsetted dataset to be stored.
Returns: a zip file downloaded and extracted in the destination directory path provided.
- query_string (
-
granule_preview_image
(dataset_id, granule, year, day, variable, path='')¶ Granule Preview Image Service provides thumbnail image of selected variable for selected granule.
Parameters: - dataset_id (
string
) – Search granules belong to given PODAAC Dataset persistent ID. - granule (
string
) – string granule name. - year (
string
) – year in 4 digits. Example= ‘2014’ - day (
string
) – day of year in 3 digits. Example= ‘140’ - variable_id (
string
) – Variable id described in dataset variable service.
Returns: returns thumbnail image of selected variable for selected granule.
- dataset_id (
-
granule_search
(dataset_id='', bbox='', start_time='', end_time='', name='', sort='', start_index='', items_per_page='50')¶ Granule Search retrieves all base granule information (datasetId, start time, end time) matching the specified datasetId, date, and region. This approach may change if the data/querying turns out to be too expensive. Response is structured in a minimalistic way to cut down on the file size.
Parameters: - dataset_id (
string
) – Search granules belong to given PODAAC Dataset persistent ID. - bbox (
string
) – Search granules with Bounding box Ex: ‘-180,-90,180,90’ - start_time (
string
) – Lower time bound. If not specified, lower time bound of the dataset will be used. Example: ‘2011-12-31T23:59:59-06:00Z’ - end_time (
string
) – Upper time bound. If not specified, upper time bound of the dataset will be used. Example: 2019-12-31T23:59:59-06:00Z
:param name : Search granules with exact name or name pattern using wildcard search Example: ascat* this matches name that starts with “ascat” :type name:
string
Parameters: - sort (
string
) – Sort output. There are two strings delimited by space. The first string is the field name, and the second string is ‘asc’ or ‘desc’ Example: sort=’Granule-Name asc’ - items_per_page (
string
) – number of results to return. Default to 50. - start_index (
string
) – start index of result.
Returns: a json response containing the dataset granules.
- dataset_id (
-
granules_availability
(dataset_id='', start_time='', end_time='', gap='', bbox='')¶ Granules Availability calculates granule counts per day or month from given date range.
Parameters: - dataset_id (
string
) – Search granules belong to given PODAAC Dataset persistent ID. - start_time (
string
) – Lower time bound. If not specified, lower time bound of the dataset will be used. Example: ‘2011-12-31T23:59:59-06:00Z’ - end_time (
string
) – Upper time bound. If not specified, upper time bound of the dataset will be used. Example: 2019-12-31T23:59:59-06:00Z - gap (
string
) – The size of each date range expressed as an interval to be added to the lower bound. Example: ‘DAY’, ‘MONTHS’ - bbox (
string
) – Search granules with Bounding box Ex: ‘-180,-90,180,90’
Returns: a json response containing the granule count and other relevant information.
- dataset_id (
-
image_palette
(palette_name)¶ Image Palette service retrieves palette descriptor in json format
Parameters: palette_name ( string
) – palette_name whose palette descriptor we want to retrieve.Returns: returns palette descriptor in json format.
-
subset_status
(token)¶ Subset Status service check status on existing download job. The possible status that it returns include the following..
* "queued" * "processing" * "partial error" * "done" * "error"
Parameters: token ( string
) – job token. job token is provided when submitting the job.Returns: the status of the subset request.
-