Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAAP CMR and .ops updates #213

Merged
merged 13 commits into from
Jun 1, 2023
132 changes: 74 additions & 58 deletions docs/source/science/GEDI/GEDI_L3.ipynb

Large diffs are not rendered by default.

174 changes: 85 additions & 89 deletions docs/source/science/HLS/HLSL30.ipynb

Large diffs are not rendered by default.

73 changes: 39 additions & 34 deletions docs/source/technical_tutorials/access/accessing_gedi_l3_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
"cells": [
{
"cell_type": "markdown",
"id": "2852ea6a",
"id": "d78d160b",
"metadata": {},
"source": [
"## Accessing Global Ecosystem Dynamics Investigation (GEDI) Level 3 Granule Data\n",
"\n",
"In this example, we demonstrate how to access GEDI Level 3 granule data on the MAAP ADE.\n",
"\n",
"Within your Jupyter Notebook, start by importing the `maap` package. Then invoke the `MAAP` constructor, setting the `maap_host` argument to `'api.ops.maap-project.org'`."
"Within your Jupyter Notebook, start by importing the `maap` package. Then invoke the `MAAP` constructor, setting the `maap_host` argument to `'api.maap-project.org'`."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "65ed6944",
"execution_count": 8,
"id": "3ed66695",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -24,66 +24,71 @@
"# import the maap package to handle queries\n",
"from maap.maap import MAAP\n",
"# invoke the MAAP constructor using the maap_host argument\n",
"maap = MAAP(maap_host='api.ops.maap-project.org')"
"maap = MAAP(maap_host='api.maap-project.org')"
]
},
{
"cell_type": "markdown",
"id": "5957f899",
"id": "f96596fb",
"metadata": {},
"source": [
"Search for a granule using the `searchGranule` function (for more information on searching for granules, see [Searching for Granules in MAAP](https://docs.maap-project.org/en/latest/search/granules.html)). Note that we can use `searchGranule`'s `cmr_host` argument to specify `cmr.maap-project.org` as the CMR instance. "
"Search for a granule using the `searchGranule` function (for more information on searching for granules, see [Searching for Granules in MAAP](https://docs.maap-project.org/en/latest/search/granules.html)). Note that we can use `searchGranule`'s `cmr_host` argument to specify `cmr.earthdata.nasa.gov` as the CMR instance. "
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "bb76be55",
"execution_count": 11,
"id": "1818a6af",
"metadata": {},
"outputs": [],
"source": [
"# search for granule data using CMR host name and collection concept ID arguments\n",
"results = maap.searchGranule(\n",
" cmr_host='cmr.maap-project.org',\n",
" collection_concept_id='C1201702030-NASA_MAAP'\n",
" cmr_host='cmr.earthdata.nasa.gov',\n",
" collection_concept_id='C2153683336-ORNL_CLOUD'\n",
")"
]
},
{
"cell_type": "markdown",
"id": "2d08b82b",
"id": "9dbee756",
"metadata": {},
"source": [
"Let's view the list of `GranuleUR`s within our `results`:"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "02acc4b5",
"execution_count": 12,
"id": "83b55546",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['GEDI_L3_LandSurface_Metrics_V2.GEDI03_elev_lowestmode_stddev_2019108_2020287_002_02.tif',\n",
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_counts_2019108_2020287_002_02.tif',\n",
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_counts_2019108_2021104_002_02.tif',\n",
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_rh100_mean_2019108_2020287_002_02.tif',\n",
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_rh100_stddev_2019108_2020287_002_02.tif',\n",
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_elev_lowestmode_stddev_2019108_2021104_002_02.tif',\n",
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_rh100_stddev_2019108_2021104_002_02.tif',\n",
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_elev_lowestmode_mean_2019108_2020287_002_02.tif',\n",
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_elev_lowestmode_mean_2019108_2021104_002_02.tif',\n",
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_rh100_stddev_2019108_2021104_002_02.tif',\n",
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_counts_2019108_2020287_002_02.tif',\n",
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_rh100_mean_2019108_2021104_002_02.tif',\n",
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_rh100_mean_2019108_2020287_002_02.tif',\n",
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_rh100_stddev_2019108_2020287_002_02.tif',\n",
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_counts_2019108_2021216_002_02.tif',\n",
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_rh100_mean_2019108_2021216_002_02.tif',\n",
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_elev_lowestmode_stddev_2019108_2021216_002_02.tif',\n",
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_elev_lowestmode_mean_2019108_2021216_002_02.tif',\n",
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_rh100_stddev_2019108_2021216_002_02.tif']"
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_rh100_stddev_2019108_2021216_002_02.tif',\n",
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_rh100_mean_2019108_2021216_002_02.tif',\n",
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_counts_2019108_2021216_002_02.tif',\n",
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_elev_lowestmode_mean_2019108_2022019_002_03.tif',\n",
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_counts_2019108_2022019_002_03.tif',\n",
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_rh100_mean_2019108_2022019_002_03.tif',\n",
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_elev_lowestmode_stddev_2019108_2022019_002_03.tif',\n",
" 'GEDI_L3_LandSurface_Metrics_V2.GEDI03_rh100_stddev_2019108_2022019_002_03.tif']"
]
},
"execution_count": 3,
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -95,16 +100,16 @@
},
{
"cell_type": "markdown",
"id": "e777c700",
"id": "ca5a52ac",
"metadata": {},
"source": [
"For this example, we are interested in downloading `GEDI03_elev_lowestmode_stddev_2019108_2021104_002_02.tif`."
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "18ab7e6a",
"execution_count": 13,
"id": "8765d0e4",
"metadata": {},
"outputs": [
{
Expand All @@ -113,49 +118,49 @@
"'GEDI_L3_LandSurface_Metrics_V2.GEDI03_elev_lowestmode_stddev_2019108_2021104_002_02.tif'"
]
},
"execution_count": 4,
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# select item\n",
"results[2]['Granule']['GranuleUR']"
"results[5]['Granule']['GranuleUR']"
]
},
{
"cell_type": "markdown",
"id": "332503ca",
"id": "bc450bee",
"metadata": {},
"source": [
"Now utilize the `getData` function, which downloads granule data if it doesn't already exist locally. We can use `getData` to download the third result from our granule search into the file system and assign its local path to a variable (in this case `download`)."
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "39e575aa",
"execution_count": 16,
"id": "ced4e2c4",
"metadata": {},
"outputs": [],
"source": [
"# download granule item\n",
"local_dir = '/projects/local_data' # download directory (absolute path or relative to current directory)\n",
"os.makedirs(local_dir, exist_ok=True) # create directories, as necessary\n",
"download = results[2].getData(local_dir) # default download directory is current directory, if no directory is given"
"download = results[5].getData(local_dir) # default download directory is current directory, if no directory is given"
]
},
{
"cell_type": "markdown",
"id": "65d960ba",
"id": "c00b4678",
"metadata": {},
"source": [
"We can then use the `print` function to see the file name and directory."
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "ccdfc922",
"execution_count": 17,
"id": "7b02a2ec",
"metadata": {},
"outputs": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
"cells": [
jjfrench marked this conversation as resolved.
Show resolved Hide resolved
{
"cell_type": "markdown",
"id": "2e8d6183",
"id": "ce359129",
"metadata": {},
"source": [
"## Accessing Global Ecosystem Dynamics Investigation (GEDI) Level 4A Granule Data\n",
"\n",
"In this example, we demonstrate how to access GEDI Level 4A granule data on the MAAP ADE.\n",
"\n",
"Within your Jupyter Notebook, start by importing the `maap` package. Then invoke the `MAAP` constructor, setting the `maap_host` argument to `'api.ops.maap-project.org'`."
"Within your Jupyter Notebook, start by importing the `maap` package. Then invoke the `MAAP` constructor, setting the `maap_host` argument to `'api.maap-project.org'`."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "2f250d6c",
"execution_count": 7,
"id": "7bb460a0",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -24,28 +24,28 @@
"# import the maap package to handle queries\n",
"from maap.maap import MAAP\n",
"# invoke the MAAP constructor using the maap_host argument\n",
"maap = MAAP(maap_host='api.ops.maap-project.org')"
"maap = MAAP(maap_host='api.maap-project.org')"
]
},
{
"cell_type": "markdown",
"id": "f6342077",
"id": "da26a534",
"metadata": {},
"source": [
"Search for a granule using the `searchGranule` function (for more information on searching for granules, see [Searching for Granules in MAAP](https://docs.maap-project.org/en/latest/search/granules.html)). Note that we can use `searchGranule`'s `cmr_host` argument to specify `cmr.maap-project.org` as the CMR instance. Then utilize the `getData` function, which downloads granule data if it doesn't already exist locally. We can use `getData` to download the first result from our granule search into the file system and assign its local path to a variable (in this case `download`)."
"Search for a granule using the `searchGranule` function (for more information on searching for granules, see [Searching for Granules in MAAP](https://docs.maap-project.org/en/latest/search/granules.html)). Note that we can use `searchGranule`'s `cmr_host` argument to specify `cmr.earthdata.nasa.gov` as the CMR instance. Then utilize the `getData` function, which downloads granule data if it doesn't already exist locally. We can use `getData` to download the first result from our granule search into the file system and assign its local path to a variable (in this case `download`)."
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "d1fbb45b",
"execution_count": 8,
"id": "6e1cecce",
"metadata": {},
"outputs": [],
"source": [
"# search for granule data using CMR host name, collection concept ID, and Granule UR arguments\n",
"results = maap.searchGranule(\n",
" cmr_host='cmr.maap-project.org',\n",
" collection_concept_id='C1202028193-NASA_MAAP',\n",
" cmr_host='cmr.earthdata.nasa.gov',\n",
" collection_concept_id='C2237824918-ORNL_CLOUD',\n",
" granule_ur='GEDI_L4A_AGB_Density_V2_1.GEDI04_A_2019107224731_O01958_01_T02638_02_002_02_V002.h5')\n",
"# download first result\n",
"local_dir = '/projects/local_data' # Download directory (absolute path or relative to current directory)\n",
Expand All @@ -55,16 +55,16 @@
},
{
"cell_type": "markdown",
"id": "73d354d9",
"id": "0dc32190",
"metadata": {},
"source": [
"We can then use the `print` function to see the file name and directory."
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "d71d4bcc",
"execution_count": 9,
"id": "356b97d2",
"metadata": {},
"outputs": [
{
Expand Down
5 changes: 2 additions & 3 deletions docs/source/technical_tutorials/search/granules.ipynb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -14,7 +13,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We begin by importing the `maap` and `pprint` packages. Then invoke the `MAAP` constructor, setting the `maap_host` argument to `'api.ops.maap-project.org'`."
"We begin by importing the `maap` and `pprint` packages. Then invoke the `MAAP` constructor, setting the `maap_host` argument to `'api.maap-project.org'`."
]
},
{
Expand All @@ -30,7 +29,7 @@
"from pprint import pprint\n",
"\n",
"# invoke the MAAP constructor using the maap_host argument\n",
"maap = MAAP(maap_host='api.ops.maap-project.org')"
"maap = MAAP(maap_host='api.maap-project.org')"
]
},
{
Expand Down
Loading