From d7d8c6aec88d54f2fc82df32cf03ef13d0655a4f Mon Sep 17 00:00:00 2001 From: tsutterley Date: Thu, 31 Oct 2024 09:08:09 -0700 Subject: [PATCH] docs: move notebooks and use myst fix: correct error when using default bounds in `extract_constants` for #356 fix: correct `TPXO10-atlas-v2` binary grid filename --- doc/environment.yml | 1 + doc/source/conf.py | 8 ++ .../source/notebooks/Check-Tide-Map.ipynb | 49 +++++++++-- .../source/notebooks/Plot-ATLAS-Compact.ipynb | 49 +++++++++-- .../Plot-Antarctic-Cotidal-Charts.ipynb | 29 ++++--- .../Plot-Antarctic-Tidal-Currents.ipynb | 26 +++--- .../notebooks/Plot-Antarctic-Tide-Range.ipynb | 29 ++++--- .../notebooks/Plot-Arctic-Ocean-Map.ipynb | 29 ++++--- .../notebooks/Plot-Ocean-Pole-Tide-Map.ipynb | 16 ++-- .../notebooks/Plot-Ross-Ice-Shelf-Map.ipynb | 27 +++--- .../notebooks/Plot-Tide-Forecasts.ipynb | 44 ++++++++-- .../notebooks/Solve-Synthetic-Tides.ipynb | 34 ++++++-- doc/source/user_guide/Examples.rst | 86 +++---------------- providers/TPXO.json | 4 +- pyTMD/data/database.json | 4 +- pyTMD/io/ATLAS.py | 16 ++-- pyTMD/io/FES.py | 12 +-- pyTMD/io/GOT.py | 12 +-- pyTMD/io/OTIS.py | 16 ++-- pyproject.toml | 2 +- 20 files changed, 290 insertions(+), 203 deletions(-) rename notebooks/Check Tide Map.ipynb => doc/source/notebooks/Check-Tide-Map.ipynb (86%) rename notebooks/Plot ATLAS Compact.ipynb => doc/source/notebooks/Plot-ATLAS-Compact.ipynb (90%) rename notebooks/Plot Antarctic Cotidal Charts.ipynb => doc/source/notebooks/Plot-Antarctic-Cotidal-Charts.ipynb (89%) rename notebooks/Plot Antarctic Tidal Currents.ipynb => doc/source/notebooks/Plot-Antarctic-Tidal-Currents.ipynb (91%) rename notebooks/Plot Antarctic Tide Range.ipynb => doc/source/notebooks/Plot-Antarctic-Tide-Range.ipynb (90%) rename notebooks/Plot Arctic Ocean Map.ipynb => doc/source/notebooks/Plot-Arctic-Ocean-Map.ipynb (90%) rename notebooks/Plot Ocean Pole Tide Map.ipynb => doc/source/notebooks/Plot-Ocean-Pole-Tide-Map.ipynb (86%) rename notebooks/Plot Ross Ice Shelf Map.ipynb => doc/source/notebooks/Plot-Ross-Ice-Shelf-Map.ipynb (90%) rename notebooks/Plot Tide Forecasts.ipynb => doc/source/notebooks/Plot-Tide-Forecasts.ipynb (88%) rename notebooks/Solve Synthetic Tides.ipynb => doc/source/notebooks/Solve-Synthetic-Tides.ipynb (93%) diff --git a/doc/environment.yml b/doc/environment.yml index 47ce8828..357be630 100644 --- a/doc/environment.yml +++ b/doc/environment.yml @@ -7,6 +7,7 @@ dependencies: - freetype - graphviz - lxml + - myst-nb - netCDF4 - numpy - numpydoc diff --git a/doc/source/conf.py b/doc/source/conf.py index 6e0355e7..9418e40b 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -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'] diff --git a/notebooks/Check Tide Map.ipynb b/doc/source/notebooks/Check-Tide-Map.ipynb similarity index 86% rename from notebooks/Check Tide Map.ipynb rename to doc/source/notebooks/Check-Tide-Map.ipynb index 24c42f9f..6465afe7 100644 --- a/notebooks/Check Tide Map.ipynb +++ b/doc/source/notebooks/Check-Tide-Map.ipynb @@ -8,19 +8,21 @@ "Check Tide Map\n", "==============\n", "\n", - "Check if a given point is within a tide model domain\n", + "This ({nb-download}`notebook `) 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", @@ -28,7 +30,7 @@ " - [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", @@ -44,7 +46,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Load modules" + "## Load modules" ] }, { @@ -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, @@ -88,6 +100,13 @@ "])" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Select location to check" + ] + }, { "cell_type": "code", "execution_count": null, @@ -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, @@ -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, diff --git a/notebooks/Plot ATLAS Compact.ipynb b/doc/source/notebooks/Plot-ATLAS-Compact.ipynb similarity index 90% rename from notebooks/Plot ATLAS Compact.ipynb rename to doc/source/notebooks/Plot-ATLAS-Compact.ipynb index b84fa346..26888778 100644 --- a/notebooks/Plot ATLAS Compact.ipynb +++ b/doc/source/notebooks/Plot-ATLAS-Compact.ipynb @@ -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 `) 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", @@ -32,7 +33,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Load modules" + "## Load modules" ] }, { @@ -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, @@ -74,6 +85,13 @@ "])" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Setup tide model parameters" + ] + }, { "cell_type": "code", "execution_count": null, @@ -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, @@ -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, @@ -127,6 +159,13 @@ "plt.show()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Plot differences between global and local solutions" + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/notebooks/Plot Antarctic Cotidal Charts.ipynb b/doc/source/notebooks/Plot-Antarctic-Cotidal-Charts.ipynb similarity index 89% rename from notebooks/Plot Antarctic Cotidal Charts.ipynb rename to doc/source/notebooks/Plot-Antarctic-Cotidal-Charts.ipynb index 3b9f348c..ff1d73dd 100644 --- a/notebooks/Plot Antarctic Cotidal Charts.ipynb +++ b/doc/source/notebooks/Plot-Antarctic-Cotidal-Charts.ipynb @@ -8,19 +8,20 @@ "Plot Antarctic Cotidal Charts\n", "=============================\n", "\n", - "Demonstrates plotting cotidal charts around Antarctica\n", + "This ({nb-download}`notebook `) 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", @@ -28,7 +29,7 @@ " - [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", @@ -49,7 +50,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Load modules" + "## Load modules" ] }, { @@ -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 " @@ -109,7 +110,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Setup tide model parameters" + "## Setup tide model parameters" ] }, { @@ -128,7 +129,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Setup coordinates for calculating tidal amplitudes" + "## Setup coordinates for calculating tidal amplitudes" ] }, { @@ -159,7 +160,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Calculate tide map" + "## Calculate tide map" ] }, { @@ -192,7 +193,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Select constituent for cotidal chart" + "## Select constituent for cotidal chart" ] }, { @@ -210,7 +211,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Create cotidal chart" + "## Create cotidal chart" ] }, { diff --git a/notebooks/Plot Antarctic Tidal Currents.ipynb b/doc/source/notebooks/Plot-Antarctic-Tidal-Currents.ipynb similarity index 91% rename from notebooks/Plot Antarctic Tidal Currents.ipynb rename to doc/source/notebooks/Plot-Antarctic-Tidal-Currents.ipynb index 74a9b3ed..25eba0d8 100644 --- a/notebooks/Plot Antarctic Tidal Currents.ipynb +++ b/doc/source/notebooks/Plot-Antarctic-Tidal-Currents.ipynb @@ -8,17 +8,17 @@ "Plot Antarctic Tidal Currents\n", "=============================\n", "\n", - "Demonstrates plotting hourly tidal currents around Antarctica\n", + "This ({nb-download}`notebook `) demonstrates creating an animation of hourly tidal currents 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", "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", @@ -26,7 +26,7 @@ " - [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", @@ -46,7 +46,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Load modules" + "## Load modules" ] }, { @@ -83,7 +83,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Set parameters for program\n", + "## Set parameters for program\n", "\n", "- Model directory \n", "- Tide model \n", @@ -114,7 +114,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Setup tide model parameters" + "## Setup tide model parameters" ] }, { @@ -133,7 +133,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Setup coordinates for calculating tidal currents" + "## Setup coordinates for calculating tidal currents" ] }, { @@ -164,7 +164,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Calculate tide map" + "## Calculate tide map" ] }, { @@ -228,7 +228,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Create animation of hourly tidal oscillation" + "## Create animation of hourly tidal oscillation" ] }, { diff --git a/notebooks/Plot Antarctic Tide Range.ipynb b/doc/source/notebooks/Plot-Antarctic-Tide-Range.ipynb similarity index 90% rename from notebooks/Plot Antarctic Tide Range.ipynb rename to doc/source/notebooks/Plot-Antarctic-Tide-Range.ipynb index 1573b42c..e70f3ca2 100644 --- a/notebooks/Plot Antarctic Tide Range.ipynb +++ b/doc/source/notebooks/Plot-Antarctic-Tide-Range.ipynb @@ -8,19 +8,20 @@ "Plot Antarctic Tide Range\n", "=========================\n", "\n", - "Demonstrates plotting the tidal amplitudes around Antarctica\n", + "This ({nb-download}`notebook `) demonstrates plotting the total combined tidal amplitude for all 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", @@ -28,7 +29,7 @@ " - [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", "- `crs.py`: Coordinate Reference System (CRS) routines \n", "- `io.model.py`: retrieves tide model parameters for named tide models \n", @@ -44,7 +45,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Load modules" + "## Load modules" ] }, { @@ -74,7 +75,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Set parameters for program\n", + "## Set parameters for program\n", "\n", "- Model directory \n", "- Tide model " @@ -103,7 +104,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Setup tide model parameters" + "## Setup tide model parameters" ] }, { @@ -122,7 +123,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Setup coordinates for calculating tides" + "## Setup coordinates for calculating tides" ] }, { @@ -153,7 +154,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Infer minor amplitudes from the major constituents" + "## Infer minor amplitudes from the major constituents" ] }, { @@ -208,7 +209,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Calculate tide map" + "## Calculate tide map" ] }, { @@ -248,7 +249,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Create plot of tidal range" + "## Create plot of tidal range" ] }, { diff --git a/notebooks/Plot Arctic Ocean Map.ipynb b/doc/source/notebooks/Plot-Arctic-Ocean-Map.ipynb similarity index 90% rename from notebooks/Plot Arctic Ocean Map.ipynb rename to doc/source/notebooks/Plot-Arctic-Ocean-Map.ipynb index 13abd338..bd18de86 100644 --- a/notebooks/Plot Arctic Ocean Map.ipynb +++ b/doc/source/notebooks/Plot-Arctic-Ocean-Map.ipynb @@ -6,21 +6,22 @@ "metadata": {}, "source": [ "Plot Arctic Ocean Map\n", - "==================\n", + "=====================\n", "\n", - "Demonstrates plotting hourly tidal displacements for the Arctic Ocean\n", + "This ({nb-download}`notebook `) demonstrates creating an animation of hourly tidal elevations for the Arctic Ocean\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", @@ -28,7 +29,7 @@ " - [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", @@ -49,7 +50,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Load modules" + "## Load modules" ] }, { @@ -86,7 +87,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Set parameters for program\n", + "## Set parameters for program\n", "\n", "- Model directory \n", "- Tide model \n", @@ -116,7 +117,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Setup tide model parameters" + "## Setup tide model parameters" ] }, { @@ -135,7 +136,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Setup coordinates for calculating tides" + "## Setup coordinates for calculating tides" ] }, { @@ -168,7 +169,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Calculate tide map" + "## Calculate tide map" ] }, { @@ -229,7 +230,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Create animation of hourly tidal oscillation" + "## Create animation of hourly tidal oscillation" ] }, { diff --git a/notebooks/Plot Ocean Pole Tide Map.ipynb b/doc/source/notebooks/Plot-Ocean-Pole-Tide-Map.ipynb similarity index 86% rename from notebooks/Plot Ocean Pole Tide Map.ipynb rename to doc/source/notebooks/Plot-Ocean-Pole-Tide-Map.ipynb index 4d394427..e4851cfe 100644 --- a/notebooks/Plot Ocean Pole Tide Map.ipynb +++ b/doc/source/notebooks/Plot-Ocean-Pole-Tide-Map.ipynb @@ -4,17 +4,19 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Plot Ocean Pole Tide Map\n", - "Plots maps of the real and imaginary geocentric pole tide admittance functions from [Desai et al. (2002)](https://doi.org/10.1029/2001JC001224)\n", + "Plot Ocean Pole Tide Map\n", + "========================\n", + "\n", + "This ({nb-download}`notebook `) demonstrates plotting maps of the real and imaginary geocentric pole tide admittance functions from [Desai et al. (2002)](https://doi.org/10.1029/2001JC001224)\n", "\n", "- [IERS map of ocean pole tide coefficients](ftp://maia.usno.navy.mil/conventions/2010/2010_update/chapter7/additional_info/opoleloadcoefcmcor.txt.gz)\n", "\n", - "#### Python Dependencies\n", + "## Python Dependencies\n", " - [numpy: Scientific Computing Tools For Python](https://www.numpy.org) \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", "- `io.ocean_pole_tide.py`: Read ocean pole load tide map from IERS\n", "- `utilities.py`: download and management utilities for files" @@ -24,7 +26,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Load modules" + "## Load modules" ] }, { @@ -43,7 +45,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Read ocean pole tide coefficient maps" + "## Read ocean pole tide coefficient maps" ] }, { @@ -61,7 +63,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Plot ocean pole tide maps" + "## Plot ocean pole tide maps" ] }, { diff --git a/notebooks/Plot Ross Ice Shelf Map.ipynb b/doc/source/notebooks/Plot-Ross-Ice-Shelf-Map.ipynb similarity index 90% rename from notebooks/Plot Ross Ice Shelf Map.ipynb rename to doc/source/notebooks/Plot-Ross-Ice-Shelf-Map.ipynb index 4c10c99e..490e26e3 100644 --- a/notebooks/Plot Ross Ice Shelf Map.ipynb +++ b/doc/source/notebooks/Plot-Ross-Ice-Shelf-Map.ipynb @@ -8,19 +8,20 @@ "Plot Ross Ice Shelf Map\n", "=======================\n", "\n", - "Demonstrates plotting hourly tidal displacements for the Ross Ice Shelf\n", + "This ({nb-download}`notebook `) creating an animation of hourly tidal elevations for the Ross Ice Shelf\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", @@ -28,7 +29,7 @@ " - [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", @@ -49,7 +50,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Load modules" + "## Load modules" ] }, { @@ -86,7 +87,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Set parameters for program\n", + "## Set parameters for program\n", "\n", "- Model directory \n", "- Tide model \n", @@ -117,7 +118,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Setup tide model parameters" + "## Setup tide model parameters" ] }, { @@ -136,7 +137,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Setup coordinates for calculating tides" + "## Setup coordinates for calculating tides" ] }, { @@ -167,7 +168,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Calculate tide map" + "## Calculate tide map" ] }, { @@ -228,7 +229,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Create animation of hourly tidal oscillation" + "## Create animation of hourly tidal oscillation" ] }, { diff --git a/notebooks/Plot Tide Forecasts.ipynb b/doc/source/notebooks/Plot-Tide-Forecasts.ipynb similarity index 88% rename from notebooks/Plot Tide Forecasts.ipynb rename to doc/source/notebooks/Plot-Tide-Forecasts.ipynb index cb9d46e0..60b5095c 100644 --- a/notebooks/Plot Tide Forecasts.ipynb +++ b/doc/source/notebooks/Plot-Tide-Forecasts.ipynb @@ -6,21 +6,22 @@ "metadata": {}, "source": [ "Plot Tide Forecasts\n", - "===================\n", + "=================== \n", "\n", - "Plots the daily tidal displacements for a given location\n", + "This ({nb-download}`notebook `) plotting a weekly forecast of tidal displacements at a given location\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", @@ -28,7 +29,7 @@ " - [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", "- `arguments.py`: load the nodal corrections for tidal constituents \n", "- `astro.py`: computes the basic astronomical mean longitudes \n", @@ -50,7 +51,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Load modules" + "## Load modules" ] }, { @@ -79,6 +80,17 @@ "%autoreload 2" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Set parameters for program\n", + "\n", + "- Model directory \n", + "- Tide model \n", + "- Date to run " + ] + }, { "cell_type": "code", "execution_count": null, @@ -99,6 +111,13 @@ "])" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Select location for tide forecast" + ] + }, { "cell_type": "code", "execution_count": null, @@ -113,6 +132,13 @@ "m.map" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Calculate and plot forecast" + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/notebooks/Solve Synthetic Tides.ipynb b/doc/source/notebooks/Solve-Synthetic-Tides.ipynb similarity index 93% rename from notebooks/Solve Synthetic Tides.ipynb rename to doc/source/notebooks/Solve-Synthetic-Tides.ipynb index ea888415..f32c2512 100644 --- a/notebooks/Solve Synthetic Tides.ipynb +++ b/doc/source/notebooks/Solve-Synthetic-Tides.ipynb @@ -8,9 +8,9 @@ "Solve Synthetic Tides\n", "=====================\n", "\n", - "Solves for the harmonic constants for a tidal time series\n", + "This ({nb-download}`notebook `) solving for the harmonic constants for a tidal time series at a given location\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", @@ -18,7 +18,7 @@ " - [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", "- `arguments.py`: load the nodal corrections for tidal constituents \n", "- `astro.py`: computes the basic astronomical mean longitudes \n", @@ -41,7 +41,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Load modules" + "## Load modules" ] }, { @@ -71,6 +71,16 @@ "%autoreload 2" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Set parameters for program\n", + "\n", + "- Model directory \n", + "- Tide model for synthetic " + ] + }, { "cell_type": "code", "execution_count": null, @@ -90,6 +100,13 @@ "])" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Select location for tide synthetic " + ] + }, { "cell_type": "code", "execution_count": null, @@ -108,7 +125,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### HTML table with outputs" + "## HTML table with outputs" ] }, { @@ -121,6 +138,13 @@ "display(table)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Calculate and plot solution" + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/doc/source/user_guide/Examples.rst b/doc/source/user_guide/Examples.rst index cb194389..306c9a97 100644 --- a/doc/source/user_guide/Examples.rst +++ b/doc/source/user_guide/Examples.rst @@ -8,75 +8,17 @@ Examples of using the ``pyTMD`` package are provided in the form of Jupyter Note Running the example notebooks requires a `full installation <../getting_started/Install.html>`_ of the ``pyTMD`` package to include all of the optional dependencies. The available examples include: -- Tide Map Checker |github check| |nbviewer check| - Check if a given point is within a tide model domain -- Tide Forecasts Plotter |github forecasts| |nbviewer forecasts| - Plots a weekly forecast of tidal displacements at a given location -- Harmonic Constants Solver |github solve| |nbviewer solve| - Solves for the amplitude and phase of harmonic constituents at a given location -- Antarctic Cotidal Chart Mapper |github cotidal| |nbviewer cotidal| - Plot the cotidal charts for selected constituents around Antarctica -- Antarctic Tidal Amplitudes Mapper |github range| |nbviewer range| - Plot the total combined tidal amplitude for all constituents around Antarctica -- Arctic Ocean Tide Mapper |github arctic| |nbviewer arctic| - Creates an animation of hourly tidal currents in the Arctic Ocean -- Antarctic Tidal Currents Mapper |github currents| |nbviewer currents| - Creates an animation of hourly tidal currents around Antarctica -- Ross Ice Shelf Tide Mapper |github ross| |nbviewer ross| - Creates an animation of hourly tidal elevations around Antarctica -- Ocean Pole Tide Mapper |github opt| |nbviewer opt| - Plots maps of the real and imaginary geocentric pole tide admittance functions - -.. |github check| image:: https://img.shields.io/badge/GitHub-view-6f42c1?style=flat&logo=Github - :target: https://github.com/tsutterley/pyTMD/blob/main/notebooks/Check\ Tide\ Map.ipynb - -.. |nbviewer check| image:: https://raw.githubusercontent.com/jupyter/design/master/logos/Badges/nbviewer_badge.svg - :target: https://nbviewer.jupyter.org/github/tsutterley/pyTMD/blob/main/notebooks/Check\ Tide\ Map.ipynb - -.. |github forecasts| image:: https://img.shields.io/badge/GitHub-view-6f42c1?style=flat&logo=Github - :target: https://github.com/tsutterley/pyTMD/blob/main/notebooks/Plot\ Tide\ Forecasts.ipynb - -.. |nbviewer forecasts| image:: https://raw.githubusercontent.com/jupyter/design/master/logos/Badges/nbviewer_badge.svg - :target: https://nbviewer.jupyter.org/github/tsutterley/pyTMD/blob/main/notebooks/Plot\ Tide\ Forecasts.ipynb - -.. |github solve| image:: https://img.shields.io/badge/GitHub-view-6f42c1?style=flat&logo=Github - :target: https://github.com/tsutterley/pyTMD/blob/main/notebooks/Solve\ Synthetic\ Tides.ipynb - -.. |nbviewer solve| image:: https://raw.githubusercontent.com/jupyter/design/master/logos/Badges/nbviewer_badge.svg - :target: https://nbviewer.jupyter.org/github/tsutterley/pyTMD/blob/main/notebooks/Solve\ Synthetic\ Tides.ipynb - -.. |github cotidal| image:: https://img.shields.io/badge/GitHub-view-6f42c1?style=flat&logo=Github - :target: https://github.com/tsutterley/pyTMD/blob/main/notebooks/Plot\ Antarctic\ Cotidal\ Charts.ipynb - -.. |nbviewer cotidal| image:: https://raw.githubusercontent.com/jupyter/design/master/logos/Badges/nbviewer_badge.svg - :target: https://nbviewer.jupyter.org/github/tsutterley/pyTMD/blob/main/notebooks/Plot\ Antarctic\ Cotidal\ Charts.ipynb - -.. |github currents| image:: https://img.shields.io/badge/GitHub-view-6f42c1?style=flat&logo=Github - :target: https://github.com/tsutterley/pyTMD/blob/main/notebooks/Plot\ Antarctic\ Tidal\ Currents.ipynb - -.. |nbviewer currents| image:: https://raw.githubusercontent.com/jupyter/design/master/logos/Badges/nbviewer_badge.svg - :target: https://nbviewer.jupyter.org/github/tsutterley/pyTMD/blob/main/notebooks/Plot\ Antarctic\ Tidal\ Currents.ipynb - -.. |github range| image:: https://img.shields.io/badge/GitHub-view-6f42c1?style=flat&logo=Github - :target: https://github.com/tsutterley/pyTMD/blob/main/notebooks/Plot\ Antarctic\ Tide\ Range.ipynb - -.. |nbviewer range| image:: https://raw.githubusercontent.com/jupyter/design/master/logos/Badges/nbviewer_badge.svg - :target: https://nbviewer.jupyter.org/github/tsutterley/pyTMD/blob/main/notebooks/Plot\ Antarctic\ Tide\ Range.ipynb - -.. |github arctic| image:: https://img.shields.io/badge/GitHub-view-6f42c1?style=flat&logo=Github - :target: https://github.com/tsutterley/pyTMD/blob/main/notebooks/Plot\ Arctic\ Ocean\ Map.ipynb - -.. |nbviewer arctic| image:: https://raw.githubusercontent.com/jupyter/design/master/logos/Badges/nbviewer_badge.svg - :target: https://nbviewer.jupyter.org/github/tsutterley/pyTMD/blob/main/notebooks/Plot\ Arctic\ Ocean\ Map.ipynb - -.. |github ross| image:: https://img.shields.io/badge/GitHub-view-6f42c1?style=flat&logo=Github - :target: https://github.com/tsutterley/pyTMD/blob/main/notebooks/Plot\ Ross\ Ice\ Shelf\ Map.ipynb - -.. |nbviewer ross| image:: https://raw.githubusercontent.com/jupyter/design/master/logos/Badges/nbviewer_badge.svg - :target: https://nbviewer.jupyter.org/github/tsutterley/pyTMD/blob/main/notebooks/Plot\ Ross\ Ice\ Shelf\ Map.ipynb - -.. |github opt| image:: https://img.shields.io/badge/GitHub-view-6f42c1?style=flat&logo=Github - :target: https://github.com/tsutterley/pyTMD/blob/main/notebooks/Plot\ Ocean\ Pole\ Tide\ Map.ipynb - -.. |nbviewer opt| image:: https://raw.githubusercontent.com/jupyter/design/master/logos/Badges/nbviewer_badge.svg - :target: https://nbviewer.jupyter.org/github/tsutterley/pyTMD/blob/main/notebooks/Plot\ Ocean\ Pole\ Tide\ Map.ipynb +.. toctree:: + :maxdepth: 1 + :caption: Examples + + ../notebooks/Check-Tide-Map + ../notebooks/Plot-Antarctic-Cotidal-Charts + ../notebooks/Plot-Antarctic-Tidal-Currents + ../notebooks/Plot-Antarctic-Tide-Range + ../notebooks/Plot-Arctic-Ocean-Map + ../notebooks/Plot-ATLAS-Compact + ../notebooks/Plot-Ocean-Pole-Tide-Map + ../notebooks/Plot-Ross-Ice-Shelf-Map + ../notebooks/Plot-Tide-Forecasts + ../notebooks/Solve-Synthetic-Tides diff --git a/providers/TPXO.json b/providers/TPXO.json index 1360e9fe..1c906b50 100644 --- a/providers/TPXO.json +++ b/providers/TPXO.json @@ -2,7 +2,7 @@ "current": { "TPXO10-atlas-v2": { "format": "OTIS", - "grid_file": "TPXO10_atlas_v2/grid_tpxo10atlas_v2", + "grid_file": "TPXO10_atlas_v2/grid_tpxo10_atlas_30_v2", "model_file": { "u": [ "TPXO10_atlas_v2/u_2n2_tpxo10_atlas_30_v2", @@ -511,7 +511,7 @@ "elevation": { "TPXO10-atlas-v2": { "format": "OTIS", - "grid_file": "TPXO10_atlas_v2/grid_tpxo10atlas_v2", + "grid_file": "TPXO10_atlas_v2/grid_tpxo10_atlas_30_v2", "model_file": [ "TPXO10_atlas_v2/h_2n2_tpxo10_atlas_30_v2", "TPXO10_atlas_v2/h_k1_tpxo10_atlas_30_v2", diff --git a/pyTMD/data/database.json b/pyTMD/data/database.json index d1953747..fe4d97ea 100644 --- a/pyTMD/data/database.json +++ b/pyTMD/data/database.json @@ -329,7 +329,7 @@ }, "TPXO10-atlas-v2": { "format": "OTIS", - "grid_file": "TPXO10_atlas_v2/grid_tpxo10atlas_v2", + "grid_file": "TPXO10_atlas_v2/grid_tpxo10_atlas_30_v2", "model_file": { "u": [ "TPXO10_atlas_v2/u_2n2_tpxo10_atlas_30_v2", @@ -1756,7 +1756,7 @@ }, "TPXO10-atlas-v2": { "format": "OTIS", - "grid_file": "TPXO10_atlas_v2/grid_tpxo10atlas_v2", + "grid_file": "TPXO10_atlas_v2/grid_tpxo10_atlas_30_v2", "model_file": [ "TPXO10_atlas_v2/h_2n2_tpxo10_atlas_30_v2", "TPXO10_atlas_v2/h_k1_tpxo10_atlas_30_v2", diff --git a/pyTMD/io/ATLAS.py b/pyTMD/io/ATLAS.py index ca8b3303..96d385f3 100644 --- a/pyTMD/io/ATLAS.py +++ b/pyTMD/io/ATLAS.py @@ -1,7 +1,7 @@ #!/usr/bin/env python u""" ATLAS.py -Written by Tyler Sutterley (07/2024) +Written by Tyler Sutterley (10/2024) Reads files for a tidal model and makes initial calculations to run tide program Includes functions to extract tidal harmonic constants from OTIS tide models for @@ -55,6 +55,7 @@ interpolate.py: interpolation routines for spatial data UPDATE HISTORY: + Updated 10/2024: fix error when using default bounds in extract_constants Updated 07/2024: added crop and bounds keywords for trimming model data Updated 02/2024: changed variable for setting global grid flag to is_global Updated 10/2023: add generic wrapper function for reading constituents @@ -194,6 +195,7 @@ def extract_constants( # set default keyword arguments kwargs.setdefault('type', 'z') kwargs.setdefault('crop', False) + kwargs.setdefault('bounds', None) kwargs.setdefault('method', 'spline') kwargs.setdefault('extrapolate', False) kwargs.setdefault('cutoff', 10.0) @@ -227,10 +229,10 @@ def extract_constants( # adjust dimensions of input coordinates to be iterable ilon = np.atleast_1d(np.copy(ilon)) ilat = np.atleast_1d(np.copy(ilat)) - # set default bounds if cropping + # default bounds if cropping xmin, xmax = np.min(ilon), np.max(ilon) ymin, ymax = np.min(ilat), np.max(ilat) - kwargs.setdefault('bounds', [xmin, xmax, ymin, ymax]) + bounds = kwargs['bounds'] or [xmin, xmax, ymin, ymax] # grid step size of tide model dlon = lon[1] - lon[0] # if global: extend limits @@ -238,10 +240,10 @@ def extract_constants( # crop bathymetry data to (buffered) bounds # or adjust longitudinal convention to fit tide model - if kwargs['crop'] and np.any(kwargs['bounds']): + if kwargs['crop'] and np.any(bounds): mlon, mlat = np.copy(lon), np.copy(lat) bathymetry, lon, lat = _crop(bathymetry, mlon, mlat, - bounds=kwargs['bounds'], + bounds=bounds, buffer=4*dlon ) elif (np.min(ilon) < 0.0) & (np.max(lon) > 180.0): @@ -315,9 +317,9 @@ def extract_constants( # append constituent to list constituents.append(cons) # crop tide model data to (buffered) bounds - if kwargs['crop'] and np.any(kwargs['bounds']): + if kwargs['crop'] and np.any(bounds): hc, _, _ = _crop(hc, mlon, mlat, - bounds=kwargs['bounds'], + bounds=bounds, buffer=4*dlon ) # replace original values with extend matrices diff --git a/pyTMD/io/FES.py b/pyTMD/io/FES.py index dcf29e85..91370464 100644 --- a/pyTMD/io/FES.py +++ b/pyTMD/io/FES.py @@ -1,7 +1,7 @@ #!/usr/bin/env python u""" FES.py -Written by Tyler Sutterley (07/2024) +Written by Tyler Sutterley (10/2024) Reads files for a tidal model and makes initial calculations to run tide program Includes functions to extract tidal harmonic constants from the @@ -57,6 +57,7 @@ interpolate.py: interpolation routines for spatial data UPDATE HISTORY: + Updated 10/2024: fix error when using default bounds in extract_constants Updated 07/2024: added new FES2022 to available known model versions FES2022 have masked longitudes, only extract longitude data FES2022 extrapolated data have zeroed out inland water bodies @@ -201,6 +202,7 @@ def extract_constants( kwargs.setdefault('version', None) kwargs.setdefault('compressed', False) kwargs.setdefault('crop', False) + kwargs.setdefault('bounds', None) kwargs.setdefault('method', 'spline') kwargs.setdefault('extrapolate', False) kwargs.setdefault('cutoff', 10.0) @@ -224,10 +226,10 @@ def extract_constants( # adjust dimensions of input coordinates to be iterable ilon = np.atleast_1d(np.copy(ilon)) ilat = np.atleast_1d(np.copy(ilat)) - # set default bounds if cropping + # default bounds if cropping xmin, xmax = np.min(ilon), np.max(ilon) ymin, ymax = np.min(ilat), np.max(ilat) - kwargs.setdefault('bounds', [xmin, xmax, ymin, ymax]) + bounds = kwargs['bounds'] or [xmin, xmax, ymin, ymax] # number of points npts = len(ilon) # number of constituents @@ -255,9 +257,9 @@ def extract_constants( dlon = lon[1] - lon[0] # crop tide model data to (buffered) bounds # or adjust longitudinal convention to fit tide model - if kwargs['crop'] and np.any(kwargs['bounds']): + if kwargs['crop'] and np.any(bounds): hc, lon, lat = _crop(hc, lon, lat, - bounds=kwargs['bounds'], + bounds=bounds, buffer=4*dlon ) elif (np.min(ilon) < 0.0) & (np.max(lon) > 180.0): diff --git a/pyTMD/io/GOT.py b/pyTMD/io/GOT.py index 8fcd9281..72b2a720 100644 --- a/pyTMD/io/GOT.py +++ b/pyTMD/io/GOT.py @@ -1,7 +1,7 @@ #!/usr/bin/env python u""" GOT.py -Written by Tyler Sutterley (07/2024) +Written by Tyler Sutterley (10/2024) Reads files for Richard Ray's Global Ocean Tide (GOT) models and makes initial calculations to run the tide program @@ -42,6 +42,7 @@ interpolate.py: interpolation routines for spatial data UPDATE HISTORY: + Updated 10/2024: fix error when using default bounds in extract_constants Updated 07/2024: added crop and bounds keywords for trimming model data use parse function from constituents class to extract names Updated 04/2023: fix repeated longitudinal convention adjustment @@ -174,6 +175,7 @@ def extract_constants( kwargs.setdefault('grid', 'ascii') kwargs.setdefault('compressed', False) kwargs.setdefault('crop', False) + kwargs.setdefault('bounds', None) kwargs.setdefault('method', 'spline') kwargs.setdefault('extrapolate', False) kwargs.setdefault('cutoff', 10.0) @@ -197,10 +199,10 @@ def extract_constants( # adjust dimensions of input coordinates to be iterable ilon = np.atleast_1d(np.copy(ilon)) ilat = np.atleast_1d(np.copy(ilat)) - # set default bounds if cropping + # default bounds if cropping xmin, xmax = np.min(ilon), np.max(ilon) ymin, ymax = np.min(ilat), np.max(ilat) - kwargs.setdefault('bounds', [xmin, xmax, ymin, ymax]) + bounds = kwargs['bounds'] or [xmin, xmax, ymin, ymax] # number of points npts = len(ilon) # number of constituents @@ -232,9 +234,9 @@ def extract_constants( dlon = np.abs(lon[1] - lon[0]) # crop tide model data to (buffered) bounds # or adjust longitudinal convention to fit tide model - if kwargs['crop'] and np.any(kwargs['bounds']): + if kwargs['crop'] and np.any(bounds): hc, lon, lat = _crop(hc, lon, lat, - bounds=kwargs['bounds'], + bounds=bounds, buffer=4*dlon ) elif (np.min(ilon) < 0.0) & (np.max(lon) > 180.0): diff --git a/pyTMD/io/OTIS.py b/pyTMD/io/OTIS.py index 1792100b..e86c1466 100644 --- a/pyTMD/io/OTIS.py +++ b/pyTMD/io/OTIS.py @@ -59,6 +59,7 @@ UPDATE HISTORY: Updated 10/2024: save latitude and longitude to output constituent object + fix error when using default bounds in extract_constants Updated 09/2024: using new JSON dictionary format for model projections Updated 08/2024: revert change and assume crop bounds are projected Updated 07/2024: added crop and bounds keywords for trimming model data @@ -241,6 +242,7 @@ def extract_constants( kwargs.setdefault('type', 'z') kwargs.setdefault('grid', 'OTIS') kwargs.setdefault('crop', False) + kwargs.setdefault('bounds', None) kwargs.setdefault('method', 'spline') kwargs.setdefault('extrapolate', False) kwargs.setdefault('cutoff', 10.0) @@ -285,18 +287,18 @@ def extract_constants( # grid step size of tide model dx = xi[1] - xi[0] dy = yi[1] - yi[0] - # set default bounds if cropping data + # default bounds if cropping data xmin, xmax = np.min(x), np.max(x) ymin, ymax = np.min(y), np.max(y) - kwargs.setdefault('bounds', [xmin, xmax, ymin, ymax]) + bounds = kwargs['bounds'] or [xmin, xmax, ymin, ymax] # crop mask and bathymetry data to (buffered) bounds # or adjust longitudinal convention to fit tide model - if kwargs['crop'] and np.any(kwargs['bounds']): + if kwargs['crop'] and np.any(bounds): mx, my = np.copy(xi), np.copy(yi) - mz, xi, yi = _crop(mz, mx, my, bounds=kwargs['bounds'], + mz, xi, yi = _crop(mz, mx, my, bounds=bounds, buffer=4*dx, is_geographic=is_geographic) - hz, xi, yi = _crop(hz, mx, my, bounds=kwargs['bounds'], + hz, xi, yi = _crop(hz, mx, my, bounds=bounds, buffer=4*dx, is_geographic=is_geographic) elif (np.min(x) < np.min(xi)) & is_geographic: # input points convention (-180:180) @@ -441,9 +443,9 @@ def extract_constants( u,hc = read_otis_transport(model_file, i) # crop tide model data to (buffered) bounds - if kwargs['crop'] and np.any(kwargs['bounds']): + if kwargs['crop'] and np.any(bounds): hc, _, _ = _crop(hc, mx, my, - bounds=kwargs['bounds'], buffer=4*dx, + bounds=bounds, buffer=4*dx, is_geographic=is_geographic) # replace original values with extend matrices if is_global: diff --git a/pyproject.toml b/pyproject.toml index c0916fe3..9de2a359 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,7 +59,7 @@ Repository = "https://github.com/tsutterley/pyTMD" Issues = "https://github.com/tsutterley/pyTMD/issues" [project.optional-dependencies] -doc = ["docutils", "fontconfig", "freetype", "graphviz", "numpydoc", "sphinx", "sphinx-argparse>=0.4", "sphinx_rtd_theme"] +doc = ["docutils", "fontconfig", "freetype", "graphviz", "myst-nb", "numpydoc", "sphinx", "sphinx-argparse>=0.4", "sphinx_rtd_theme"] all = ["cartopy", "gdal", "h5py", "ipyleaflet", "ipywidgets", "jplephem", "matplotlib", "mpi4py", "notebook", "pandas", "pyyaml"] dev = ["flake8", "pytest>=4.6", "pytest-cov", "oct2py", "boto3"]