Skip to content

Commit

Permalink
Merge pull request #745 from nsidc/key-removal
Browse files Browse the repository at this point in the history
Key removal
  • Loading branch information
asteiker authored Jul 3, 2024
2 parents e7cb5bc + 5bc9fb9 commit 2c42003
Showing 1 changed file with 29 additions and 54 deletions.
83 changes: 29 additions & 54 deletions docs/howto/edl.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,7 @@
"execution_count": 1,
"id": "ce723d6f-8b5f-43e1-9531-19ee08a056fe",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"You're now authenticated with NASA Earthdata Login\n",
"Using token with expiration date: 09/25/2023\n",
"Using environment variables for EDL\n"
]
}
],
"outputs": [],
"source": [
"import earthaccess\n",
"\n",
Expand All @@ -40,32 +30,17 @@
"metadata": {},
"source": [
"### Data in AWS\n",
"If the data we want to access is on AWS, we can use earthaccess to generate temporary S3 credentials for any of the DAACs"
"If the data we want to access is on AWS, we can use earthaccess to generate temporary S3 credentials for any of the DAACs. This line is commented out for security reasons. "
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "3108ff21-1ea2-449b-b2f5-b442dd3b61f5",
"execution_count": 2,
"id": "f1f45172-c9c3-4f25-ad7e-acf94fba8b1d",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'accessKeyId': 'ASIA2D3OGJNTE2UAIDHR',\n",
" 'secretAccessKey': '9+6D3m76HTuNi3qvbgUMBFlJECsCgPyJ4ur2CfZL',\n",
" 'sessionToken': 'FwoGZXIvYXdzEPL//////////wEaDIVnMBd6zBaEKmG58CLpAXrPN52vpRHvs+0y960kNwGOdFHPD81WVsdeUciP/vQvsU/xX4Cg+iLH/OXDlH/PBWCmSgfk4vgXD9k6r2JRmnpkwyF4v4K4+ciIuUHNG43ZegSFtkzZoLHShLtEnNu/OIT0TlcrOLJIY+TnjEDcKkXiLSsLYB7qDKZIeg654oPCkjeXyDuoWOumJa7utBEwHmakOGdGJTthOfbfJ6RJ9sbPbmsEXg0bHF5PY9h3/Eoq0rjyRmlb1WYuopw5YK8dL5N9IwSKlKiu19Cj0nd04XVNuiB02+fLDubsnKK1b3j0jR53qAU3FxobKLHgj6YGMi0kDN7xWP6yqI7Ry69Lf5EEcDRVp4UVz6llGYoDpsKr9s3cXaBljkhEjH7N5dQ=',\n",
" 'expiration': '2023-07-28 17:43:29+00:00'}"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"s3_credentials = auth.get_s3_credentials(\"NSIDC\")\n",
"s3_credentials"
"#s3_credentials = auth.get_s3_credentials(\"NSIDC\")"
]
},
{
Expand All @@ -88,7 +63,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 3,
"id": "a7bb1a93-6f85-40cd-93b4-ce821a03a8b5",
"metadata": {},
"outputs": [],
Expand All @@ -102,7 +77,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 4,
"id": "c0f4e286-8ce9-4cde-b3a2-631b361a0d51",
"metadata": {},
"outputs": [
Expand All @@ -112,7 +87,7 @@
"'�HDF\\r\\n\\x1a\\n\\x00\\x00\\x00\\x00\\x00\\x08\\x08\\x00\\x04\\x00\\x10\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00���������HUn\\x00\\x00\\x00\\x00��������\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00`\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00OHDR\\x02'"
]
},
"execution_count": 15,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -133,7 +108,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 5,
"id": "1e5f5f7a-0643-42cb-b70c-4ac982824ff9",
"metadata": {},
"outputs": [],
Expand All @@ -143,7 +118,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 6,
"id": "fbc7bc5f-b984-4324-b095-3648a437fba2",
"metadata": {},
"outputs": [
Expand All @@ -153,7 +128,7 @@
"b'\\x89HDF\\r\\n\\x1a\\n\\x00\\x00\\x00\\x00\\x00\\x08\\x08\\x00\\x04\\x00\\x10\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xd7HUn\\x00\\x00\\x00\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00`\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00OHDR'"
]
},
"execution_count": 11,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -166,19 +141,19 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 7,
"id": "07433a9f-f276-4d2b-9ed3-f556df2884af",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "f68d214c1c4b4d0fb0b44d878a003a33",
"model_id": "c76e3afc58a84118a04144f2f08ff6bc",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"QUEUEING TASKS | : 0it [00:00, ?it/s]"
"QUEUEING TASKS | : 0%| | 0/1 [00:00<?, ?it/s]"
]
},
"metadata": {},
Expand All @@ -187,7 +162,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "185025ed0c284481982459d85c8dbb1f",
"model_id": "98f4219952eb4e9bb8f60ad67f438454",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -201,7 +176,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "ec660bd64a284df28a03705f56eea208",
"model_id": "9451a7fda27e4569968054028576999d",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -216,8 +191,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 983 ms, sys: 101 ms, total: 1.08 s\n",
"Wall time: 18.3 s\n"
"CPU times: user 1.4 s, sys: 179 ms, total: 1.58 s\n",
"Wall time: 10.5 s\n"
]
},
{
Expand Down Expand Up @@ -586,25 +561,25 @@
" stroke: currentColor;\n",
" fill: currentColor;\n",
"}\n",
"</style><pre class='xr-text-repr-fallback'>&lt;xarray.Dataset&gt;\n",
"</style><pre class='xr-text-repr-fallback'>&lt;xarray.Dataset&gt; Size: 3kB\n",
"Dimensions: (bands: 285)\n",
"Dimensions without coordinates: bands\n",
"Data variables:\n",
" wavelengths (bands) float32 ...\n",
" fwhm (bands) float32 ...\n",
" good_wavelengths (bands) float32 ...</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.Dataset</div></div><ul class='xr-sections'><li class='xr-section-item'><input id='section-5bccc958-c146-4c96-bff3-3bb1192cabe4' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-5bccc958-c146-4c96-bff3-3bb1192cabe4' class='xr-section-summary' title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'><ul class='xr-dim-list'><li><span>bands</span>: 285</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-1762f4af-4275-4de2-a60b-212974a37714' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-1762f4af-4275-4de2-a60b-212974a37714' class='xr-section-summary' title='Expand/collapse section'>Coordinates: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'></ul></div></li><li class='xr-section-item'><input id='section-a0ec6ab2-8789-423c-b8a5-68b7ad70c280' class='xr-section-summary-in' type='checkbox' checked><label for='section-a0ec6ab2-8789-423c-b8a5-68b7ad70c280' class='xr-section-summary' >Data variables: <span>(3)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>wavelengths</span></div><div class='xr-var-dims'>(bands)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-e0a4ffbe-5053-4b11-a89a-cac8825f524d' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-e0a4ffbe-5053-4b11-a89a-cac8825f524d' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-d5354c83-0276-431a-913a-bcd675945ac4' class='xr-var-data-in' type='checkbox'><label for='data-d5354c83-0276-431a-913a-bcd675945ac4' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>Wavelength Centers</dd><dt><span>units :</span></dt><dd>nm</dd></dl></div><div class='xr-var-data'><pre>[285 values with dtype=float32]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>fwhm</span></div><div class='xr-var-dims'>(bands)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-3c8797e7-1c1b-4423-ae85-057084395786' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-3c8797e7-1c1b-4423-ae85-057084395786' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-a54f045f-96b6-49c5-9266-e5615af70a7f' class='xr-var-data-in' type='checkbox'><label for='data-a54f045f-96b6-49c5-9266-e5615af70a7f' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>Full Width at Half Max</dd><dt><span>units :</span></dt><dd>nm</dd></dl></div><div class='xr-var-data'><pre>[285 values with dtype=float32]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>good_wavelengths</span></div><div class='xr-var-dims'>(bands)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-93a19519-a78f-4b37-9b63-fd503a602141' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-93a19519-a78f-4b37-9b63-fd503a602141' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-74aa0491-8340-4332-a2cc-d85b7aa96407' class='xr-var-data-in' type='checkbox'><label for='data-74aa0491-8340-4332-a2cc-d85b7aa96407' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>Wavelengths where reflectance is useable: 1 = good data, 0 = bad data</dd><dt><span>units :</span></dt><dd>unitless</dd></dl></div><div class='xr-var-data'><pre>[285 values with dtype=float32]</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-2e739f0a-61b0-4394-9f22-6e6de6d1b193' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-2e739f0a-61b0-4394-9f22-6e6de6d1b193' class='xr-section-summary' title='Expand/collapse section'>Indexes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'></ul></div></li><li class='xr-section-item'><input id='section-db876828-0745-4d96-a611-e74dbe3f8be3' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-db876828-0745-4d96-a611-e74dbe3f8be3' class='xr-section-summary' title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
" wavelengths (bands) float32 1kB ...\n",
" fwhm (bands) float32 1kB ...\n",
" good_wavelengths (bands) float32 1kB ...</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.Dataset</div></div><ul class='xr-sections'><li class='xr-section-item'><input id='section-b1b699f4-766b-4d09-8cbe-1d22a07ce34c' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-b1b699f4-766b-4d09-8cbe-1d22a07ce34c' class='xr-section-summary' title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'><ul class='xr-dim-list'><li><span>bands</span>: 285</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-3e1c77f1-41a1-4173-ac5a-c42885b8aba8' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-3e1c77f1-41a1-4173-ac5a-c42885b8aba8' class='xr-section-summary' title='Expand/collapse section'>Coordinates: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'></ul></div></li><li class='xr-section-item'><input id='section-03e1951c-1120-435b-98d3-26366989e0bf' class='xr-section-summary-in' type='checkbox' checked><label for='section-03e1951c-1120-435b-98d3-26366989e0bf' class='xr-section-summary' >Data variables: <span>(3)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>wavelengths</span></div><div class='xr-var-dims'>(bands)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-08f2a7d3-bd0d-41fc-a46a-7472dfe19761' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-08f2a7d3-bd0d-41fc-a46a-7472dfe19761' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-18d24452-7612-492f-a326-47d2a56a166a' class='xr-var-data-in' type='checkbox'><label for='data-18d24452-7612-492f-a326-47d2a56a166a' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>Wavelength Centers</dd><dt><span>units :</span></dt><dd>nm</dd></dl></div><div class='xr-var-data'><pre>[285 values with dtype=float32]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>fwhm</span></div><div class='xr-var-dims'>(bands)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-d1b8ab05-42d0-4abd-ad53-beb2718843de' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-d1b8ab05-42d0-4abd-ad53-beb2718843de' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-b43dba25-5b67-415e-9df1-ff527de84b8e' class='xr-var-data-in' type='checkbox'><label for='data-b43dba25-5b67-415e-9df1-ff527de84b8e' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>Full Width at Half Max</dd><dt><span>units :</span></dt><dd>nm</dd></dl></div><div class='xr-var-data'><pre>[285 values with dtype=float32]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>good_wavelengths</span></div><div class='xr-var-dims'>(bands)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-ca321b4b-ff16-471a-aec6-1147cd0ee4f9' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-ca321b4b-ff16-471a-aec6-1147cd0ee4f9' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-df0b3402-29b5-4277-a4d8-8988208f56b0' class='xr-var-data-in' type='checkbox'><label for='data-df0b3402-29b5-4277-a4d8-8988208f56b0' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>Wavelengths where reflectance is useable: 1 = good data, 0 = bad data</dd><dt><span>units :</span></dt><dd>unitless</dd></dl></div><div class='xr-var-data'><pre>[285 values with dtype=float32]</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-3fba5e55-9e87-4cbb-8a80-8dd5f46c7edd' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-3fba5e55-9e87-4cbb-8a80-8dd5f46c7edd' class='xr-section-summary' title='Expand/collapse section'>Indexes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'></ul></div></li><li class='xr-section-item'><input id='section-ef9fd5ca-497d-456e-afec-d21e885c1e22' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-ef9fd5ca-497d-456e-afec-d21e885c1e22' class='xr-section-summary' title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
],
"text/plain": [
"<xarray.Dataset>\n",
"<xarray.Dataset> Size: 3kB\n",
"Dimensions: (bands: 285)\n",
"Dimensions without coordinates: bands\n",
"Data variables:\n",
" wavelengths (bands) float32 ...\n",
" fwhm (bands) float32 ...\n",
" good_wavelengths (bands) float32 ..."
" wavelengths (bands) float32 1kB ...\n",
" fwhm (bands) float32 1kB ...\n",
" good_wavelengths (bands) float32 1kB ..."
]
},
"execution_count": 13,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -638,7 +613,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.16"
"version": "3.10.14"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 2c42003

Please sign in to comment.