Skip to content

Commit

Permalink
Add callout to nonfunctional doc
Browse files Browse the repository at this point in the history
  • Loading branch information
mfisher87 committed Aug 8, 2024
1 parent 38ebec9 commit b1e9b5f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
18 changes: 12 additions & 6 deletions doc/source/example_notebooks/IS2_data_visualization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
"source": [
"# Visualizing ICESat-2 Elevations\n",
"\n",
"This notebook ({nb-download}`download <IS2_data_visualization.ipynb>`) demonstrates interactive ICESat-2 elevation visualization by requesting data from [OpenAltimetry](https://www.openaltimetry.org/) based on metadata provided by [icepyx](https://icepyx.readthedocs.io/en/latest/). We will show how to plot spatial extent and elevation interactively. "
"This notebook ({nb-download}`download <IS2_data_visualization.ipynb>`) demonstrates interactive ICESat-2 elevation visualization by requesting data from [OpenAltimetry](https://www.openaltimetry.org/) based on metadata provided by [icepyx](https://icepyx.readthedocs.io/en/latest/). We will show how to plot spatial extent and elevation interactively.\n",
"\n",
"> ⚠️ **This notebook is currently non-functional**\n",
">\n",
"> Visualizations requiring the OpenAltimetry API are currently (August 2024) unavailable\n",
"> while hosting of OpenAltimetry transitions from UCSD to NSIDC. A ticket has been issued\n",
"> to restore programmatic API access."
]
},
{
Expand All @@ -33,7 +39,7 @@
"id": "57f2cfd8",
"metadata": {},
"source": [
"Create an ICESat-2 query object\n",
"## Create an ICESat-2 query object\n",
"\n",
"Set the desired parameters for your data visualization.\n",
"\n",
Expand Down Expand Up @@ -222,16 +228,16 @@
"### Alternative Access Options to Visualize ICESat-2 elevation using OpenAltimetry API\n",
"\n",
"You can also view elevation data by importing the visualization module directly and initializing it with your query object or a list of parameters:\n",
" ```\n",
" ```python\n",
" from icepyx.core.visualization import Visualize\n",
" ```\n",
" - passing your query object directly to the visualization module\n",
" ```\n",
" ```python\n",
" region2 = ipx.Query(short_name, spatial_extent, date_range)\n",
" vis = Visualize(region2)\n",
" ```\n",
" - creating a visualization object directly without first creating a query object\n",
" ```\n",
" ```python\n",
" vis = Visualize(product=short_name, spatial_extent=spatial_extent, date_range=date_range)\n",
" ```"
]
Expand Down Expand Up @@ -264,7 +270,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.12.4"
}
},
"nbformat": 4,
Expand Down
15 changes: 11 additions & 4 deletions icepyx/core/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,13 @@ def make_request(self, base_url, payload):
--------
request_OA_data
"""
return requests.get(base_url, params=payload)
response = requests.get(base_url, params=payload)

Check warning on line 315 in icepyx/core/visualization.py

View check run for this annotation

Codecov / codecov/patch

icepyx/core/visualization.py#L315

Added line #L315 was not covered by tests
if not response.ok:
raise RuntimeError(

Check warning on line 317 in icepyx/core/visualization.py

View check run for this annotation

Codecov / codecov/patch

icepyx/core/visualization.py#L317

Added line #L317 was not covered by tests
f"Status {response.status_code} requesting url {response.request.url}"
)

return response

Check warning on line 321 in icepyx/core/visualization.py

View check run for this annotation

Codecov / codecov/patch

icepyx/core/visualization.py#L321

Added line #L321 was not covered by tests

def request_OA_data(self, paras) -> da.array:
"""
Expand All @@ -331,9 +337,10 @@ def request_OA_data(self, paras) -> da.array:
"""

warnings.warn(
"NOTICE: visualizations requiring the OpenAltimetry API are currently (October 2023) "
"unavailable while hosting of OpenAltimetry transitions from UCSD to NSIDC."
"A ticket has been issued to restore programmatic API access."
"NOTICE: visualizations requiring the OpenAltimetry API are currently"
" (August 2024) unavailable while hosting of OpenAltimetry transitions from"
" UCSD to NSIDC. A ticket has been issued to restore programmatic API"
" access."
)

base_url = "http://openaltimetry.earthdatacloud.nasa.gov/data/api/icesat2"
Expand Down

0 comments on commit b1e9b5f

Please sign in to comment.