Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
ISSUE-117 Add list datasets by processing level to podaac_utils
Browse files Browse the repository at this point in the history
  • Loading branch information
lewismc committed Mar 13, 2018
1 parent bd430be commit cc43c76
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
18 changes: 9 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ podaacpy
|image7|

A python utility library for interacting with NASA JPL's
`PO.DAAC <http:https://podaac.jpl.nasa.gov>`__
`PO.DAAC <https:https://podaac.jpl.nasa.gov>`__

What is PO.DAAC?
----------------
Expand All @@ -22,36 +22,36 @@ What does podaacpy offer?
-------------------------

The library provides a Python toolkit for interacting with all
[PO.DAAC Web Services v3.2.2 APIs](http:https://podaac.jpl.nasa.gov/ws), namely
[PO.DAAC Web Services v3.2.2 APIs](https:https://podaac.jpl.nasa.gov/ws), namely

- `PO.DAAC Web Services <https://podaac.jpl.nasa.gov/ws/>`__: services
include
- `Dataset
Metadata <http:https://podaac.jpl.nasa.gov/ws/search/dataset/index.html>`__
Metadata <https:https://podaac.jpl.nasa.gov/ws/search/dataset/index.html>`__
- retrieves the metadata of a dataset
- `Granule
Metadata <http:https://podaac.jpl.nasa.gov/ws/metadata/granule/index.html>`__
Metadata <https:https://podaac.jpl.nasa.gov/ws/metadata/granule/index.html>`__
- retrieves the metadata of a granule
- `Search
Dataset <http:https://podaac.jpl.nasa.gov/ws/search/dataset/index.html>`__
Dataset <https:https://podaac.jpl.nasa.gov/ws/search/dataset/index.html>`__
- searches PO.DAAC's dataset catalog, over Level 2, Level 3, and
Level 4 datasets
- `Search
Granule <http:https://podaac.jpl.nasa.gov/ws/search/granule/index.html>`__
Granule <https:https://podaac.jpl.nasa.gov/ws/search/granule/index.html>`__
- does granule searching on PO.DAAC level 2 swath datasets
(individual orbits of a satellite), and level 3 & 4 gridded datasets
(time averaged to span the globe)
- `Image
Granule <http:https://podaac.jpl.nasa.gov/ws/image/granule/index.html>`__ -
Granule <https:https://podaac.jpl.nasa.gov/ws/image/granule/index.html>`__ -
renders granules in the PO.DAAC's catalog to images such as jpeg
and/or png
- `Extract
Granule <http:https://podaac.jpl.nasa.gov/ws/extract/granule/index.html>`__
Granule <https:https://podaac.jpl.nasa.gov/ws/extract/granule/index.html>`__
- subsets a granule in PO.DAAC catalog and produces either netcdf3 or
hdf4 files

- | `Metadata Compliance
Checker <http:https://podaac-uat.jpl.nasa.gov/mcc>`__: an online tool and
Checker <https:https://podaac-uat.jpl.nasa.gov/mcc>`__: an online tool and
web
| service designed to check and validate the contents of netCDF and
HDF granules for the
Expand Down
18 changes: 9 additions & 9 deletions docs/source/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Introduction to podaacpy
============
Introduction
============
podaacpy is a python utility library for interacting with `NASA JPL's PO.DAAC <http:https://podaac.jpl.nasa.gov>`_
podaacpy is a python utility library for interacting with `NASA JPL's PO.DAAC <https:https://podaac.jpl.nasa.gov>`_

================
What is PO.DAAC?
Expand All @@ -33,14 +33,14 @@ The library provides a Python toolkit for interacting with all of PO.DAACs API's

* `PO.DAAC Web Services <https://podaac.jpl.nasa.gov/ws/>`_: services include

* `Dataset Metadata <http:https://podaac.jpl.nasa.gov/ws/metadata/dataset/index.html>`_ - retrieves the metadata of a dataset
* `Dataset Search <http:https://podaac.jpl.nasa.gov/ws/search/dataset/index.html>`_ - searches PO.DAAC's dataset catalog, over Level 2, Level 3, and Level 4 datasets
* `Dataset Variables <http:https://podaac.jpl.nasa.gov/ws/dataset/variables/index.html>`_ - provides list of dataset variables for the dataset
* `Granule Metadata <http:https://podaac.jpl.nasa.gov/ws/metadata/granule/index.html>`_ - retrieves the metadata of a granule
* `Granule Search <http:https://podaac.jpl.nasa.gov/ws/search/granule/index.html>`_ - does granule searching on PO.DAAC level 2 swath datasets (individual orbits of a satellite), and level 3 & 4 gridded datasets (time averaged to span the globe)
* `Granule Preview <http:https://podaac.jpl.nasa.gov/ws/image/granule/index.html>`_ - the PODAAC preview Image service retrieves pre-generated preview images for selected granules
* `Granule Subset <http:https://podaac.jpl.nasa.gov/ws/subset/granule/index.html>`_ - Subset Granule service allows users to submit subset jobs
* `Subset Status <http:https://podaac.jpl.nasa.gov/ws/subset/status/index.html>`_ - Subset Granule Status service allows users to check the status of submitted subset job
* `Dataset Metadata <https:https://podaac.jpl.nasa.gov/ws/metadata/dataset/index.html>`_ - retrieves the metadata of a dataset
* `Dataset Search <https:https://podaac.jpl.nasa.gov/ws/search/dataset/index.html>`_ - searches PO.DAAC's dataset catalog, over Level 2, Level 3, and Level 4 datasets
* `Dataset Variables <https:https://podaac.jpl.nasa.gov/ws/dataset/variables/index.html>`_ - provides list of dataset variables for the dataset
* `Granule Metadata <https:https://podaac.jpl.nasa.gov/ws/metadata/granule/index.html>`_ - retrieves the metadata of a granule
* `Granule Search <https:https://podaac.jpl.nasa.gov/ws/search/granule/index.html>`_ - does granule searching on PO.DAAC level 2 swath datasets (individual orbits of a satellite), and level 3 & 4 gridded datasets (time averaged to span the globe)
* `Granule Preview <https:https://podaac.jpl.nasa.gov/ws/image/granule/index.html>`_ - the PODAAC preview Image service retrieves pre-generated preview images for selected granules
* `Granule Subset <https:https://podaac.jpl.nasa.gov/ws/subset/granule/index.html>`_ - Subset Granule service allows users to submit subset jobs
* `Subset Status <https:https://podaac.jpl.nasa.gov/ws/subset/status/index.html>`_ - Subset Granule Status service allows users to check the status of submitted subset job

* `Metadata Compliance Checker <http:https://podaac-uat.jpl.nasa.gov/mcc>`_: an online tool and web service designed to check and validate the contents of netCDF and HDF granules for the Climate and Forecast (CF) and Attribute Convention for Dataset Discovery (ACDD) metadata conventions.

Expand Down
18 changes: 9 additions & 9 deletions docs/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ For more information on these functions, see :doc:`utilities`

Retrieving Dataset Metadata
^^^^^^^^^^^^^^^^^^^^^^^^^^^
`Dataset Metadata <http:https://podaac.jpl.nasa.gov/ws/search/dataset/index.html>`_ - retrieves the metadata of a dataset. In the following code snippet lets retrieve dataset metadata for GHRSST Level 2P Atlantic Regional Skin Sea Surface Temperature from the Spinning Enhanced Visible and InfraRed Imager (SEVIRI) on the Meteosat Second Generation (MSG-2) satellite e.g. dataset id **PODAAC-GHMG2-2PO01** ::
`Dataset Metadata <https:https://podaac.jpl.nasa.gov/ws/search/dataset/index.html>`_ - retrieves the metadata of a dataset. In the following code snippet lets retrieve dataset metadata for GHRSST Level 2P Atlantic Regional Skin Sea Surface Temperature from the Spinning Enhanced Visible and InfraRed Imager (SEVIRI) on the Meteosat Second Generation (MSG-2) satellite e.g. dataset id **PODAAC-GHMG2-2PO01** ::

result = p.dataset_metadata(dataset_id='PODAAC-GHMG2-2PO01')

Expand All @@ -77,7 +77,7 @@ For more information on this function, see :doc:`webservices`

Retrieving Granule Metadata
^^^^^^^^^^^^^^^^^^^^^^^^^^^
`Granule Metadata <http:https://podaac.jpl.nasa.gov/ws/metadata/granule/index.html>`_ - retrieves the metadata of a granule. In the following code snippet we retrieve granule metadata for the above dataset e.g. granule_name **20120912-MSG02-OSDPD-L2P-MSG02_0200Z-v01.nc** ::
`Granule Metadata <https:https://podaac.jpl.nasa.gov/ws/metadata/granule/index.html>`_ - retrieves the metadata of a granule. In the following code snippet we retrieve granule metadata for the above dataset e.g. granule_name **20120912-MSG02-OSDPD-L2P-MSG02_0200Z-v01.nc** ::

result = p.granule_metadata(dataset_id='PODAAC-GHMG2-2PO01', granule_name='20120912-MSG02-OSDPD-L2P-MSG02_0200Z-v01.nc')

Expand All @@ -93,7 +93,7 @@ For more information on this function, see :doc:`webservices`

Retrieving Dataset Variables
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`Dataset Variables <http:https://podaac.jpl.nasa.gov/ws/dataset/variables/index.html>`_ - provides a list of variable for the datset. In the following code snippet we retrieve the dataset variables for the dataset id **PODAAC-ASOP2-25X01** ::
`Dataset Variables <https:https://podaac.jpl.nasa.gov/ws/dataset/variables/index.html>`_ - provides a list of variable for the datset. In the following code snippet we retrieve the dataset variables for the dataset id **PODAAC-ASOP2-25X01** ::

result = p..dataset_variables(dataset_id='PODAAC-ASOP2-25X01')

Expand All @@ -102,7 +102,7 @@ For more information on this function, see :doc:`webservices`

Searching for Datasets
^^^^^^^^^^^^^^^^^^^^^^
`Search Dataset <http:https://podaac.jpl.nasa.gov/ws/search/dataset/index.html>`_ - searches PO.DAAC's dataset catalog, over Level 2, Level 3, and Level 4 datasets. In the following code snippet we will search using a keyword e.g. **modis** ::
`Search Dataset <https:https://podaac.jpl.nasa.gov/ws/search/dataset/index.html>`_ - searches PO.DAAC's dataset catalog, over Level 2, Level 3, and Level 4 datasets. In the following code snippet we will search using a keyword e.g. **modis** ::

result = p.dataset_search(keyword='modis')

Expand All @@ -111,7 +111,7 @@ For more information on this function, see :doc:`webservices`

Searching for Granules
^^^^^^^^^^^^^^^^^^^^^^^
`Search Granule <http:https://podaac.jpl.nasa.gov/ws/search/granule/index.html>`_ - does granule searching on PO.DAAC level 2 swath datasets (individual orbits of a satellite), and level 3 & 4 gridded datasets (time averaged to span the globe). In the following code snippet we will search for granules within a specific dataset e.g. **PODAAC-ASOP2-25X01** ::
`Search Granule <https:https://podaac.jpl.nasa.gov/ws/search/granule/index.html>`_ - does granule searching on PO.DAAC level 2 swath datasets (individual orbits of a satellite), and level 3 & 4 gridded datasets (time averaged to span the globe). In the following code snippet we will search for granules within a specific dataset e.g. **PODAAC-ASOP2-25X01** ::

result = p.granule_search(dataset_id='PODAAC-ASOP2-25X01', bbox='0,0,180,90',start_time='2013-01-01T01:30:00Z',end_time='2014-01-01T00:00:00Z',start_index='1'))

Expand All @@ -120,7 +120,7 @@ For more information on this function, see :doc:`webservices`

Retrieve granule images
^^^^^^^^^^^^^^^^^^^^^^^
`Granule Preview <http:https://podaac.jpl.nasa.gov/ws/image/granule/index.html>`_ - renders granules in the PO.DAAC's catalog to images such as jpeg and/or png. In the following code snippet we display a request using the dataset id **PODAAC-ASOP2-25X01** and image variable of the dataset **wind_speed** ::
`Granule Preview <https:https://podaac.jpl.nasa.gov/ws/image/granule/index.html>`_ - renders granules in the PO.DAAC's catalog to images such as jpeg and/or png. In the following code snippet we display a request using the dataset id **PODAAC-ASOP2-25X01** and image variable of the dataset **wind_speed** ::

result = p.granule_preview(dataset_id='PODAAC-ASOP2-25X01', image_variable='wind_speed')

Expand All @@ -132,7 +132,7 @@ For more information on this function, see :doc:`webservices`

Subsetting Granules
^^^^^^^^^^^^^^^^^^^
`Granule Subset <http:https://podaac.jpl.nasa.gov/ws/subset/granule/index.html>`_ - the Granule Subset web service sets up a granule subsetting job using HTTP POST request. Upon a successful request, a token is returned which can be used to check the status of the subsetting job. In the following code snippet we will subset a granule using an input.json file which contains ::
`Granule Subset <https:https://podaac.jpl.nasa.gov/ws/subset/granule/index.html>`_ - the Granule Subset web service sets up a granule subsetting job using HTTP POST request. Upon a successful request, a token is returned which can be used to check the status of the subsetting job. In the following code snippet we will subset a granule using an input.json file which contains ::

query={
"email":"[email protected]",
Expand All @@ -154,7 +154,7 @@ For more information on this function, see :doc:`webservices`

Subset Status
^^^^^^^^^^^^^
`Subset Status <http:https://podaac.jpl.nasa.gov/ws/subset/status/index.html>`_ - the subset status checks the status on the existing job. In the following code snippet we check the status using the token received from PO.DAAC when we submitted a job for subsetting ::
`Subset Status <https:https://podaac.jpl.nasa.gov/ws/subset/status/index.html>`_ - the subset status checks the status on the existing job. In the following code snippet we check the status using the token received from PO.DAAC when we submitted a job for subsetting ::

result = p.granule_preview(dataset_id='PODAAC-ASOP2-25X01', image_variable='wind_speed')

Expand All @@ -163,7 +163,7 @@ For more information on this function, see :doc:`webservices`

Extract level4 granule
^^^^^^^^^^^^^^^^^^^^^^
Right now the `Extract Granule <http:https://podaac.jpl.nasa.gov/ws/extract/granule/index.html>` supports only level 2 granules. Extract l4 granule is an add-on over extract granule to extract level 4 gridded datasets from the PODAAC data source. In the following code snippet we extract a level4 granule with Dataset ID = **PODAAC-CCF30-01XXX**, short_name of **CCMP_MEASURES_ATLAS_L4_OW_L3_0_WIND_VECTORS_FLK** and provide a path to the directory you want to have it saved as **netcdf** ::
Right now the `Extract Granule <https:https://podaac.jpl.nasa.gov/ws/extract/granule/index.html>` supports only level 2 granules. Extract l4 granule is an add-on over extract granule to extract level 4 gridded datasets from the PODAAC data source. In the following code snippet we extract a level4 granule with Dataset ID = **PODAAC-CCF30-01XXX**, short_name of **CCMP_MEASURES_ATLAS_L4_OW_L3_0_WIND_VECTORS_FLK** and provide a path to the directory you want to have it saved as **netcdf** ::

result = p.extract_l4_granule(dataset_id='PODAAC-CCF30-01XXX', short_name='CCMP_MEASURES_ATLAS_L4_OW_L3_0_WIND_VECTORS_FLK', path='path/to/the/destination/directory')

Expand Down
2 changes: 1 addition & 1 deletion podaac/tests/podaac_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def test_granule_search(self):
dataset_id=test_dataset_id, start_time=start_time, end_time=end_time, bbox=bbox, start_index=start_index, format=format)
root = ET.fromstring(granules.encode('utf-8'))
dataset_id = root.find('{http:https://www.w3.org/2005/Atom}entry').find(
'{http:https://podaac.jpl.nasa.gov/opensearch/}datasetId').text.rsplit('.')[0]
'{https:https://podaac.jpl.nasa.gov/opensearch/}datasetId').text.rsplit('.')[0]

assert granules != None
assert test_dataset_id == dataset_id
Expand Down

0 comments on commit cc43c76

Please sign in to comment.