Skip to content

Commit

Permalink
feat: add Ray and Erofeeva (2014) to the database for #327
Browse files Browse the repository at this point in the history
  • Loading branch information
tsutterley committed Sep 24, 2024
1 parent db641b0 commit af2a8e9
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 1 deletion.
17 changes: 17 additions & 0 deletions providers/GSFC.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,23 @@
"version": "5.6",
"scale": 0.01,
"reference": "https://doi.org/10.1126/sciadv.abd4744"
},
"RE14": {
"format": "GOT-netcdf",
"name": "RE14",
"model_file": [
"RE14_LongPeriodTides_rel/oceantides/Mf_RE14_oceantide.nc",
"RE14_LongPeriodTides_rel/oceantides/Mm_RE14_oceantide.nc",
"RE14_LongPeriodTides_rel/oceantides/Mt_RE14_oceantide.nc",
"RE14_LongPeriodTides_rel/oceantides/Node_RE14_oceantide.nc",
"RE14_LongPeriodTides_rel/oceantides/Sa_RE14_oceantide.nc",
"RE14_LongPeriodTides_rel/oceantides/Ssa_RE14_oceantide.nc"
],
"type": "z",
"variable": "tide_lpe",
"version": "2014",
"scale": 0.01,
"reference": "https://doi.org/10.1002/2013JB010830"
}
}
}
17 changes: 17 additions & 0 deletions pyTMD/data/database.json
Original file line number Diff line number Diff line change
Expand Up @@ -1573,6 +1573,23 @@
"variable": "tide_ocean",
"version": "HAMTIDE11"
},
"RE14": {
"format": "GOT-netcdf",
"model_file": [
"RE14_LongPeriodTides_rel/oceantides/Mf_RE14_oceantide.nc",
"RE14_LongPeriodTides_rel/oceantides/Mm_RE14_oceantide.nc",
"RE14_LongPeriodTides_rel/oceantides/Mt_RE14_oceantide.nc",
"RE14_LongPeriodTides_rel/oceantides/Node_RE14_oceantide.nc",
"RE14_LongPeriodTides_rel/oceantides/Sa_RE14_oceantide.nc",
"RE14_LongPeriodTides_rel/oceantides/Ssa_RE14_oceantide.nc"
],
"name": "RE14",
"reference": "https://doi.org/10.1002/2013JB010830",
"scale": 0.01,
"type": "z",
"variable": "tide_lpe",
"version": "2014"
},
"TPXO10-atlas-v2": {
"format": "OTIS",
"grid_file": "TPXO10_atlas_v2/grid_tpxo10atlas_v2",
Expand Down
3 changes: 2 additions & 1 deletion pyTMD/io/constituents.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
https://numpy.org/doc/stable/user/numpy-for-matlab-users.html
UPDATE HISTORY:
Updated 09/2024: add node to list of known constituent names
Updated 08/2024: add GOT prime nomenclature for 3rd degree constituents
Updated 07/2024: add function to parse tidal constituents from strings
Updated 05/2024: make subscriptable and allow item assignment
Expand Down Expand Up @@ -216,7 +217,7 @@ def parse(constituent: str) -> str:
'm2a','m2b','lambda2','l2','t2',r'(?<!mn)(?<!mk)(?<!ep)s2(?!0)',
'r2','k2','eta2','mns2','2sm2','m3','mk3','s3','mn4','m4',
'ms4','mk4',r'(?<!m)s4','s5','m6','s6','s7','s8','m8','mks2',
'msqm','mtm',r'(?<!m)n4','eps2','z0']
'msqm','mtm',r'(?<!m)n4','eps2','z0','node']
# compile regular expression
# adding GOT prime nomenclature for 3rd degree constituents
rx = re.compile(r'(' + '|'.join(cindex) + r')(\')?', re.IGNORECASE)
Expand Down
21 changes: 21 additions & 0 deletions pyTMD/io/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
drop support for the ascii definition file format
add file_format and nodal correction attributes
export database as a dataclass for easier access
added variable name and descriptions for long period tides
Updated 08/2024: added attribute for minor constituents to infer
allow searching over iterable glob strings in definition files
added option to try automatic detection of definition file format
Expand Down Expand Up @@ -321,6 +322,8 @@ def atl03(self) -> str:
return 'tide_ocean'
elif (self.type == 'z') and (self.variable == 'tide_load'):
return 'tide_load'
elif (self.type == 'z') and (self.variable == 'tide_lpe'):
return 'tide_equilibrium'
else:
return None

Expand All @@ -332,6 +335,8 @@ def atl06(self) -> str:
return 'tide_ocean'
elif (self.type == 'z') and (self.variable == 'tide_load'):
return 'tide_load'
elif (self.type == 'z') and (self.variable == 'tide_lpe'):
return 'tide_equilibrium'
else:
return None

Expand All @@ -343,6 +348,8 @@ def atl07(self) -> str:
return 'height_segment_ocean'
elif (self.type == 'z') and (self.variable == 'tide_load'):
return 'height_segment_load'
elif (self.type == 'z') and (self.variable == 'tide_lpe'):
return 'height_segment_lpe'
else:
return None

Expand All @@ -354,6 +361,8 @@ def atl10(self) -> str:
return 'height_segment_ocean'
elif (self.type == 'z') and (self.variable == 'tide_load'):
return 'height_segment_load'
elif (self.type == 'z') and (self.variable == 'tide_lpe'):
return 'height_segment_lpe'
else:
return None

Expand All @@ -365,6 +374,8 @@ def atl11(self) -> str:
return 'tide_ocean'
elif (self.type == 'z') and (self.variable == 'tide_load'):
return 'tide_load'
elif (self.type == 'z') and (self.variable == 'tide_lpe'):
return 'tide_equilibrium'
else:
return None

Expand All @@ -376,6 +387,8 @@ def atl12(self) -> str:
return 'tide_ocean_seg'
elif (self.type == 'z') and (self.variable == 'tide_load'):
return 'tide_load_seg'
elif (self.type == 'z') and (self.variable == 'tide_lpe'):
return 'tide_equilibrium_seg'
else:
return None

Expand All @@ -387,6 +400,8 @@ def gla12(self) -> str:
return 'd_ocElv'
elif (self.type == 'z') and (self.variable == 'tide_load'):
return 'd_ldElv'
elif (self.type == 'z') and (self.variable == 'tide_lpe'):
return 'd_eqElv'
else:
return None

Expand All @@ -398,6 +413,8 @@ def long_name(self) -> str:
return 'ocean_tide_elevation'
elif (self.type == 'z') and (self.variable == 'tide_load'):
return 'load_tide_elevation'
elif (self.type == 'z') and (self.variable == 'tide_lpe'):
return 'Equilibrium_Tide'
elif (self.type == ['u','v']):
return dict(u='zonal_tidal_current', v='meridional_tidal_current')
else:
Expand All @@ -412,6 +429,8 @@ def description(self) -> str:
elif (self.type == 'z') and (self.variable == 'tide_load'):
return ("Local displacement due to ocean tidal loading "
"derived from harmonic constants")
elif (self.type == 'z') and (self.variable == 'tide_lpe'):
return 'Long-period equilibrium tide elevations'
elif (self.type == ['u','v']):
attr = {}
attr['u'] = ('Depth-averaged tidal zonal current '
Expand Down Expand Up @@ -449,6 +468,8 @@ def ocean_elevation() -> list:
for model, val in parameters['elevation'].items():
if (val['type'] == 'z') and (val['variable'] == 'tide_ocean'):
model_list.append(model)
elif (val['type'] == 'z') and (val['variable'] == 'tide_lpe'):
model_list.append(model)
# return unique list of models
return sorted(set(model_list))

Expand Down

0 comments on commit af2a8e9

Please sign in to comment.