Skip to content

Commit

Permalink
fix: omega and phase in constituent parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
tsutterley committed Nov 30, 2024
1 parent e1eccc0 commit 39d8fe1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions pyTMD/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -1420,7 +1420,7 @@ def _constituent_parameters(c: str, **kwargs):
_omega = np.array([1.405189e-04, 1.454441e-04, 7.292117e-05, 6.759774e-05,
1.378797e-04, 7.252295e-05, 1.458423e-04, 6.495854e-05, 1.352405e-04,
1.355937e-04, 1.382329e-04, 1.431581e-04, 1.452450e-04, 7.556036e-05,
7.028195e-05, 7.824458e-05, 6.531174e-05, 0.053234e-04, 0.026392e-04,
7.025945e-05, 7.824458e-05, 6.531174e-05, 0.053234e-04, 0.026392e-04,
0.003982e-04, 2.810377e-04, 2.859630e-04, 2.783984e-04, 4.215566e-04,
5.620755e-04, 2.134402e-04, 4.363323e-04, 1.503693e-04, 2.081166e-04,
4.925200e-06, 1.990970e-07, 7.962619e-06, 6.231934e-05])
Expand All @@ -1429,10 +1429,10 @@ def _constituent_parameters(c: str, **kwargs):
# the forcing for that constituent is zero on the Greenwich meridian
_phase = np.array([1.731557546, 0.000000000, 0.173003674, 1.558553872,
6.050721243, 6.110181633, 3.487600001, 5.877717569, 4.086699633,
3.463115091, 5.427136701, 0.553986502, 0.052841931, 2.137025284,
2.436575100, 1.929046130, 5.254133027, 1.756042456, 1.964021610,
3.463115091, 5.427136701, 0.553986502, 0.050398470, 2.137025284,
2.436575000, 1.929046130, 5.254133027, 1.756042456, 1.964021610,
3.487600001, 3.463115091, 1.731557546, 1.499093481, 5.194672637,
6.926230184, 1.904561220, 0.000000000, 4.551627762, 3.809122439,
6.926230184, 1.904561220, 0.000000000, 4.551627762, 3.290111417,
4.551627762, 6.232786837, 3.720064066, 3.91369596])
# amplitudes of equilibrium tide in meters
# _amplitude = np.array([0.242334,0.112743,0.141565,0.100661,0.046397,
Expand Down
9 changes: 5 additions & 4 deletions test/test_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,10 +679,10 @@ def test_parameters():
"""
Test constituent parameter values
"""
# parametrized constituents (sans m1 and 2mk3)
# parametrized constituents
cindex = ['m2', 's2', 'k1', 'o1', 'n2', 'p1', 'k2', 'q1', '2n2', 'mu2',
'nu2', 'l2', 'j1', 'oo1', 'rho1', 'mf', 'mm', 'ssa',
'm4', 'ms4', 'mn4', 'm6', 'm8', 'mk3', 's6', '2sm2',
'nu2', 'l2', 't2', 'j1', 'm1', 'oo1', 'rho1', 'mf', 'mm', 'ssa',
'm4', 'ms4', 'mn4', 'm6', 'm8', 'mk3', 's6', '2sm2', '2mk3',
'msf', 'sa', 'mt', '2q1']
# number of days between MJD and the tide epoch (1992-01-01T00:00:00)
MJD = np.atleast_1d(48622.0)
Expand All @@ -703,13 +703,14 @@ def test_parameters():
for i, c in enumerate(cindex):
# get constituent parameters
amp, ph, omega, alpha, species = _constituent_parameters(c)
# convert phase to degrees
phase = np.mod(180.0*ph/np.pi, 360.0)
# check species
cartwright = doodson_number(c, formalism='Cartwright')
assert species == cartwright[0]
# check frequency calculation
assert np.isclose(omega, omegas[i])
# assert phase calculation
phase = np.mod(180.0*ph/np.pi, 360.0)
assert np.isclose(phase, G[0,i])

def test_doodson():
Expand Down

0 comments on commit 39d8fe1

Please sign in to comment.