pyol package¶
Submodules¶
pyol.dataload module¶
-
pyol.dataload.
get_astronomical_arguments
(datestring: str) -> (<built-in function array>, <built-in function array>)[source]¶ The routine computes the astronomical elements for the given epoch in UTC
( G. Klopotek, J.Strandberg) :param datestring: – time in UTC in iso format: 2016-01-16T23:45:00
Returns: - (np.array, np.array)
- astr_args:
- [0]: MEAN MOONTIME IN DEGREE.
[1]: MEAN LONGITUDE OF THE MOON IN DEGREE.
[2]: MEAN LONGITUDE OF THE SUN IN DEGREE.
[3]: MEAN LONGITUDE OF THE PERIGEE OF THE MONN’S ORBIT IN DEGREE.
[4]: NEGATIVE MEAN LONGITUDE OF THE ASCENDING NODE OF THE MOON’S ORBIT IN DEGREE.
[5]: MEAN LONGITUDE OF THE PERIGEE OF THE SUN’S ORBIT IN DEGREE.
[6]: PERIOD OF JUPITER’S OPPOSITION IN DEGREE (FOR TAMURA 1987 TIDAL POTENTIAL DEVELOPMENT).
[7]: PERIOD OF VENUS’S CONJUNCTION IN DEGREE (FOR TAMURA 1987 TIDAL POTENTIAL DEVELOPMENT).
rates: TIME DERIVATIVES OF THE CORRESPONDING VARIABLES IN astr_args IN DEGREE PER HOUR.
-
pyol.dataload.
load_brest_data
() -> (<built-in function array>, <built-in function array>)[source]¶ Load brest data
Returns: - displacement_data:
- numpy array where the rows contains up, west, south component of the displacement amplitudes, followed by their respective phase lag. (Warning: west and south will only be 0s.)
- tide_arguments:
- numpy array where each row is the Tamura degree of potential and tide arguments for the corresponding column in displacement data, i.e. row one is: [2, 1, 1, 0, 0, 0, 0, 0] if the first column in displacement data correponds exactly to the K1 tide. Note that argument number 8 is omitted (assumed 0).
Return type: tuple
-
pyol.dataload.
load_model_data
(site: str = ”, model: str = ‘GOT00.2’, potentialfilepath: str = ”) -> (<built-in function array>, typing.List[str])[source]¶ Loads displacement amplitudes for the major tide constituents.
The module search for a blq data file corresponding to site and model in the package data directory unless potentialfilepath is specified, in which case the file at the specified location is used to load displacement amplitudes and phase lags.
Parameters: - site (optional) – Name of site for which to retrieve amplitudes, not used if potentialfilepath is specified.
- model (optional) – Name of model used to calculate amplitudes (default: GOT00.2), not used if potentialfilepath is specified.
- potentialfilepath (optional) – path to blq-file containg displacement amplitudes and phases for the desired site.
Returns: - displacement_data:
numpy array where the rows contains up, west, south component of the displacement amplitudes, followed by their respective phase lag.
- tide_names:
list of the tide names corresponding to each column of displacement_data
Return type: (np.array, List[str])
-
pyol.dataload.
load_potentialdata
() -> (<built-in function array>, typing.List[str])[source]¶ Loads the potential data stored in the file data/etcpot.dat and returns it in numpy format. Each row contain information for one tide constituent.
Returns: - potentialdata:
- [0]: WAVE NUMBER OF TAMURA 1987 TIDAL POTENTIAL DEVELOPMENT.
[1]: WAVE NUMBER OF CARTWRIGHT-TAYLER-EDDEN 1973 TIDAL POTENTIAL DEVELOPMENT.
[2]: DEGREE OF THE POTENTIAL.
[3]: ORDER OF THE POTENTIAL (= ARGUMENT NO. 1).
[4]: ARGUMENT NO. 2.
[5]: ARGUMENT NO. 3.
[6]: ARGUMENT NO. 4.
[7]: ARGUMENT NO. 5.
[8]: ARGUMENT NO. 6.
[9]: ARGUMENT NO. 7 (ONLY VALID FOR TAMURA 1987 POTENTIAL)
[10]: ARGUMENT NO. 8 (ONLY VALID FOR TAMURA 1987 POTENTIAL)
[11]: PHASE NUMBER NP, NP*PI/2 IS BE ADDED TO PHASE.
[12]: CARTWRIGHT-TAYLER-EDDEN AMPLITUDE FOR EPOCH 1870.
[13]: CARTWRIGHT-TAYLER-EDDEN AMPLITUDE FOR EPOCH 1960.
[14]: CARTWRIGHT-TAYLER-EDDEN AMPLITUDE FOR EPOCH 1960.
[15]: DOODSON AMPLITUDE REFERRING TO EPOCH 1900.
[16]: TAMURA AMPLITUDE REFERRING TO EPOCH 2000.
[17]: TAMURA TIME DERIVATIVE OF AMPLITUDE PER JULIAN CENTURY.
tide_names: List of Darwin names for the tides.
Return type: (np.array, List[str])
pyol.processing module¶
-
pyol.processing.
calc_displacement
(calc_datetimes: typing.List[datetime.datetime], site: str, model: str) → <built-in function array>[source]¶ Calculates displacement using only the frequencies with a corresponding ocean loading model parameter value.
Parameters: - calc_datetimes – List of date and times at which to calculate the displacement in the datetime format.
- site – Name used for the site. Must correspond to the name used in the file name of the ocean loading file.
- model – Model used to generate the time series. Must correspond to an existing ocean loading file.
Returns: Numpy array with up, north and east component of the ocean loading displacement.
-
pyol.processing.
calc_displacement_interpolated
(calc_datetimes: typing.List[datetime.datetime], site: str, model: str) → <built-in function array>[source]¶ Calculates displacement with interpolation of amplitudes to unmodeled frequencies.
Calculates displacement using all the frequencies in the tamura potential that lies within the range of the frequencies which have defined ocean loading model parameter values. (J.Strandberg)
Parameters: - calc_datetimes – List of date and times at which to calculate the displacement in the datetime format.
- site – Name used for the site. Must correspond to the name used in the file name of the ocean loading file.
- model – Model used to generate the time series. Must correspond to an existing ocean loading file.
Returns: Numpy array with up, north and east component of the ocean loading displacement.
-
pyol.processing.
calc_tamura
(calc_datetime: datetime.datetime, full_out=False) -> (<built-in function array>, <built-in function array>, <built-in function array>, <class ‘list’>)[source]¶ Calculates the tamura phases and amplitudes.
Based on the astros.f file from H.G Schernecks fortran ocean loading implementation as well as the 1987 paper from Tamura.
Parameters: - calc_datetime – Time and date for calculation
- full_out (optional) – if set to true, the degree and order of the tides are output
Returns: phases, frequencies, in degrees/h amplitudes, tide_names, n (optional), m (optional)
Return type: (tuple)
References
Tamura, Yoshiaki. “A harmonic development of the tide-generating potential.” Bull. Inf. Marées Terrestres 99 (1987): 6813-6855.