Skip to content

Commit

Permalink
feat: added ESR netCDF4 formats to list of model types (#101)
Browse files Browse the repository at this point in the history
* feat: added ESR netCDF4 formats to list of model types

* refactor: changed keyword arguments to camel case

* docs: add paragraph about delta times

* feat: added options to apply flexure to computational programs

* feat: added Greenland 1km model (Gr1kmTM) to list of models

* refactor: use pypi versions of ICESat-2 and ATM1b tools

* feat: added field_mapping options to netCDF4 and HDF5 reads
  • Loading branch information
tsutterley authored Jul 1, 2022
1 parent 01b5498 commit 8ee4ea5
Show file tree
Hide file tree
Showing 81 changed files with 1,548 additions and 867 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ WORKDIR /tmp
ENV JOBS 2

ENV CFLAGS="-fPIC"
ENV ZLIB_VERSION=1.2.11
ENV ZLIB_VERSION=1.2.12
RUN wget -q http://zlib.net/zlib-${ZLIB_VERSION}.tar.gz && \
tar -xzf zlib-${ZLIB_VERSION}.tar.gz && \
cd zlib-${ZLIB_VERSION} && \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
environment-file: environment.yml
- name: Create conda Test Environment
run: |
conda install flake8 pytest pytest-cov cython octave oct2py boto3
conda install openblas-devel flake8 pytest pytest-cov cython octave oct2py
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Python-based tidal prediction software that reads OTIS, GOT and FES formatted ti
- `ESR Tide Model Driver (TMD) Matlab Toolbox <https://www.esr.org/research/polar-tide-models/tmd-software/>`_
- `OSU Global and Regional Tide Models <https://www.tpxo.net>`_
- `ESR Polar Tide Models <https://www.esr.org/research/polar-tide-models/list-of-polar-tide-models/>`_
- `A Global Ocean Tide Model From TOPEX/POSEIDON Altimetry: GOT99.2 <https://ntrs.nasa.gov/search.jsp?R=19990089548>`_
- `A Global Ocean Tide Model From TOPEX/POSEIDON Altimetry: GOT99.2 <https://ntrs.nasa.gov/citations/19990089548>`_
- `Finite Element Solution (FES) tide models <https://www.aviso.altimetry.fr/en/data/products/auxiliary-products/global-tide-fes.html>`_
- `Delta times from US Naval Observatory (USNO) Earth Orientation Products <http://maia.usno.navy.mil/ser7/deltat.data>`_
- `Delta times from NASA Crustal Dynamics Data Information System (CDDIS) <ftp://cddis.nasa.gov/products/iers/deltat.data>`_
Expand Down
4 changes: 2 additions & 2 deletions doc/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ dependencies:
- sphinx_rtd_theme
- texlive-core
- pip:
- git+https://github.com/tsutterley/read-ICESat-2.git
- git+https://github.com/tsutterley/read-ATM1b-QFIT-binary.git
- icesat2-toolkit
- ATM1b-QFIT
- ..
42 changes: 29 additions & 13 deletions doc/source/getting_started/Getting-Started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Presently, the following models and their directories parameterized within ``pyT
* CATS0201: ``<path_to_tide_models>/cats0201_tmd/``
* `CATS2008 <https://www.usap-dc.org/view/dataset/601235>`_: ``<path_to_tide_models>/CATS2008/``
* CATS2008_load: ``<path_to_tide_models>/CATS2008a_SPOTL_Load/``
* CATS2022: ``<path_to_tide_models>/CATS2022/``

- Arctic Ocean and Greenland Coast Tidal Simulations [Padman2004]_

Expand Down Expand Up @@ -145,9 +146,9 @@ For parameters consisting of lists, the parameter values can be separated by spa
Each definition file should have a ``name``, ``format`` and ``type`` parameters.
Each model format also requires specific sets of parameters.

- ``OTIS`` and ``ATLAS``
- ``OTIS``, ``ATLAS`` and ``ESR``

* ``format``: ``'OTIS'`` or ``'ATLAS'``
* ``format``: ``'OTIS'``, ``'ATLAS'`` or ``ESR``
* ``grid_file``: full path to model grid file
* ``model_file``: full path to model constituent file(s)
* ``name``: tide model name
Expand Down Expand Up @@ -192,7 +193,19 @@ For pole tide programs, the epoch is 1858-11-17T00:00:00 (Modified Julian Days).
The `time module <https://github.com/tsutterley/pyTMD/blob/main/pyTMD/time.py>`_ within ``pyTMD`` can convert different time formats to the necessary time format of a given program.
The `time module <https://github.com/tsutterley/pyTMD/blob/main/pyTMD/time.py>`_ can also parse date strings describing the units and epoch of relative times, or the calendar date of measurement for geotiff formats.
``pyTMD`` keeps updated `tables of leap seconds <https://github.com/tsutterley/pyTMD/blob/main/pyTMD/data/leap-seconds.list>`_ for converting from GPS, LORAN and TAI times.
``pyTMD`` keeps updated `tables of delta times <https://github.com/tsutterley/pyTMD/blob/main/pyTMD/data/merged_deltat.data>`_ for converting between dynamic (TT) and universal (UT1) times.

- TAI time: International Atomic Time which is computed as the weighted average of several hundred atomic clocks.
- UTC time: Coordinated Universal Time which is `periodically adjusted <https://www.nist.gov/pml/time-and-frequency-division/leap-seconds-faqs>`_ to account for the difference between the definition of the second and the rotation of Earth.
- GPS time: Atomic timing system for the Global Positioning System constellation of satellites monitored by the United States Naval Observatory (USNO). GPS time and UTC time were equal on January 6, 1980. TAI time is ahead of GPS time by 19 seconds.
- LORAN time: Atomic timing system for the Loran-C chain transmitter sites used in terrestrial radionavigation. LORAN time and UTC time were equal on January 1, 1958. TAI time is ahead of LORAN time by 10 seconds.

``pyTMD`` also keeps updated `tables of delta times <https://github.com/tsutterley/pyTMD/blob/main/pyTMD/data/merged_deltat.data>`_ for converting between dynamic (TT) and universal (UT1) times.
Delta times (TT - UT1) are the differences between Dynamic Time (TT) and Universal Time (UT1) [Meeus1998]_.
Universal Time (UT1) is based on the rotation of the Earth,
which varies irregularly, and so UT1 is adjusted periodically.
Dynamic Time (TT) is a uniform, monotonically increasing time standard based on atomic clocks that is
used for the accurate calculation of celestial mechanics, orbits and ephemerides.
Delta times can be added to Universal Time (UT1) values to convert to Dynamic Time (TT) values.

Spatial Coordinates
###################
Expand All @@ -201,15 +214,16 @@ The default coordinate system in ``pyTMD`` is WGS84 geodetic coordinates in lati
``pyTMD`` uses `pyproj <https://pypi.org/project/pyproj/>`_ to convert from different coordinate systems and datums.
Some regional tide models are projected in a different coordinate system.
For these cases, ``pyTMD`` will `convert from latitude and longitude to the model coordinate system <https://github.com/tsutterley/pyTMD/blob/main/pyTMD/convert_ll_xy.py>`_.
OTIS models may be projected into a separate coordinate system.
The available OTIS projections within ``pyTMD`` are
``'4326'`` (global latitude and longitude),
``'3031'`` (Antarctic Polar Stereographic in kilometers),
``'3413'`` (NSIDC Sea Ice Polar Stereographic North in kilometers),
``'CATS2008'`` (CATS2008 Polar Stereographic in kilometers),
``'3976'`` (NSIDC Sea Ice Polar Stereographic South in kilometers), and
``'PSNorth'`` (idealized polar stereographic in kilometers).
For other OTIS model projections, a formatted projection string (e.g. PROJ, WKT, or EPSG) can be used.

OTIS models may be projected into a separate coordinate system. The available OTIS projections within ``pyTMD`` are
- ``'4326'`` (global latitude and longitude)
- ``'3031'`` (Antarctic Polar Stereographic in kilometers)
- ``'3413'`` (NSIDC Sea Ice Polar Stereographic North in kilometers)
- ``'CATS2008'`` (CATS2008 Polar Stereographic in kilometers)
- ``'3976'`` (NSIDC Sea Ice Polar Stereographic South in kilometers)
- ``'PSNorth'`` (idealized polar stereographic in kilometers)

For other model projections, a formatted coordinate reference system (CRS) descriptor (e.g. PROJ, WKT, or EPSG code) can be used.

Interpolation
#############
Expand All @@ -235,13 +249,15 @@ References
.. [Lyard2020] F. H. Lyard, D. J. Allain, M. Cancet, L. Carr\ |egrave|\ re, and N. Picot, "FES2014 global ocean tides atlas: design and performances", *Ocean Science Discussions*, in review, (2020). `doi: 10.5194/os-2020-96 <https://doi.org/10.5194/os-2020-96>`_
.. [Meeus1998] J. Meeus, *Astronomical Algorithms*, 2nd edition, 477 pp., (1998).
.. [Padman2004] L. Padman and S. Y. Erofeeva, "A barotropic inverse tidal model for the Arctic Ocean", *Geophysical Research Letters*, 31(2), L02303. (2004). `doi: 10.1029/2003GL019003 <https://doi.org/10.1029/2003GL019003>`_
.. [Padman2008] L. Padman, S. Y. Erofeeva, and H. A. Fricker, "Improving Antarctic tide models by assimilation of ICESat laser altimetry over ice shelves", *Geophysical Research Letters*, 35, L22504, (2008). `doi: 10.1029/2008GL035592 <https://doi.org/10.1029/2008GL035592>`_
.. [Padman2018] L. Padman, M. R. Siegfried, and H. A. Fricker, "Ocean Tide Influences on the Antarctic and Greenland Ice Sheets", *Reviews of Geophysics*, 56, (2018). `doi: 10.1002/2016RG000546 <https://doi.org/10.1002/2016RG000546>`_
.. [Ray1999] R. D. Ray, "A Global Ocean Tide Model From TOPEX/POSEIDON Altimetry: GOT99.2", *NASA Technical Memorandum*, `NASA/TM--1999-209478 <https://ntrs.nasa.gov/search.jsp?R=19990089548>`_.
.. [Ray1999] R. D. Ray, "A Global Ocean Tide Model From TOPEX/POSEIDON Altimetry: GOT99.2", *NASA Technical Memorandum*, `NASA/TM--1999-209478 <https://ntrs.nasa.gov/citations/19990089548>`_.
.. [Stammer2014] D. Stammer et al., "Accuracy assessment of global barotropic ocean tide models", *Reviews of Geophysics*, 52, 243--282, (2014). `doi: 10.1002/2014RG000450 <https://doi.org/10.1002/2014RG000450>`_
Expand Down
2 changes: 1 addition & 1 deletion doc/source/getting_started/Resources.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Ocean and Load Tide Resources
- `OSU Global and Regional Tide Models <https://www.tpxo.net>`_
- `ESR Polar Tide Models <https://www.esr.org/research/polar-tide-models/list-of-polar-tide-models/>`_
- `Ocean Tides around Antarctica and in the Southern Ocean <https://www.usap-dc.org/view/project/p0010116>`_
- `A Global Ocean Tide Model From TOPEX/POSEIDON Altimetry: GOT99.2 <https://ntrs.nasa.gov/search.jsp?R=19990089548>`_
- `A Global Ocean Tide Model From TOPEX/POSEIDON Altimetry: GOT99.2 <https://ntrs.nasa.gov/citations/19990089548>`_
- `Finite Element Solution (FES) tide models <https://www.aviso.altimetry.fr/en/data/products/auxiliary-products/global-tide-fes.html>`_
- `Antarctic Tide Gauge Database <https://www.esr.org/data-products/antarctic_tg_database/>`_
- `Delta times from US Naval Observatory (USNO) Earth Orientation Products <http://maia.usno.navy.mil/ser7/deltat.data>`_
Expand Down
2 changes: 2 additions & 0 deletions doc/source/user_guide/arcticdata_tides.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ arcticdata_tides.py
* `AODTM-5 <https://arcticdata.io/catalog/view/doi:10.18739/A2901ZG3N>`_
* `AOTIM-5 <https://arcticdata.io/catalog/view/doi:10.18739/A2S17SS80>`_
* `AOTIM-5-2018 <https://arcticdata.io/catalog/view/doi:10.18739/A21R6N14K>`_
* `Arc2kmTM <https://arcticdata.io/catalog/view/doi:10.18739/A2D21RK6K>`_
* `Gr1kmTM <https://arcticdata.io/catalog/view/doi:10.18739/A2B853K18>`_

`Source code`__

Expand Down
3 changes: 3 additions & 0 deletions doc/source/user_guide/compute_tidal_elevations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ compute_tidal_elevations.py

--cutoff -c : @after
* set to ``'inf'`` to extrapolate for all points

--apply-flexure : @after
Only valid for models containing flexure fields
3 changes: 3 additions & 0 deletions doc/source/user_guide/compute_tides_ICESat2_ATL03.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ compute_tides_ICESat2_ATL03.py

--cutoff -c : @after
* set to ``'inf'`` to extrapolate for all points

--apply-flexure : @after
Only valid for models containing flexure fields
3 changes: 3 additions & 0 deletions doc/source/user_guide/compute_tides_ICESat2_ATL06.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ compute_tides_ICESat2_ATL06.py

--cutoff -c : @after
* set to ``'inf'`` to extrapolate for all points

--apply-flexure : @after
Only valid for models containing flexure fields
3 changes: 3 additions & 0 deletions doc/source/user_guide/compute_tides_ICESat2_ATL11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ compute_tides_ICESat2_ATL11.py

--cutoff -c : @after
* set to ``'inf'`` to extrapolate for all points

--apply-flexure : @after
Only valid for models containing flexure fields
3 changes: 3 additions & 0 deletions doc/source/user_guide/compute_tides_ICESat_GLA12.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ compute_tides_ICESat_GLA12.py

--cutoff -c : @after
* set to ``'inf'`` to extrapolate for all points

--apply-flexure : @after
Only valid for models containing flexure fields
3 changes: 3 additions & 0 deletions doc/source/user_guide/compute_tides_icebridge_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ compute_tides_icebridge_data.py

--cutoff -c : @after
* set to ``'inf'`` to extrapolate for all points

--apply-flexure : @after
Only valid for models containing flexure fields
2 changes: 1 addition & 1 deletion doc/source/user_guide/iers_mean_pole.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Calling Sequence
.. code-block:: python
from pyTMD.iers_mean_pole import iers_mean_pole
x,y,flag = iers_mean_pole(input_file,input_epoch,version,FILL_VALUE=FILL_VALUE)
x,y,flag = iers_mean_pole(input_file,input_epoch,version,fill_value=FILL_VALUE)
`Source code`__

Expand Down
2 changes: 1 addition & 1 deletion doc/source/user_guide/infer_minor_corrections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Calling Sequence
from pyTMD.infer_minor_corrections import infer_minor_corrections
dh = infer_minor_corrections(t, zmajor, constituents,
DELTAT=DELTAT, CORRECTIONS=CORRECTIONS)
deltat=DELTAT, corrections=CORRECTIONS)
`Source code`__

Expand Down
3 changes: 2 additions & 1 deletion doc/source/user_guide/load_nodal_corrections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ Calling Sequence
.. code-block:: python
from pyTMD.load_nodal_corrections import load_nodal_corrections
pu,pf,G = load_nodal_corrections(MJD,constituents)
pu,pf,G = load_nodal_corrections(MJD, constituents,
deltat=DELTAT, corrections=CORRECTIONS)
`Source code`__

Expand Down
8 changes: 6 additions & 2 deletions doc/source/user_guide/read_FES_model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ Calling Sequence
.. code-block:: python
from pyTMD.read_FES_model import extract_FES_constants
amp,ph = extract_FES_constants(ilon, ilat, model_files, TYPE='z',
VERSION=version,METHOD='spline',GZIP=True,SCALE=1.0/100.0)
amp,ph = extract_FES_constants(ilon, ilat, model_files,
type='z',
version=version,
method='spline',
compressed=True,
scale=1.0/100.0)
`Source code`__

Expand Down
3 changes: 2 additions & 1 deletion doc/source/user_guide/read_GOT_model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Calling Sequence
.. code-block:: python
from pyTMD.read_GOT_model import extract_GOT_constants
amp,ph,c = extract_GOT_constants(ilon,ilat,model_files,METHOD='spline')
amp,ph,c = extract_GOT_constants(ilon,i lat, model_files,
method='spline')
`Source code`__

Expand Down
3 changes: 2 additions & 1 deletion doc/source/user_guide/read_netcdf_model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Calling Sequence
.. code-block:: python
from pyTMD.read_netcdf_model import read_netcdf_model
amp,ph,D,c = read_netcdf_model(ilon,ilat,grid_file,model_files,TYPE='z',METHOD='spline')
amp,ph,D,c = read_netcdf_model(ilon, ilat, grid_file, model_files,
type='z', method='spline')
`Source code`__

Expand Down
6 changes: 5 additions & 1 deletion doc/source/user_guide/read_tide_model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Calling Sequence
from pyTMD.read_tide_model import extract_tidal_constants
amp,ph,D,c = extract_tidal_constants(ilon, ilat, grid_file, model_file, EPSG,
TYPE='z', METHOD='spline', GRID='OTIS')
type='z', method='spline', grid='OTIS')
`Source code`__

Expand All @@ -26,6 +26,8 @@ Calling Sequence

.. autofunction:: pyTMD.read_tide_model.read_atlas_grid

.. autofunction:: pyTMD.read_tide_model.read_netcdf_grid

.. autofunction:: pyTMD.read_tide_model.read_constituents

.. autofunction:: pyTMD.read_tide_model.read_elevation_file
Expand All @@ -42,6 +44,8 @@ Calling Sequence

.. autofunction:: pyTMD.read_tide_model.combine_atlas_model

.. autofunction:: pyTMD.read_tide_model.read_netcdf_file

.. autofunction:: pyTMD.read_tide_model.extend_array

.. autofunction:: pyTMD.read_tide_model.extend_matrix
2 changes: 2 additions & 0 deletions doc/source/user_guide/spatial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ General Methods

.. autofunction:: pyTMD.spatial.data_type

.. autofunction:: pyTMD.spatial.from_file

.. autofunction:: pyTMD.spatial.from_ascii

.. autofunction:: pyTMD.spatial.from_netCDF4
Expand Down
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ dependencies:
- scipy
- setuptools_scm
- pip:
- git+https://github.com/tsutterley/read-ICESat-2.git
- git+https://github.com/tsutterley/read-ATM1b-QFIT-binary.git
- icesat2-toolkit
- ATM1b-QFIT
10 changes: 5 additions & 5 deletions notebooks/Check Tide Map.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -119,25 +119,25 @@
" ).elevation(TMDwidgets.model.value)\n",
" \n",
"# read tidal constants and interpolate to grid points\n",
"if model.format in ('OTIS','ATLAS'):\n",
"if model.format in ('OTIS','ATLAS','ESR'):\n",
" # if reading a single OTIS solution\n",
" xi,yi,hz,mz,iob,dt = pyTMD.read_tide_model.read_tide_grid(model.grid_file)\n",
"elif (model.format == 'netcdf'):\n",
" # if reading a netCDF OTIS atlas solution\n",
" xi,yi,hz = pyTMD.read_netcdf_model.read_netcdf_grid(model.grid_file,\n",
" GZIP=model.compressed, TYPE='z')\n",
" compressed=model.compressed, type='z')\n",
" # invert bathymetry mask\n",
" mz = np.invert(hz.mask)\n",
"elif (model.format == 'GOT'):\n",
" # if reading a NASA GOT solution\n",
" hc,xi,yi,c = pyTMD.read_GOT_model.read_GOT_grid(model.model_file[0],\n",
" GZIP=model.compressed)\n",
" compressed=model.compressed)\n",
" # invert tidal constituent mask\n",
" mz = np.invert(hc.mask)\n",
"elif (model.format == 'FES'):\n",
" # if reading a FES netCDF solution\n",
" hc,xi,yi = pyTMD.read_FES_model.read_netcdf_file(model.model_file[0],\n",
" GZIP=model.compressed, TYPE='z', VERSION=model.version)\n",
" compressed=model.compressed, type='z', version=model.version)\n",
" # invert tidal constituent mask\n",
" mz = np.invert(hc.mask)"
]
Expand All @@ -157,7 +157,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'):\n",
" if model.format in ('OTIS','ATLAS','ESR'):\n",
" # if reading a single OTIS solution\n",
" xi,yi,hz,mz,iob,dt = pyTMD.read_tide_model.read_tide_grid(model.grid_file)\n",
" # adjust longitudinal convention of input latitude and longitude\n",
Expand Down
23 changes: 12 additions & 11 deletions notebooks/Plot Antarctic Tidal Currents.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -191,25 +191,26 @@
"# 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'):\n",
" if model.format in ('OTIS','ATLAS','ESR'):\n",
" amp,ph,D,c = extract_tidal_constants(lon, lat, model.grid_file,\n",
" model.model_file, model.projection, TYPE=TYPE,\n",
" METHOD='spline', GRID=model.format)\n",
" model.model_file, model.projection, type=TYPE,\n",
" method='spline', grid=model.format)\n",
" DELTAT = np.zeros_like(tide_time)\n",
" elif (model.format == 'netcdf'):\n",
" amp,ph,D,c = extract_netcdf_constants(lon, lat, model.grid_file,\n",
" model.model_file[TYPE], TYPE=TYPE, METHOD='spline',\n",
" SCALE=model.scale, GZIP=model.compressed)\n",
" model.model_file[TYPE], type=TYPE, method='spline',\n",
" scale=model.scale, compressed=model.compressed)\n",
" DELTAT = np.zeros_like(tide_time)\n",
" elif (model.format == 'GOT'):\n",
" amp,ph,c = extract_GOT_constants(lon, lat, model.model_file,\n",
" METHOD='spline', SCALE=model.scale, GZIP=model.compressed)\n",
" method='spline', scale=model.scale,\n",
" compressed=model.compressed)\n",
" # interpolate delta times from calendar dates to tide time\n",
" DELTAT = calc_delta_time(delta_file, tide_time)\n",
" elif (model.format == 'FES'):\n",
" amp,ph = extract_FES_constants(lon, lat, model.model_file[TYPE],\n",
" TYPE=model.type, VERSION=model.versin, METHOD='spline',\n",
" SCALE=model.scale, GZIP=model.compressed)\n",
" type=TYPE, version=model.version, method='spline',\n",
" scale=model.scale, compressed=model.compressed)\n",
" c = model.constituents\n",
" # interpolate delta times from calendar dates to tide time\n",
" DELTAT = calc_delta_time(delta_file, tide_time)\n",
Expand All @@ -223,10 +224,10 @@
" tide[TYPE] = np.ma.zeros((ny,nx,24))\n",
" for hour in range(24):\n",
" # predict tidal elevations at time and infer minor corrections\n",
" TIDE = predict_tide(tide_time[hour], hc, c, DELTAT=DELTAT[hour],\n",
" CORRECTIONS=model.format)\n",
" TIDE = predict_tide(tide_time[hour], hc, c, deltat=DELTAT[hour],\n",
" corrections=model.format)\n",
" MINOR = infer_minor_corrections(tide_time[hour], hc, c,\n",
" DELTAT=DELTAT[hour], CORRECTIONS=model.format)\n",
" deltat=DELTAT[hour], corrections=model.format)\n",
" # add major and minor components and reform grid\n",
" tide[TYPE][:,:,hour] = np.reshape((TIDE+MINOR),(ny,nx))"
]
Expand Down
Loading

0 comments on commit 8ee4ea5

Please sign in to comment.