-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make mypy happy and add variables list
- Loading branch information
Yang
committed
Jul 11, 2023
1 parent
cf04f55
commit 2d2825c
Showing
6 changed files
with
247 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### Handle ERA5 dataset with Zampy\n", | ||
"Demo notebook for developers." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import numpy as np\n", | ||
"from zampy.datasets import ERA5\n", | ||
"from zampy.datasets.dataset_protocol import TimeBounds, SpatialBounds\n", | ||
"from pathlib import Path" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"work_dir = Path(\"/home/yangliu/EcoExtreML/temp\")\n", | ||
"download_dir = work_dir / \"download\"\n", | ||
"ingest_dir = work_dir / \"ingest\"\n", | ||
"times = TimeBounds(np.datetime64(\"2010-01-01\"), np.datetime64(\"2010-01-31\"))\n", | ||
"bbox_demo = SpatialBounds(54, 56, 1, 3)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"File 'era5_10m_v_component_of_wind_2010-1.nc' already exists, skipping...\n", | ||
"File 'era5_surface_solar_radiation_downwards_2010-1.nc' already exists, skipping...\n" | ||
] | ||
}, | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"True" | ||
] | ||
}, | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"era5_dataset = ERA5()\n", | ||
"era5_dataset.download(\n", | ||
" download_dir=download_dir,\n", | ||
" time_bounds=times,\n", | ||
" spatial_bounds=bbox_demo,\n", | ||
" variable_names=[\"10m_v_component_of_wind\",\n", | ||
" \"surface_solar_radiation_downwards\",\n", | ||
" \"mean_total_precipitation_rate\",\n", | ||
" \"surface_pressure\",],\n", | ||
")" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "ecoextreml", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.0" | ||
}, | ||
"orig_nbformat": 4 | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.