Skip to content

Commit

Permalink
feat: adding GOT5.5 and GOT download program
Browse files Browse the repository at this point in the history
* refactor: renamed format for `ATLAS` to `ATLAS-compact`
* refactor: renamed format for `netcdf` to `ATLAS-netcdf`
* refactor: renamed format for `FES` to `FES-netcdf` and added `FES-ascii`
* refactor: renamed format for `GOT` to `GOT-ascii` and added `GOT-netcdf`
* feat: add JSON definition files for GOT5.5D and GOT5.6
  • Loading branch information
tsutterley committed Jul 24, 2024
1 parent 3d1d88a commit 854eec0
Show file tree
Hide file tree
Showing 47 changed files with 607 additions and 322 deletions.
2 changes: 1 addition & 1 deletion doc/source/api_reference/check_points.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ check_points
============

- Check if points are within a tide model domain
- Can check OTIS format tidal solutions provided by Ohio State University and ESR
- Can check OTIS format tidal solutions provided by Oregon State University and ESR
- Can check Global Tide Model (GOT) solutions provided by Richard Ray at GSFC
- Can check Finite Element Solution (FES) models provided by AVISO

Expand Down
4 changes: 2 additions & 2 deletions doc/source/api_reference/compute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ compute

- Calculates tidal elevations at points and times

* Can use OTIS format tidal solutions provided by Ohio State University and ESR
* Can use OTIS format tidal solutions provided by Oregon State University and ESR
* Can use Global Tide Model (GOT) solutions provided by Richard Ray at GSFC
* Can use Finite Element Solution (FES) models provided by AVISO
- Calculates tidal currents at points and times

* Can use OTIS format tidal solutions provided by Ohio State University and ESR
* Can use OTIS format tidal solutions provided by Oregon State University and ESR
* Can use Finite Element Solution (FES) models provided by AVISO
- Calculates long-period equilibrium tides (LPET) at points and times

Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/compute_tidal_currents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ compute_tidal_currents.py
=========================

- Calculates tidal currents for an input file following [Egbert2002]_
- Can use OTIS format tidal solutions provided by Ohio State University and ESR
- Can use OTIS format tidal solutions provided by Oregon State University and ESR
- Can use Finite Element Solution (FES) models provided by AVISO
- Can read and write ascii, netCDF4, HDF5, parquet and geotiff formats

Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/compute_tidal_elevations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ compute_tidal_elevations.py
===========================

- Calculates tidal elevations for an input file following [Egbert2002]_
- Can use OTIS format tidal solutions provided by Ohio State University and ESR
- Can use OTIS format tidal solutions provided by Oregon State University and ESR
- Can use Global Tide Model (GOT) solutions provided by Richard Ray at GSFC
- Can use Finite Element Solution (FES) models provided by AVISO
- Can read and write ascii, netCDF4, HDF5, parquet and geotiff formats
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/io/ATLAS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ATLAS
=====

- Reads netCDF format tidal solutions provided by Ohio State University and ESR
- Reads netCDF format tidal solutions provided by Oregon State University and ESR
- Spatially interpolates tidal constituents to input coordinates

Calling Sequence
Expand Down
3 changes: 3 additions & 0 deletions doc/source/api_reference/io/GOT.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ GOT
===

- Reads files for Richard Ray's Global Ocean Tide (GOT) models

* ascii format
* netcdf format
- Spatially interpolates tidal constituents to input coordinates

Calling Sequence
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/io/OTIS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
OTIS
====

- Reads OTIS format tidal solutions provided by Ohio State University and ESR
- Reads OTIS format tidal solutions provided by Oregon State University and ESR

* multi-constituent binary
* ATLAS-compact binary
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/reduce_OTIS_files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
reduce_OTIS_files.py
====================

- Reduces OTIS-format tidal files provided by Ohio State University and ESR to a regional subset
- Reduces OTIS-format tidal files provided by Oregon State University and ESR to a regional subset

`Source code`__

Expand Down
16 changes: 8 additions & 8 deletions doc/source/getting_started/Getting-Started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,38 +146,38 @@ Each definition file regardless of the format should have ``name``, ``format`` a
Each model type also requires specific sets of parameters for the model reader.
For models with multiple constituent files, the files can be found using a ``glob`` string to search a directory.

- ``OTIS``, ``ATLAS`` and ``TMD3``
- ``OTIS``, ``ATLAS-compact`` and ``TMD3``

* ``format``: ``OTIS``, ``ATLAS`` or ``TMD3``
* ``format``: ``OTIS``, ``ATLAS-compact`` or ``TMD3``
* ``grid_file``: path to model grid file
* ``model_file``: path to model constituent file(s) or a ``glob`` string
* ``name``: tide model name
* ``projection``: `model spatial projection <./Getting-Started.html#spatial-coordinates>`_.
* ``type``: ``z`` or ``u,v``

- ``netcdf``
- ``ATLAS-netcdf``

* ``compressed``: model files are gzip compressed
* ``format``: ``netcdf``
* ``format``: ``ATLAS-netcdf``
* ``grid_file``: path to model grid file
* ``model_file``: path to model constituent files or a ``glob`` string
* ``name``: tide model name
* ``scale``: scaling factor for converting to output units
* ``type``: ``z`` or ``u,v``

- ``GOT``
- ``GOT-ascii`` and ``GOT-netcdf``

* ``compressed``: model files are gzip compressed
* ``format``: ``GOT``
* ``format``: ``GOT-ascii`` or ``GOT-netcdf``
* ``model_file``: path to model constituent files or a ``glob`` string
* ``name``: tide model name
* ``scale``: scaling factor for converting to output units
* ``type``: ``z``

- ``FES``
- ``FES-ascii`` and ``FES-netcdf``

* ``compressed``: model files are gzip compressed
* ``format``: ``FES``
* ``format``: ``FES-ascii`` or ``FES-netcdf``
* ``model_file``: path to model constituent files or a ``glob`` string
* ``name``: tide model name
* ``scale``: scaling factor for converting to output units
Expand Down
24 changes: 15 additions & 9 deletions notebooks/Check Tide Map.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"Check if a given point is within a tide model domain\n",
"\n",
"OTIS format tidal solutions provided by Ohio State University and ESR \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",
Expand Down Expand Up @@ -116,22 +116,28 @@
" ).elevation(TMDwidgets.model.value)\n",
" \n",
"# read tidal constants and interpolate to grid points\n",
"if model.format in ('OTIS','ATLAS','TMD3'):\n",
"if model.format in ('OTIS','ATLAS-compact','TMD3'):\n",
" # if reading a single OTIS solution\n",
" xi,yi,hz,mz,iob,dt = pyTMD.io.OTIS.read_otis_grid(model.grid_file)\n",
"elif (model.format == 'netcdf'):\n",
"elif model.format in ('ATLAS-netcdf',):\n",
" # if reading a netCDF OTIS atlas solution\n",
" xi,yi,hz = pyTMD.io.ATLAS.read_netcdf_grid(model.grid_file,\n",
" compressed=model.compressed, type='z')\n",
" # invert bathymetry mask\n",
" mz = np.invert(hz.mask)\n",
"elif (model.format == 'GOT'):\n",
"elif (model.format == 'GOT-ascii'):\n",
" # if reading a NASA GOT solution\n",
" hc,xi,yi,c = pyTMD.io.GOT.read_ascii_file(model.model_file[0],\n",
" compressed=model.compressed)\n",
" # invert tidal constituent mask\n",
" mz = np.invert(hc.mask)\n",
"elif (model.format == 'FES'):\n",
"elif (model.format == 'GOT-netcdf'):\n",
" # if reading a NASA GOT netcdf solution\n",
" hc,xi,yi,c = pyTMD.io.GOT.read_netcdf_file(model.model_file[0],\n",
" compressed=model.compressed)\n",
" # invert tidal constituent mask\n",
" mz = np.invert(hc.mask)\n",
"elif (model.format == 'FES-netcdf'):\n",
" # if reading a FES netCDF solution\n",
" hc,xi,yi = pyTMD.io.FES.read_netcdf_file(model.model_file[0],\n",
" compressed=model.compressed, type='z', version=model.version)\n",
Expand All @@ -154,7 +160,7 @@
" LON = np.atleast_1d(LON)\n",
" LAT = np.atleast_1d(LAT)\n",
" # read tidal constants and interpolate to grid points\n",
" if model.format in ('OTIS','ATLAS','TMD3'):\n",
" if model.format in ('OTIS','ATLAS-compact','TMD3'):\n",
" # if reading a single OTIS solution\n",
" xi,yi,hz,mz,iob,dt = pyTMD.io.OTIS.read_otis_grid(model.grid_file)\n",
" # convert coordinate systems of input latitude and longitude\n",
Expand All @@ -168,21 +174,21 @@
" if (np.max(x) > np.max(xi)) & (model.projection == '4326'):\n",
" gt180, = np.nonzero(x > 180)\n",
" x[gt180] -= 360.0\n",
" elif (model.format == 'netcdf'):\n",
" elif (model.format == 'ATLAS-netcdf'):\n",
" # if reading a netCDF OTIS atlas solution\n",
" # adjust longitudinal convention of input latitude and longitude\n",
" # to fit tide model convention\n",
" x,y = np.copy([LON,LAT]).astype(np.float64)\n",
" lt0, = np.nonzero(x < 0)\n",
" x[lt0] += 360.0\n",
" elif (model.format == 'GOT'):\n",
" elif model.format in ('GOT-ascii', 'GOT-netcdf'):\n",
" # if reading a NASA GOT solution\n",
" # adjust longitudinal convention of input latitude and longitude\n",
" # to fit tide model convention\n",
" x,y = np.copy([LON,LAT]).astype(np.float64)\n",
" lt0, = np.nonzero(x < 0)\n",
" x[lt0] += 360.0\n",
" elif (model.format == 'FES'):\n",
" elif (model.format == 'FES-netcdf'):\n",
" # if reading a FES netCDF solution\n",
" # adjust longitudinal convention of input latitude and longitude\n",
" # to fit tide model convention\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/Plot ATLAS Compact.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"Check if a given point is within a tide model domain\n",
"\n",
"OTIS format tidal solutions provided by Ohio State University and ESR \n",
"OTIS format tidal solutions provided by Oregon State University and ESR \n",
"- http://volkov.oce.orst.edu/tides/region.html \n",
"\n",
"#### Python Dependencies\n",
Expand Down
16 changes: 8 additions & 8 deletions notebooks/Plot Antarctic Tidal Currents.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"Demonstrates plotting hourly tidal currents around Antarctica\n",
"\n",
"OTIS format tidal solutions provided by Ohio State University and ESR \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",
Expand Down Expand Up @@ -185,23 +185,23 @@
"# iterate over u and v currents\n",
"for TYPE in model.type:\n",
" # read tidal constants and interpolate to grid points\n",
" if model.format in ('OTIS','ATLAS','TMD3'):\n",
" if model.format in ('OTIS','ATLAS-compact','TMD3'):\n",
" amp,ph,D,c = pyTMD.io.OTIS.extract_constants(lon, lat, model.grid_file,\n",
" model.model_file['u'], model.projection, type=TYPE, crop=True,\n",
" method='spline', grid=model.format)\n",
" method='spline', grid=corrections)\n",
" DELTAT = np.zeros_like(ts.tide)\n",
" elif (model.format == 'netcdf'):\n",
" elif (model.format == 'ATLAS-netcdf'):\n",
" amp,ph,D,c = pyTMD.io.ATLAS.extract_constants(lon, lat, model.grid_file,\n",
" model.model_file[TYPE], type=TYPE, crop=True, method='spline',\n",
" scale=model.scale, compressed=model.compressed)\n",
" DELTAT = np.zeros_like(ts.tide)\n",
" elif (model.format == 'GOT'):\n",
" elif model.format in ('GOT-ascii', 'GOT-netcdf'):\n",
" amp,ph,c = pyTMD.io.GOT.extract_constants(lon, lat, model.model_file[TYPE],\n",
" crop=True, method='spline', scale=model.scale,\n",
" compressed=model.compressed)\n",
" # delta time (TT - UT1)\n",
" DELTAT = ts.tt_ut1\n",
" elif (model.format == 'FES'):\n",
" elif (model.format == 'FES-netcdf'):\n",
" amp,ph = pyTMD.io.FES.extract_constants(lon, lat, model.model_file[TYPE],\n",
" type=TYPE, version=model.version, crop=True, method='spline',\n",
" scale=model.scale, compressed=model.compressed)\n",
Expand All @@ -219,9 +219,9 @@
" for hour in range(24):\n",
" # predict tidal elevations at time and infer minor corrections\n",
" TIDE = pyTMD.predict.map(ts.tide[hour], hc, c, deltat=DELTAT[hour],\n",
" corrections=model.format)\n",
" corrections=corrections)\n",
" MINOR = pyTMD.predict.infer_minor(ts.tide[hour], hc, c,\n",
" deltat=DELTAT[hour], corrections=model.format)\n",
" deltat=DELTAT[hour], corrections=corrections)\n",
" # add major and minor components and reform grid\n",
" tide[TYPE][:,:,hour] = np.reshape((TIDE+MINOR),(ny,nx))"
]
Expand Down
14 changes: 7 additions & 7 deletions notebooks/Plot Antarctic Tide Range.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"Demonstrates plotting the tidal amplitudes around Antarctica\n",
"\n",
"OTIS format tidal solutions provided by Ohio State University and ESR \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",
Expand Down Expand Up @@ -219,19 +219,19 @@
"outputs": [],
"source": [
"# read tidal constants and interpolate to grid points\n",
"if model.format in ('OTIS','ATLAS','TMD3'):\n",
"if model.format in ('OTIS','ATLAS-compact','TMD3'):\n",
" amp,ph,D,c = pyTMD.io.OTIS.extract_constants(lon, lat, model.grid_file,\n",
" model.model_file, model.projection, type=model.type, crop=True,\n",
" method='spline', grid=model.format)\n",
"elif (model.format == 'netcdf'):\n",
" method='spline', grid=corrections)\n",
"elif (model.format == 'ATLAS-netcdf'):\n",
" amp,ph,D,c = pyTMD.io.ATLAS.extract_constants(lon, lat, model.grid_file,\n",
" model.model_file, type=model.type, crop=True, method='spline',\n",
" scale=model.scale, compressed=model.compressed)\n",
"elif (model.format == 'GOT'):\n",
"elif model.format in ('GOT-ascii', 'GOT-netcdf'):\n",
" amp,ph,c = pyTMD.io.GOT.extract_constants(lon, lat, model.model_file,\n",
" crop=True, method='spline', scale=model.scale,\n",
" compressed=model.compressed)\n",
"elif (model.format == 'FES'):\n",
"elif (model.format == 'FES-netcdf'):\n",
" amp,ph = pyTMD.io.FES.extract_constants(lon, lat, model.model_file,\n",
" type=model.type, version=model.version, crop=True,\n",
" method='spline', scale=model.scale, compressed=model.compressed)\n",
Expand Down Expand Up @@ -319,7 +319,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.10.14"
},
"vscode": {
"interpreter": {
Expand Down
16 changes: 8 additions & 8 deletions notebooks/Plot Arctic Ocean Map.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"Demonstrates plotting hourly tidal displacements for the Arctic Ocean\n",
"\n",
"OTIS format tidal solutions provided by Ohio State University and ESR \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",
Expand Down Expand Up @@ -183,23 +183,23 @@
" YMD.day, hour=np.arange(24))\n",
"\n",
"# read tidal constants and interpolate to grid points\n",
"if model.format in ('OTIS','ATLAS','TMD3'):\n",
"if model.format in ('OTIS','ATLAS-compact','TMD3'):\n",
" amp,ph,D,c = pyTMD.io.OTIS.extract_constants(lon, lat, model.grid_file,\n",
" model.model_file, model.projection, type=model.type, crop=True,\n",
" method='spline', grid=model.format)\n",
" method='spline', grid=corrections)\n",
" DELTAT = np.zeros_like(ts.tide)\n",
"elif (model.format == 'netcdf'):\n",
"elif (model.format == 'ATLAS-netcdf'):\n",
" amp,ph,D,c = pyTMD.io.ATLAS.extract_constants(lon, lat, model.grid_file,\n",
" model.model_file, type=model.type, crop=True, method='spline',\n",
" scale=model.scale, compressed=model.compressed)\n",
" DELTAT = np.zeros_like(ts.tide)\n",
"elif (model.format == 'GOT'):\n",
"elif model.format in ('GOT-ascii', 'GOT-netcdf'):\n",
" amp,ph,c = pyTMD.io.GOT.extract_constants(lon, lat, model.model_file,\n",
" crop=True, method='spline', scale=model.scale,\n",
" compressed=model.compressed)\n",
" # delta time (TT - UT1)\n",
" DELTAT = ts.tt_ut1\n",
"elif (model.format == 'FES'):\n",
"elif (model.format == 'FES-netcdf'):\n",
" amp,ph = pyTMD.io.FES.extract_constants(lon, lat, model.model_file,\n",
" type=model.type, version=model.version, crop=True,\n",
" method='spline', scale=model.scale, compressed=model.compressed)\n",
Expand All @@ -217,9 +217,9 @@
"for hour in range(24):\n",
" # predict tidal elevations at time and infer minor corrections\n",
" TIDE = pyTMD.predict.map(ts.tide[hour], hc, c, deltat=DELTAT[hour],\n",
" corrections=model.format)\n",
" corrections=corrections)\n",
" MINOR = pyTMD.predict.infer_minor(ts.tide[hour], hc, c,\n",
" deltat=DELTAT[hour], corrections=model.format)\n",
" deltat=DELTAT[hour], corrections=corrections)\n",
" # add major and minor components and reform grid\n",
" # convert from meters to centimeters\n",
" tide_cm[:,:,hour] = 100.0*np.reshape((TIDE+MINOR),(ny,nx))"
Expand Down
Loading

0 comments on commit 854eec0

Please sign in to comment.