Skip to content

Commit

Permalink
fix message
Browse files Browse the repository at this point in the history
  • Loading branch information
shughes-uk committed Dec 11, 2023
1 parent b136144 commit 9eb8cd2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 29 deletions.
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: coiled
name: coiled-examples
channels:
- conda-forge
- defaults
Expand All @@ -20,4 +20,4 @@ dependencies:
- zarr
- h5netcdf
- pre-commit
- earthaccess
- earthaccess
39 changes: 12 additions & 27 deletions sea-level-rise.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"source": [
"# Analyzing Sea Level Rise in the Cloud with Coiled and Earthaccess\n",
"\n",
"_This notebook was adapted from [this NASA Earthdata Cloud Cookbook example](https://nasa-openscapes.github.io/earthdata-cloud-cookbook/external/Sea_level_rise_notebook.html)_"
"_This notebook was adapted from [this NASA Earthdata Cloud Cookbook example](https://nasa-openscapes.github.io/earthdata-cloud-cookbook/tutorials/Sea_Level_Rise.html)_"
]
},
{
Expand Down Expand Up @@ -51,16 +51,6 @@
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a1dd16b6-c5bb-4d40-a9f4-d3d60e44cd2c",
"metadata": {},
"outputs": [],
"source": [
"granules[0]"
]
},
{
"cell_type": "markdown",
"id": "64df6beb-e1e9-4691-b6ec-18dfa6803f53",
Expand All @@ -79,15 +69,14 @@
"import coiled\n",
"import xarray as xr\n",
"\n",
"@coiled.function(\n",
" region=\"us-west-2\", # Same region as data\n",
")\n",
"@coiled.function(region=\"us-west-2\") # Same region as data\n",
"def process(granule, fs):\n",
" results = []\n",
" for file in granule.data_links(\"direct\"):\n",
" ds = xr.open_dataset(fs.open(file))\n",
" ds = ds.sel(Latitude=slice(23, 50), Longitude=slice(270, 330))\n",
" results.append(ds.SLA)\n",
" ds = ds.SLA.where((ds.SLA >= 0) & (ds.SLA < 10))\n",
" results.append(ds)\n",
" result = xr.concat(results, dim=\"Time\")\n",
" return result"
]
Expand Down Expand Up @@ -152,23 +141,19 @@
]
},
{
"cell_type": "markdown",
"id": "85112fb8-130c-4134-b38e-2b7dc92b3840",
"cell_type": "code",
"execution_count": null,
"id": "41e5f464-5504-41d6-a170-96c57a4c6808",
"metadata": {},
"source": [
"## Finished result\n",
"\n",
"The variance of sea level altitude over time\n",
"\n",
"![](images/sea-level-rise.png)"
]
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python [conda env:coiled]",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "conda-env-coiled-py"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -180,7 +165,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 9eb8cd2

Please sign in to comment.