From b386a337322eceff18d9b5eb8c9da64426d726ca Mon Sep 17 00:00:00 2001 From: Tyler Sutterley Date: Tue, 15 Jun 2021 15:15:48 -0700 Subject: [PATCH] feat: added new Gr1km-v2 1km Greenland model from ESR (#59) feat: added 3413 projection for new 1km Greenland model from ESR feat: update notebooks for Gr1km-v2 fix: tidal currents for bilinear interpolation to address part of #57 fix: add warning for tide models being entered as string to address #58 docs: update documentation for new model docs: add notes to interpolation with warnings fix: check for nan points when reading OTIS models test: update list of invalid stations in Arctic --- Dockerfile | 1 + .../getting_started/Getting-Started.rst | 8 +++++-- .../user_guide/compute_tidal_currents.md | 1 + .../user_guide/compute_tidal_elevations.md | 1 + .../user_guide/compute_tides_ICESat2_ATL03.md | 1 + .../user_guide/compute_tides_ICESat2_ATL06.md | 1 + .../user_guide/compute_tides_ICESat2_ATL07.md | 1 + .../user_guide/compute_tides_ICESat2_ATL11.md | 1 + .../user_guide/compute_tides_ICESat2_ATL12.md | 1 + .../user_guide/compute_tides_ICESat_GLA12.md | 1 + .../compute_tides_icebridge_data.md | 1 + notebooks/Check Tide Map.ipynb | 8 +++++-- notebooks/Plot Arctic Ocean Map.ipynb | 13 +++++++++--- notebooks/Plot Tide Forecasts.ipynb | 12 ++++++++--- pyTMD/compute_tide_corrections.py | 17 +++++++++++++-- pyTMD/convert_ll_xy.py | 21 ++++++++++++++++++- pyTMD/read_FES_model.py | 9 +++++++- pyTMD/read_GOT_model.py | 9 +++++++- pyTMD/read_netcdf_model.py | 9 +++++++- pyTMD/read_tide_model.py | 16 ++++++++++++-- scripts/compute_LPET_elevations.py | 2 ++ scripts/compute_LPT_displacements.py | 2 ++ scripts/compute_OPT_displacements.py | 2 ++ scripts/compute_tidal_currents.py | 13 +++++++++++- scripts/compute_tidal_elevations.py | 15 ++++++++++++- scripts/compute_tides_ICESat2_ATL03.py | 15 ++++++++++++- scripts/compute_tides_ICESat2_ATL06.py | 15 ++++++++++++- scripts/compute_tides_ICESat2_ATL07.py | 17 +++++++++++++-- scripts/compute_tides_ICESat2_ATL11.py | 15 ++++++++++++- scripts/compute_tides_ICESat2_ATL12.py | 15 ++++++++++++- scripts/compute_tides_ICESat_GLA12.py | 15 ++++++++++++- scripts/compute_tides_icebridge_data.py | 13 +++++++++++- test/test_download_and_read.py | 2 +- 33 files changed, 244 insertions(+), 29 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9a294318..c32ff8c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,6 +37,7 @@ RUN wget -q http://zlib.net/zlib-${ZLIB_VERSION}.tar.gz && \ ./configure --prefix=/usr/local && \ make --quiet --jobs=${JOBS} && \ make --quiet install && \ + make clean && \ cd contrib/minizip && \ autoreconf -fvi && \ ./configure --quiet --prefix=/usr/local/ && \ diff --git a/doc/source/getting_started/Getting-Started.rst b/doc/source/getting_started/Getting-Started.rst index eeb061a9..63e78cda 100644 --- a/doc/source/getting_started/Getting-Started.rst +++ b/doc/source/getting_started/Getting-Started.rst @@ -42,10 +42,11 @@ This structure was chosen based on the different formats of each tide model. * `CATS2008 `_: ``/CATS2008/`` * CATS2008_load: ``/CATS2008a_SPOTL_Load/`` -- Arctic Ocean Tidal Simulations [Padman2004]_ +- Arctic Ocean and Greenland Coast Tidal Simulations [Padman2004]_ * `AODTM-5 `_: ``/aodtm5_tmd/`` * `AOTIM-5 `_: ``/aotim5_tmd/`` * `AOTIM-5-2018 `_: ``/Arc5km2018/`` + * Gr1km-v2: ``/greenlandTMD_v2/`` - TOPEX/POSEIDON global tide models [Egbert2002]_ * `TPXO9-atlas `_: ``/TPXO9_atlas/`` @@ -148,7 +149,8 @@ There are options to use nearest and linear interpolators with the For coastal or near-grounded points, the model can be extrapolated using a `nearest-neighbor `_ routine. The default maximum extrapolation distance is 10 kilometers. -This extrapolation cutoff can be set to any distance in kilometers. +This default distance may not be a large enough extrapolation for some applications and models. +The extrapolation cutoff can be set to any distance in kilometers, but should be used with caution in cases such as narrow fjords or ice sheet grounding zones [Padman2018]_. References ########## @@ -161,6 +163,8 @@ References .. [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 `_ +.. [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 `_ + .. [Ray1999] R. D. Ray, "A Global Ocean Tide Model From TOPEX/POSEIDON Altimetry: GOT99.2", *NASA Technical Memorandum*, `NASA/TM--1999-209478 `_. .. [Stammer2014] D. Stammer et al., "Accuracy assessment of global barotropic ocean tide models", *Reviews of Geophysics*, 52, 243--282, (2014). `doi: 10.1002/2014RG000450 `_ diff --git a/doc/source/user_guide/compute_tidal_currents.md b/doc/source/user_guide/compute_tidal_currents.md index b778db08..2427791f 100644 --- a/doc/source/user_guide/compute_tidal_currents.md +++ b/doc/source/user_guide/compute_tidal_currents.md @@ -31,6 +31,7 @@ python compute_tidal_currents.py --directory --tide * `'AODTM-5'` * `'AOTIM-5'` * `'AOTIM-5-2018'` + * `'Gr1km-v2'` * `'FES2014'` - `--format X`: input and output data format * `'csv'` (default) diff --git a/doc/source/user_guide/compute_tidal_elevations.md b/doc/source/user_guide/compute_tidal_elevations.md index 29f04d85..3e623854 100644 --- a/doc/source/user_guide/compute_tidal_elevations.md +++ b/doc/source/user_guide/compute_tidal_elevations.md @@ -34,6 +34,7 @@ python compute_tidal_elevations.py --directory --tide --tide --tide --tide --tide --tide --tide --tide f4'), count=2*nx) h.data.real[i,:] = temp[0:2*nx-1:2] h.data.imag[i,:] = temp[1:2*nx:2] + #-- update mask for nan values + h.mask[np.isnan(h.data)] = True + #-- replace masked values with fill value + h.data[h.mask] = h.fill_value #-- close the file fid.close() #-- return the elevation @@ -811,6 +817,12 @@ def read_transport_file(input_file,ic): u.data.imag[i,:] = temp[1:4*nx-2:4] v.data.real[i,:] = temp[2:4*nx-1:4] v.data.imag[i,:] = temp[3:4*nx:4] + #-- update mask for nan values + u.mask[np.isnan(u.data)] = True + v.mask[np.isnan(v.data)] = True + #-- replace masked values with fill value + u.data[u.mask] = u.fill_value + v.data[v.mask] = v.fill_value #-- close the file fid.close() #-- return the transport components diff --git a/scripts/compute_LPET_elevations.py b/scripts/compute_LPET_elevations.py index 719edd0e..2424cb7b 100644 --- a/scripts/compute_LPET_elevations.py +++ b/scripts/compute_LPET_elevations.py @@ -130,8 +130,10 @@ def compute_LPET_elevations(input_file, output_file, #-- converting x,y from projection to latitude/longitude #-- could try to extract projection attributes from netCDF4 and HDF5 files try: + #-- EPSG projection code string or int crs1 = pyproj.CRS.from_string("epsg:{0:d}".format(int(PROJECTION))) except (ValueError,pyproj.exceptions.CRSError): + #-- Projection SRS string crs1 = pyproj.CRS.from_string(PROJECTION) crs2 = pyproj.CRS.from_string("epsg:{0:d}".format(4326)) transformer = pyproj.Transformer.from_crs(crs1, crs2, always_xy=True) diff --git a/scripts/compute_LPT_displacements.py b/scripts/compute_LPT_displacements.py index 0a5b2ad5..5f9c3a23 100644 --- a/scripts/compute_LPT_displacements.py +++ b/scripts/compute_LPT_displacements.py @@ -143,8 +143,10 @@ def compute_LPT_displacements(input_file, output_file, FORMAT='csv', #-- converting x,y from projection to latitude/longitude #-- could try to extract projection attributes from netCDF4 and HDF5 files try: + #-- EPSG projection code string or int crs1 = pyproj.CRS.from_string("epsg:{0:d}".format(int(PROJECTION))) except (ValueError,pyproj.exceptions.CRSError): + #-- Projection SRS string crs1 = pyproj.CRS.from_string(PROJECTION) crs2 = pyproj.CRS.from_string("epsg:{0:d}".format(4326)) transformer = pyproj.Transformer.from_crs(crs1, crs2, always_xy=True) diff --git a/scripts/compute_OPT_displacements.py b/scripts/compute_OPT_displacements.py index 8b1d3fd8..46fa0fe6 100644 --- a/scripts/compute_OPT_displacements.py +++ b/scripts/compute_OPT_displacements.py @@ -161,8 +161,10 @@ def compute_OPT_displacements(input_file, output_file, FORMAT='csv', #-- converting x,y from projection to latitude/longitude #-- could try to extract projection attributes from netCDF4 and HDF5 files try: + #-- EPSG projection code string or int crs1 = pyproj.CRS.from_string("epsg:{0:d}".format(int(PROJECTION))) except (ValueError,pyproj.exceptions.CRSError): + #-- Projection SRS string crs1 = pyproj.CRS.from_string(PROJECTION) crs2 = pyproj.CRS.from_string("epsg:{0:d}".format(4326)) transformer = pyproj.Transformer.from_crs(crs1, crs2, always_xy=True) diff --git a/scripts/compute_tidal_currents.py b/scripts/compute_tidal_currents.py index 9a69decd..2c4f1075 100755 --- a/scripts/compute_tidal_currents.py +++ b/scripts/compute_tidal_currents.py @@ -1,7 +1,7 @@ #!/usr/bin/env python u""" compute_tidal_currents.py -Written by Tyler Sutterley (05/2021) +Written by Tyler Sutterley (06/2021) Calculates zonal and meridional tidal currents for an input file Uses OTIS format tidal solutions provided by Ohio State University and ESR @@ -32,6 +32,7 @@ AODTM-5 AOTIM-5 AOTIM-5-2018 + Gr1km-v2 FES2014 --format X: input and output data format csv (default) @@ -97,6 +98,7 @@ predict_tide_drift.py: predict tidal elevations using harmonic constants UPDATE HISTORY: + Updated 06/2021: added new Gr1km-v2 1km Greenland model from ESR Updated 05/2021: added option for extrapolation cutoff in kilometers Updated 03/2021: added TPXO9-atlas-v4 in binary OTIS format simplified netcdf inputs to be similar to binary OTIS read program @@ -289,6 +291,13 @@ def compute_tidal_currents(tide_dir, input_file, output_file, model_format = 'OTIS' EPSG = 'PSNorth' TYPES = ['u','v'] + elif (TIDE_MODEL == 'Gr1km-v2'): + grid_file = os.path.join(tide_dir,'greenlandTMD_v2','grid_Greenland8.v2') + model_file = os.path.join(tide_dir,'greenlandTMD_v2','u_Greenland8_rot.v2') + reference = 'https://www.esr.org/research/polar-tide-models/' + model_format = 'OTIS' + EPSG = '3413' + TYPES = ['u','v'] elif (TIDE_MODEL == 'FES2014'): model_directory = {} model_directory['u'] = os.path.join(tide_dir,'fes2014','eastward_velocity') @@ -372,8 +381,10 @@ def compute_tidal_currents(tide_dir, input_file, output_file, #-- converting x,y from projection to latitude/longitude #-- could try to extract projection attributes from netCDF4 and HDF5 files try: + #-- EPSG projection code string or int crs1 = pyproj.CRS.from_string("epsg:{0:d}".format(int(PROJECTION))) except (ValueError,pyproj.exceptions.CRSError): + #-- Projection SRS string crs1 = pyproj.CRS.from_string(PROJECTION) crs2 = pyproj.CRS.from_string("epsg:{0:d}".format(4326)) transformer = pyproj.Transformer.from_crs(crs1, crs2, always_xy=True) diff --git a/scripts/compute_tidal_elevations.py b/scripts/compute_tidal_elevations.py index 7164de50..e94723a2 100755 --- a/scripts/compute_tidal_elevations.py +++ b/scripts/compute_tidal_elevations.py @@ -1,7 +1,7 @@ #!/usr/bin/env python u""" compute_tidal_elevations.py -Written by Tyler Sutterley (05/2021) +Written by Tyler Sutterley (06/2021) Calculates tidal elevations for an input file Uses OTIS format tidal solutions provided by Ohio State University and ESR @@ -34,6 +34,7 @@ AODTM-5 AOTIM-5 AOTIM-5-2018 + Gr1km-v2 GOT4.7 GOT4.7_load GOT4.8 @@ -107,6 +108,7 @@ predict_tide_drift.py: predict tidal elevations using harmonic constants UPDATE HISTORY: + Updated 06/2021: added new Gr1km-v2 1km Greenland model from ESR Updated 05/2021: added option for extrapolation cutoff in kilometers Updated 03/2021: added TPXO9-atlas-v4 in binary OTIS format simplified netcdf inputs to be similar to binary OTIS read program @@ -318,6 +320,15 @@ def compute_tidal_elevations(tide_dir, input_file, output_file, model_format = 'OTIS' EPSG = 'PSNorth' model_type = 'z' + elif (TIDE_MODEL == 'Gr1km-v2'): + grid_file = os.path.join(tide_dir,'greenlandTMD_v2','grid_Greenland8.v2') + model_file = os.path.join(tide_dir,'greenlandTMD_v2','h_Greenland8.v2') + reference = 'https://www.esr.org/research/polar-tide-models/' + output_variable = 'tide_ocean' + variable_long_name = 'Ocean_Tide' + model_format = 'OTIS' + EPSG = '3413' + model_type = 'z' elif (TIDE_MODEL == 'GOT4.7'): model_directory = os.path.join(tide_dir,'GOT4.7','grids_oceantide') model_files = ['q1.d.gz','o1.d.gz','p1.d.gz','k1.d.gz','n2.d.gz', @@ -487,8 +498,10 @@ def compute_tidal_elevations(tide_dir, input_file, output_file, #-- converting x,y from projection to latitude/longitude #-- could try to extract projection attributes from netCDF4 and HDF5 files try: + #-- EPSG projection code string or int crs1 = pyproj.CRS.from_string("epsg:{0:d}".format(int(PROJECTION))) except (ValueError,pyproj.exceptions.CRSError): + #-- Projection SRS string crs1 = pyproj.CRS.from_string(PROJECTION) crs2 = pyproj.CRS.from_string("epsg:{0:d}".format(4326)) transformer = pyproj.Transformer.from_crs(crs1, crs2, always_xy=True) diff --git a/scripts/compute_tides_ICESat2_ATL03.py b/scripts/compute_tides_ICESat2_ATL03.py index 77fefa0c..928163ba 100644 --- a/scripts/compute_tides_ICESat2_ATL03.py +++ b/scripts/compute_tides_ICESat2_ATL03.py @@ -1,7 +1,7 @@ #!/usr/bin/env python u""" compute_tides_ICESat2_ATL03.py -Written by Tyler Sutterley (05/2021) +Written by Tyler Sutterley (06/2021) Calculates tidal elevations for correcting ICESat-2 photon height data Calculated at ATL03 segment level using reference photon geolocation and time Segment level corrections can be applied to the individual photon events (PEs) @@ -30,6 +30,7 @@ AODTM-5 AOTIM-5 AOTIM-5-2018 + Gr1km-v2 GOT4.7 GOT4.7_load GOT4.8 @@ -79,6 +80,7 @@ predict_tide_drift.py: predict tidal elevations using harmonic constants UPDATE HISTORY: + Updated 06/2021: added new Gr1km-v2 1km Greenland model from ESR Updated 05/2021: added option for extrapolation cutoff in kilometers Updated 04/2021: can use a generically named ATL03 file as input Updated 03/2021: added TPXO9-atlas-v4 in binary OTIS format @@ -331,6 +333,17 @@ def compute_tides_ICESat2(tide_dir, INPUT_FILE, TIDE_MODEL=None, METHOD='spline' model_format = 'OTIS' EPSG = 'PSNorth' TYPE = 'z' + elif (TIDE_MODEL == 'Gr1km-v2'): + grid_file = os.path.join(tide_dir,'greenlandTMD_v2','grid_Greenland8.v2') + model_file = os.path.join(tide_dir,'greenlandTMD_v2','h_Greenland8.v2') + variable = 'tide_ocean' + long_name = "Ocean Tide" + description = ("Ocean Tides including diurnal and semi-diurnal " + "(harmonic analysis), and longer period tides (dynamic and " + "self-consistent equilibrium).") + model_format = 'OTIS' + EPSG = '3413' + TYPE = 'z' elif (TIDE_MODEL == 'GOT4.7'): model_directory = os.path.join(tide_dir,'GOT4.7','grids_oceantide') model_files = ['q1.d.gz','o1.d.gz','p1.d.gz','k1.d.gz','n2.d.gz', diff --git a/scripts/compute_tides_ICESat2_ATL06.py b/scripts/compute_tides_ICESat2_ATL06.py index 5905ff29..cfa98e89 100644 --- a/scripts/compute_tides_ICESat2_ATL06.py +++ b/scripts/compute_tides_ICESat2_ATL06.py @@ -1,7 +1,7 @@ #!/usr/bin/env python u""" compute_tides_ICESat2_ATL06.py -Written by Tyler Sutterley (05/2021) +Written by Tyler Sutterley (06/2021) Calculates tidal elevations for correcting ICESat-2 land ice elevation data Uses OTIS format tidal solutions provided by Ohio State University and ESR @@ -28,6 +28,7 @@ AODTM-5 AOTIM-5 AOTIM-5-2018 + Gr1km-v2 GOT4.7 GOT4.7_load GOT4.8 @@ -77,6 +78,7 @@ predict_tide_drift.py: predict tidal elevations using harmonic constants UPDATE HISTORY: + Updated 06/2021: added new Gr1km-v2 1km Greenland model from ESR Updated 05/2021: added option for extrapolation cutoff in kilometers Updated 04/2021: can use a generically named ATL06 file as input Updated 03/2021: added TPXO9-atlas-v4 in binary OTIS format @@ -331,6 +333,17 @@ def compute_tides_ICESat2(tide_dir, INPUT_FILE, TIDE_MODEL=None, METHOD='spline' model_format = 'OTIS' EPSG = 'PSNorth' TYPE = 'z' + elif (TIDE_MODEL == 'Gr1km-v2'): + grid_file = os.path.join(tide_dir,'greenlandTMD_v2','grid_Greenland8.v2') + model_file = os.path.join(tide_dir,'greenlandTMD_v2','h_Greenland8.v2') + variable = 'tide_ocean' + long_name = "Ocean Tide" + description = ("Ocean Tides including diurnal and semi-diurnal " + "(harmonic analysis), and longer period tides (dynamic and " + "self-consistent equilibrium).") + model_format = 'OTIS' + EPSG = '3413' + TYPE = 'z' elif (TIDE_MODEL == 'GOT4.7'): model_directory = os.path.join(tide_dir,'GOT4.7','grids_oceantide') model_files = ['q1.d.gz','o1.d.gz','p1.d.gz','k1.d.gz','n2.d.gz', diff --git a/scripts/compute_tides_ICESat2_ATL07.py b/scripts/compute_tides_ICESat2_ATL07.py index f3ab4ab1..c4403376 100644 --- a/scripts/compute_tides_ICESat2_ATL07.py +++ b/scripts/compute_tides_ICESat2_ATL07.py @@ -1,7 +1,7 @@ #!/usr/bin/env python u""" compute_tides_ICESat2_ATL07.py -Written by Tyler Sutterley (05/2021) +Written by Tyler Sutterley (06/2021) Calculates tidal elevations for correcting ICESat-2 sea ice height data Uses OTIS format tidal solutions provided by Ohio State University and ESR @@ -28,6 +28,7 @@ AODTM-5 AOTIM-5 AOTIM-5-2018 + Gr1km-v2 GOT4.7 GOT4.7_load GOT4.8 @@ -77,6 +78,7 @@ predict_tide_drift.py: predict tidal elevations using harmonic constants UPDATE HISTORY: + Updated 06/2021: added new Gr1km-v2 1km Greenland model from ESR Updated 05/2021: added option for extrapolation cutoff in kilometers Updated 04/2021: can use a generically named ATL07 file as input Updated 03/2021: added TPXO9-atlas-v4 in binary OTIS format @@ -322,7 +324,7 @@ def compute_tides_ICESat2(tide_dir, INPUT_FILE, TIDE_MODEL=None, METHOD='spline' model_file = os.path.join(tide_dir,'Arc5km2018','h_Arc5km2018') reference = ('https://www.esr.org/research/polar-tide-models/' 'list-of-polar-tide-models/aotim-5/') - variable = 'tide_ocean' + variable = 'height_segment_ocean' long_name = "Ocean Tide" description = ("Ocean Tides including diurnal and semi-diurnal " "(harmonic analysis), and longer period tides (dynamic and " @@ -330,6 +332,17 @@ def compute_tides_ICESat2(tide_dir, INPUT_FILE, TIDE_MODEL=None, METHOD='spline' model_format = 'OTIS' EPSG = 'PSNorth' TYPE = 'z' + elif (TIDE_MODEL == 'Gr1km-v2'): + grid_file = os.path.join(tide_dir,'greenlandTMD_v2','grid_Greenland8.v2') + model_file = os.path.join(tide_dir,'greenlandTMD_v2','h_Greenland8.v2') + variable = 'height_segment_ocean' + long_name = "Ocean Tide" + description = ("Ocean Tides including diurnal and semi-diurnal " + "(harmonic analysis), and longer period tides (dynamic and " + "self-consistent equilibrium).") + model_format = 'OTIS' + EPSG = '3413' + TYPE = 'z' elif (TIDE_MODEL == 'GOT4.7'): model_directory = os.path.join(tide_dir,'GOT4.7','grids_oceantide') model_files = ['q1.d.gz','o1.d.gz','p1.d.gz','k1.d.gz','n2.d.gz', diff --git a/scripts/compute_tides_ICESat2_ATL11.py b/scripts/compute_tides_ICESat2_ATL11.py index 564b03d1..ee1b8cae 100644 --- a/scripts/compute_tides_ICESat2_ATL11.py +++ b/scripts/compute_tides_ICESat2_ATL11.py @@ -1,7 +1,7 @@ #!/usr/bin/env python u""" compute_tides_ICESat2_ATL11.py -Written by Tyler Sutterley (05/2021) +Written by Tyler Sutterley (06/2021) Calculates tidal elevations for correcting ICESat-2 annual land ice height data Uses OTIS format tidal solutions provided by Ohio State University and ESR @@ -28,6 +28,7 @@ AODTM-5 AOTIM-5 AOTIM-5-2018 + Gr1km-v2 GOT4.7 GOT4.7_load GOT4.8 @@ -77,6 +78,7 @@ predict_tide_drift.py: predict tidal elevations using harmonic constants UPDATE HISTORY: + Updated 06/2021: added new Gr1km-v2 1km Greenland model from ESR Updated 05/2021: added option for extrapolation cutoff in kilometers Updated 04/2021: can use a generically named ATL11 file as input Updated 03/2021: added TPXO9-atlas-v4 in binary OTIS format @@ -315,6 +317,17 @@ def compute_tides_ICESat2(tide_dir, INPUT_FILE, TIDE_MODEL=None, METHOD='spline' model_format = 'OTIS' EPSG = 'PSNorth' TYPE = 'z' + elif (TIDE_MODEL == 'Gr1km-v2'): + grid_file = os.path.join(tide_dir,'greenlandTMD_v2','grid_Greenland8.v2') + model_file = os.path.join(tide_dir,'greenlandTMD_v2','h_Greenland8.v2') + variable = 'tide_ocean' + long_name = "Ocean Tide" + description = ("Ocean Tides including diurnal and semi-diurnal " + "(harmonic analysis), and longer period tides (dynamic and " + "self-consistent equilibrium).") + model_format = 'OTIS' + EPSG = '3413' + TYPE = 'z' elif (TIDE_MODEL == 'GOT4.7'): model_directory = os.path.join(tide_dir,'GOT4.7','grids_oceantide') model_files = ['q1.d.gz','o1.d.gz','p1.d.gz','k1.d.gz','n2.d.gz', diff --git a/scripts/compute_tides_ICESat2_ATL12.py b/scripts/compute_tides_ICESat2_ATL12.py index 909f80c9..74200f94 100644 --- a/scripts/compute_tides_ICESat2_ATL12.py +++ b/scripts/compute_tides_ICESat2_ATL12.py @@ -1,7 +1,7 @@ #!/usr/bin/env python u""" compute_tides_ICESat2_ATL12.py -Written by Tyler Sutterley (05/2021) +Written by Tyler Sutterley (06/2021) Calculates tidal elevations for correcting ICESat-2 ocean surface height data Uses OTIS format tidal solutions provided by Ohio State University and ESR @@ -28,6 +28,7 @@ AODTM-5 AOTIM-5 AOTIM-5-2018 + Gr1km-v2 GOT4.7 GOT4.7_load GOT4.8 @@ -77,6 +78,7 @@ predict_tide_drift.py: predict tidal elevations using harmonic constants UPDATE HISTORY: + Updated 06/2021: added new Gr1km-v2 1km Greenland model from ESR Updated 05/2021: added option for extrapolation cutoff in kilometers Updated 04/2021: can use a generically named ATL12 file as input Updated 03/2021: added TPXO9-atlas-v4 in binary OTIS format @@ -331,6 +333,17 @@ def compute_tides_ICESat2(tide_dir, INPUT_FILE, TIDE_MODEL=None, METHOD='spline' model_format = 'OTIS' EPSG = 'PSNorth' TYPE = 'z' + elif (TIDE_MODEL == 'Gr1km-v2'): + grid_file = os.path.join(tide_dir,'greenlandTMD_v2','grid_Greenland8.v2') + model_file = os.path.join(tide_dir,'greenlandTMD_v2','h_Greenland8.v2') + variable = 'tide_ocean_seg' + long_name = "Ocean Tide" + description = ("Ocean Tides including diurnal and semi-diurnal " + "(harmonic analysis), and longer period tides (dynamic and " + "self-consistent equilibrium).") + model_format = 'OTIS' + EPSG = '3413' + TYPE = 'z' elif (TIDE_MODEL == 'GOT4.7'): model_directory = os.path.join(tide_dir,'GOT4.7','grids_oceantide') model_files = ['q1.d.gz','o1.d.gz','p1.d.gz','k1.d.gz','n2.d.gz', diff --git a/scripts/compute_tides_ICESat_GLA12.py b/scripts/compute_tides_ICESat_GLA12.py index 5b699e4d..2b0ae353 100644 --- a/scripts/compute_tides_ICESat_GLA12.py +++ b/scripts/compute_tides_ICESat_GLA12.py @@ -1,7 +1,7 @@ #!/usr/bin/env python u""" compute_tides_ICESat_GLA12.py -Written by Tyler Sutterley (05/2021) +Written by Tyler Sutterley (06/2021) Calculates tidal elevations for correcting ICESat/GLAS L2 GLA12 Antarctic and Greenland Ice Sheet elevation data @@ -29,6 +29,7 @@ AODTM-5 AOTIM-5 AOTIM-5-2018 + Gr1km-v2 GOT4.7 GOT4.7_load GOT4.8 @@ -78,6 +79,7 @@ predict_tide_drift.py: predict tidal elevations using harmonic constants UPDATE HISTORY: + Updated 06/2021: added new Gr1km-v2 1km Greenland model from ESR Updated 05/2021: added option for extrapolation cutoff in kilometers Updated 04/2021: can use a generically named GLA12 file as input Updated 03/2021: added TPXO9-atlas-v4 in binary OTIS format @@ -327,6 +329,17 @@ def compute_tides_ICESat(tide_dir, INPUT_FILE, TIDE_MODEL=None, METHOD='spline', model_format = 'OTIS' EPSG = 'PSNorth' TYPE = 'z' + elif (TIDE_MODEL == 'Gr1km-v2'): + grid_file = os.path.join(tide_dir,'greenlandTMD_v2','grid_Greenland8.v2') + model_file = os.path.join(tide_dir,'greenlandTMD_v2','h_Greenland8.v2') + variable = 'd_ocElv' + long_name = "Ocean Tide Elevation" + description = ("Ocean Tides including diurnal and semi-diurnal " + "(harmonic analysis), and longer period tides (dynamic and " + "self-consistent equilibrium).") + model_format = 'OTIS' + EPSG = '3413' + TYPE = 'z' elif (TIDE_MODEL == 'GOT4.7'): model_directory = os.path.join(tide_dir,'GOT4.7','grids_oceantide') model_files = ['q1.d.gz','o1.d.gz','p1.d.gz','k1.d.gz','n2.d.gz', diff --git a/scripts/compute_tides_icebridge_data.py b/scripts/compute_tides_icebridge_data.py index 034d9086..da3f2ec2 100644 --- a/scripts/compute_tides_icebridge_data.py +++ b/scripts/compute_tides_icebridge_data.py @@ -1,7 +1,7 @@ #!/usr/bin/env python u""" compute_tides_icebridge_data.py -Written by Tyler Sutterley (05/2021) +Written by Tyler Sutterley (06/2021) Calculates tidal elevations for correcting Operation IceBridge elevation data Uses OTIS format tidal solutions provided by Ohio State University and ESR @@ -31,6 +31,7 @@ AODTM-5 AOTIM-5 AOTIM-5-2018 + Gr1km-v2 GOT4.7 GOT4.7_load GOT4.8 @@ -82,6 +83,7 @@ read_ATM1b_QFIT_binary.py: read ATM1b QFIT binary files (NSIDC version 1) UPDATE HISTORY: + Updated 06/2021: added new Gr1km-v2 1km Greenland model from ESR Updated 05/2021: added option for extrapolation cutoff in kilometers modified import of ATM1b QFIT reader Updated 03/2021: added TPXO9-atlas-v4 in binary OTIS format @@ -614,6 +616,15 @@ def compute_tides_icebridge_data(tide_dir, arg, TIDE_MODEL, METHOD='spline', model_format = 'OTIS' EPSG = 'PSNorth' TYPE = 'z' + elif (TIDE_MODEL == 'Gr1km-v2'): + grid_file = os.path.join(tide_dir,'greenlandTMD_v2','grid_Greenland8.v2') + model_file = os.path.join(tide_dir,'greenlandTMD_v2','h_Greenland8.v2') + reference = 'https://www.esr.org/research/polar-tide-models/' + output_variable = 'tide_ocean' + variable_long_name = 'Ocean_Tide' + model_format = 'OTIS' + EPSG = '3413' + TYPE = 'z' elif (TIDE_MODEL == 'GOT4.7'): model_directory = os.path.join(tide_dir,'GOT4.7','grids_oceantide') model_files = ['q1.d.gz','o1.d.gz','p1.d.gz','k1.d.gz','n2.d.gz', diff --git a/test/test_download_and_read.py b/test/test_download_and_read.py index 101513c7..e59400db 100644 --- a/test/test_download_and_read.py +++ b/test/test_download_and_read.py @@ -596,7 +596,7 @@ def test_verify_AOTIM5_2018(self, parameters): eps = np.finfo(np.float16).eps #-- compare daily outputs at each station point - invalid_list = ['KS14'] + invalid_list = ['BC1','KS12','KS14','BI3','BI4'] #-- remove coastal stations from the list valid_stations=[i for i,s in enumerate(shortname) if s not in invalid_list]