mgr-predictor v3.2.3¶
Mercurial revision 5770:c90c3015e72d | 2026-05-22
Description¶
mgr-predictor predicts tides from a given mgr (tidal constituents) file, which contains tidal wave amplitudes and phase lags for one or multiple stations. The input file can be in ASCII or NetCDF format.
If start and end dates are provided, the tool:
Predicts tides for the specified period.
Optionally computes spring/neap tide times (if
--extremais enabled).
Usage¶
mgr-predictor -m input_mgr_file -s start_date -f end_date -i time_incrementUNITS -w wave1 [wave2 ...] [OPTIONS] [station1 station2 ...]
Options¶
Option |
Description |
|---|---|
|
Display help and exit. |
|
Path to the input mgr file (contains tidal wave amplitudes and phase lags). |
|
Start date for predictions. See Date Formats. |
|
End date for predictions. See Date Formats. |
|
Time increment for predictions. No space between value and unit (e.g., |
|
List of tidal waves to predict. |
|
Disable nodal corrections. |
|
Not fully functional. Enable computation of extrema and spring/neap tide times. |
|
Not used. Path to the ASCII output file. Default: |
|
Specify the format of the input mgr file (e.g., |
|
Specify a time template for output (e.g., |
|
Enable currents mode. |
|
Specify a modulator string for advanced predictions (e.g., for discharge or regression-based adjustments). |
Date Formats¶
Supported formats:
yyyy/mm/dd HH:MM:SS.SSSdd/mm/yyyy HH:MM:SS.SSSmm/yyyy
Notes:
The least significant parts (seconds, minutes, hours, days, months) are optional.
The separator can be any non-numeric character (e.g.,
/,-, `` ).End dates are inclusive. Examples:
2000→2001/01/01 00:00:00
2000/01→2000/02/01 00:00:00
2000/01/01→2000/01/02 00:00:00
2000/01/01 00→2000/01/01 01:00:00
2000/01/01 00:00→2000/01/01 00:01:00
Examples¶
Basic Prediction¶
Predict tides for waves M2 and S2 from 2020/01/01 to 2020/01/10 with a 1-hour increment:
mgr-predictor -m input.mgr -s 2020/01/01 -f 2020/01/10 -i3600s -w M2 S2
Prediction for Specific Stations¶
Predict tides for stations station1 and station2:
mgr-predictor -m input.mgr -s 2020/01/01 -f 2020/01/10 -i3600s -w M2 S2 station1 station2
Custom Time Increment¶
Predict tides with a 30-minute increment:
mgr-predictor -m input.mgr -s 2020/01/01 -f 2020/01/10 -i1800s -w M2 S2
Disable Nodal Corrections¶
Predict tides without nodal corrections:
mgr-predictor -m input.mgr -s 2020/01/01 -f 2020/01/10 -i3600s --nodal=no -w M2 S2
Enable Spring/Neap Tide Computation¶
Predict tides and compute spring/neap tide times:
mgr-predictor -m input.mgr -s 2020/01/01 -f 2020/01/10 -i3600s --extrema -w M2 S2
Specify Input File Format¶
Predict tides using a specific mgr file format:
mgr-predictor -m input.mgr --format LEGOS_ASCII -s 2020/01/01 -f 2020/01/10 -i3600s -w M2 S2
Use a Modulator for Advanced Predictions¶
Predict tides with a modulator (e.g., for discharge adjustments):
mgr-predictor -m input.mgr -s 2020/01/01 -f 2020/01/10 -i3600s \
--modulator "dischargeFile=/path/to/discharge.gnu target=0 method=exponential Q0=200" \
-w M2 S2
Enable Currents Mode¶
Predict tides in currents mode:
mgr-predictor -m input.mgr -s 2020/01/01 -f 2020/01/10 -i3600s --currents -w M2 S2
Environment Variables¶
mgr-predictor does not explicitly rely on environment variables for its core functionality. However, if used in a parallelized environment (e.g., with OpenMP), you may need to configure:
Variable |
Description |
|---|---|
|
Number of threads for parallel processing. |
Notes¶
Input File Requirements:
The input mgr file must contain tidal wave amplitudes and phase lags for the specified stations.
Supported formats: ASCII (default:
LEGOS_ASCII) or NetCDF.
Date Handling:
Both start (
-s) and end (-f) dates must be provided for predictions.If no time increment (
-i) is specified, the default is 3600 seconds (1 hour).
Stations:
If no stations are specified, predictions are computed for all stations in the input file.
To predict for specific stations, list them as arguments after the options.
Output:
By default, predictions are saved to
predictions.dat(ASCII format).The
--timeoption allows customizing the time template for output files (e.g.,CNES).
Spring/Neap Tide Computation:
The
--extremaoption is not fully functional but is intended to compute spring/neap tide times.
Modulator:
The
--modulatoroption allows for advanced predictions, such as adjusting for river discharge or other external factors.