Repository navigation
Update tutorial to use ERA5 data and jupyter notebooks - #269
Merged
Merged
Conversation
sjavis
force-pushed
the
tutorial-era5
branch
from
September 25, 2026 16:11
f635e7a to
0f1ebe8
Compare
sjavis
force-pushed
the
tutorial-era5
branch
from
September 29, 2026 17:59
d217e40 to
e6e6532
Compare
Use the input file's calendar when creating 'Trajectory's in TE. Split the time metadata into it's own function to enable this.
Uses nbsphinx to include the notebook. Uses nbsphinx_link to link them from the tutorial/ directory.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've updated the tutorial to use both ERA5 data and jupyter notebooks.
As with the old scripts, the notebooks can be run manually from the
tutorial/directory, but the outputs are also included in the documentation usingnbsphinx(andnbsphinx_linkto link to the the notebooks as they are outside the documentation folder). I added atutorialgroup for the dependencies for running the notebooks - jupyter, matplotlib, cartopy.The ERA5 data uses a single week of data (1950-09-01 to 1950-09-07) which includes about 4 active TCs. This takes much less time to download and preprocess (several minutes). I added
tutorial/fetch_data.pyto retrieve the data. It can do this in two ways:To use the ERA5 data I also made some other changes:
calculate_norm_xy/calculate_wind_speedto get the wind speed from components.multiply_fieldto multiply by a scalar - needed to convert geopotential to geopotential height or orography.set_time_unitsto update the "days since YYYY-MM-DD" units as TSTORMS can't use negative time values.squeeze_fieldto remove size-1 arrays as this needs to be done for some of the ERA5 data.flip_axisto flip a coordinate direction. ERA5 latitude is decreasing but TSTORMS needs increasing.set_netcdf_variable_namerenamed toset_netcdf_infoand made more general to add additional netcdf metadata.This partially addresses #224.