Skip to content

Commit

Permalink
docs: move notebooks and use myst
Browse files Browse the repository at this point in the history
fix: correct error when using default bounds in `extract_constants` for #356
fix: correct `TPXO10-atlas-v2` binary grid filename
  • Loading branch information
tsutterley committed Oct 31, 2024
1 parent 5c4bca1 commit d7d8c6a
Show file tree
Hide file tree
Showing 20 changed files with 290 additions and 203 deletions.
1 change: 1 addition & 0 deletions doc/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies:
- freetype
- graphviz
- lxml
- myst-nb
- netCDF4
- numpy
- numpydoc
Expand Down
8 changes: 8 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,19 @@
extensions = [
"sphinx.ext.autodoc",
"numpydoc",
"myst_nb",
"sphinx.ext.graphviz",
"sphinx.ext.viewcode",
"sphinxarg.ext"
]

# use myst for notebooks
source_suffix = {
".rst": "restructuredtext",
".ipynb": "myst-nb",
}
nb_execution_mode = "off"

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,29 @@
"Check Tide Map\n",
"==============\n",
"\n",
"Check if a given point is within a tide model domain\n",
"This ({nb-download}`notebook <Check-Tide-Map.ipynb>`) demonstrates checking if given points are within a tide model domain\n",
"\n",
"OTIS format tidal solutions provided by Oregon State University and ESR \n",
"- http://volkov.oce.orst.edu/tides/region.html \n",
"- https://www.esr.org/research/polar-tide-models/list-of-polar-tide-models/\n",
"- ftp://ftp.esr.org/pub/datasets/tmd/ \n",
"- [http://volkov.oce.orst.edu/tides/region.html](http://volkov.oce.orst.edu/tides/region.html) \n",
"- [https://www.esr.org/research/polar-tide-models/list-of-polar-tide-models/](https://www.esr.org/research/polar-tide-models/list-of-polar-tide-models/)\n",
"- [ftp://ftp.esr.org/pub/datasets/tmd/](ftp://ftp.esr.org/pub/datasets/tmd/) \n",
"\n",
"Global Tide Model (GOT) solutions provided by Richard Ray at GSFC \n",
"- [https://earth.gsfc.nasa.gov/geo/data/ocean-tide-models](https://earth.gsfc.nasa.gov/geo/data/ocean-tide-models)\n",
"\n",
"Finite Element Solution (FES) provided by AVISO \n",
"- https://www.aviso.altimetry.fr/en/data/products/auxiliary-products/global-tide-fes.html\n",
"- [https://www.aviso.altimetry.fr/en/data/products/auxiliary-products/global-tide-fes.html](https://www.aviso.altimetry.fr/en/data/products/auxiliary-products/global-tide-fes.html\n",
")\n",
"\n",
"#### Python Dependencies\n",
"## Python Dependencies\n",
" - [numpy: Scientific Computing Tools For Python](https://www.numpy.org) \n",
" - [scipy: Scientific Tools for Python](https://www.scipy.org/) \n",
" - [pyproj: Python interface to PROJ library](https://pypi.org/project/pyproj/) \n",
" - [netCDF4: Python interface to the netCDF C library](https://unidata.github.io/netcdf4-python/) \n",
" - [matplotlib: Python 2D plotting library](https://matplotlib.org/) \n",
" - [ipyleaflet: Jupyter / Leaflet bridge enabling interactive maps](https://github.com/jupyter-widgets/ipyleaflet) \n",
"\n",
"#### Program Dependencies\n",
"## Program Dependencies\n",
"\n",
"- `crs.py`: Coordinate Reference System (CRS) routines\n",
"- `io.model.py`: retrieves tide model parameters for named tide models\n",
Expand All @@ -44,7 +46,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Load modules"
"## Load modules"
]
},
{
Expand All @@ -69,6 +71,16 @@
"%autoreload 2"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Set parameters for program\n",
"\n",
"- Model directory \n",
"- Tide model "
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -88,6 +100,13 @@
"])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Select location to check"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -102,6 +121,13 @@
"m.map"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Read and create mask of valid model values"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -200,6 +226,13 @@
" IPython.display.display(m.figure)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Plot mask and selected location"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@
"Plot ATLAS Compact\n",
"==================\n",
"\n",
"Check if a given point is within a tide model domain\n",
"This ({nb-download}`notebook <Plot-ATLAS-Compact.ipynb>`) demonstrates plotting the global and local solutions from an ATLAS compact model\n",
"\n",
"OTIS format tidal solutions provided by Oregon State University and ESR \n",
"- http://volkov.oce.orst.edu/tides/region.html \n",
"- [http://volkov.oce.orst.edu/tides/region.html](http://volkov.oce.orst.edu/tides/region.html) \n",
"\n",
"#### Python Dependencies\n",
"\n",
"## Python Dependencies\n",
" - [numpy: Scientific Computing Tools For Python](https://www.numpy.org) \n",
" - [scipy: Scientific Tools for Python](https://www.scipy.org/) \n",
" - [pyproj: Python interface to PROJ library](https://pypi.org/project/pyproj/) \n",
" - [netCDF4: Python interface to the netCDF C library](https://unidata.github.io/netcdf4-python/) \n",
" - [matplotlib: Python 2D plotting library](https://matplotlib.org/) \n",
"\n",
"#### Program Dependencies\n",
"## Program Dependencies\n",
"\n",
"- `io.model.py`: retrieves tide model parameters for named tide models\n",
"- `io.OTIS.py`: extract tidal harmonic constants from OTIS tide models \n",
Expand All @@ -32,7 +33,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Load modules"
"## Load modules"
]
},
{
Expand All @@ -54,6 +55,16 @@
"%autoreload 2"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Set parameters for program\n",
"\n",
"- Model directory \n",
"- Tide model "
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -74,6 +85,13 @@
"])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Setup tide model parameters"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -88,6 +106,13 @@
"constituents,nc = pyTMD.io.OTIS.read_constituents(model.model_file)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Read ATLAS Compact model"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -102,6 +127,13 @@
"x30,y30,hz30 = pyTMD.io.OTIS.interpolate_atlas_model(x0,y0,hz0)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Plot global and local masks"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -127,6 +159,13 @@
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Plot differences between global and local solutions"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,28 @@
"Plot Antarctic Cotidal Charts\n",
"=============================\n",
"\n",
"Demonstrates plotting cotidal charts around Antarctica\n",
"This ({nb-download}`notebook <Plot-Antarctic-Cotidal-Charts.ipynb>`) demonstrates plotting cotidal charts for selected constituents around Antarctica\n",
"\n",
"OTIS format tidal solutions provided by Oregon State University and ESR \n",
"- http://volkov.oce.orst.edu/tides/region.html \n",
"- https://www.esr.org/research/polar-tide-models/list-of-polar-tide-models/\n",
"- ftp://ftp.esr.org/pub/datasets/tmd/ \n",
"- [http://volkov.oce.orst.edu/tides/region.html](http://volkov.oce.orst.edu/tides/region.html) \n",
"- [https://www.esr.org/research/polar-tide-models/list-of-polar-tide-models/](https://www.esr.org/research/polar-tide-models/list-of-polar-tide-models/)\n",
"- [ftp://ftp.esr.org/pub/datasets/tmd/](ftp://ftp.esr.org/pub/datasets/tmd/) \n",
"\n",
"Global Tide Model (GOT) solutions provided by Richard Ray at GSFC \n",
"- [https://earth.gsfc.nasa.gov/geo/data/ocean-tide-models](https://earth.gsfc.nasa.gov/geo/data/ocean-tide-models)\n",
"\n",
"Finite Element Solution (FES) provided by AVISO \n",
"- https://www.aviso.altimetry.fr/en/data/products/auxiliary-products/global-tide-fes.html\n",
"- [https://www.aviso.altimetry.fr/en/data/products/auxiliary-products/global-tide-fes.html](https://www.aviso.altimetry.fr/en/data/products/auxiliary-products/global-tide-fes.html)\n",
"\n",
"#### Python Dependencies\n",
"## Python Dependencies\n",
" - [numpy: Scientific Computing Tools For Python](https://www.numpy.org) \n",
" - [scipy: Scientific Tools for Python](https://www.scipy.org/) \n",
" - [pyproj: Python interface to PROJ library](https://pypi.org/project/pyproj/) \n",
" - [netCDF4: Python interface to the netCDF C library](https://unidata.github.io/netcdf4-python/) \n",
" - [matplotlib: Python 2D plotting library](http://matplotlib.org/) \n",
" - [cartopy: Python package designed for geospatial data processing](https://scitools.org.uk/cartopy/docs/latest/) \n",
"\n",
"#### Program Dependencies\n",
"## Program Dependencies\n",
"\n",
"- `arguments.py`: load the nodal corrections for tidal constituents \n",
"- `astro.py`: computes the basic astronomical mean longitudes \n",
Expand All @@ -49,7 +50,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Load modules"
"## Load modules"
]
},
{
Expand Down Expand Up @@ -80,7 +81,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Set parameters for program\n",
"## Set parameters for program\n",
"\n",
"- Model directory \n",
"- Tide model "
Expand Down Expand Up @@ -109,7 +110,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Setup tide model parameters"
"## Setup tide model parameters"
]
},
{
Expand All @@ -128,7 +129,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Setup coordinates for calculating tidal amplitudes"
"## Setup coordinates for calculating tidal amplitudes"
]
},
{
Expand Down Expand Up @@ -159,7 +160,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Calculate tide map"
"## Calculate tide map"
]
},
{
Expand Down Expand Up @@ -192,7 +193,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Select constituent for cotidal chart"
"## Select constituent for cotidal chart"
]
},
{
Expand All @@ -210,7 +211,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Create cotidal chart"
"## Create cotidal chart"
]
},
{
Expand Down
Loading

0 comments on commit d7d8c6a

Please sign in to comment.