convCHSpredTide
Overview
convCHSpredTide converts Canadian Hydrographic Service (CHS) predicted hourly tide tablesβor Cape Enrage 5-minute/custom-interval measured tide tables (-enrage_meas)βinto the standard 4-column JHC ASCII tide format (jday hour min elevation_m).
Syntax & CLI Options
convCHSpredTide [OPTIONS] -tide <tidefilename> <outfilename>
| Option | Description | Default |
|---|---|---|
-tide <filename> | Required. Input CHS predicted tide file (or Cape Enrage measured tide file). | None |
<outfilename> | Required. Positional output filename for the converted JHC ASCII tide records. | None |
-jday_start <N> | Starting Julian day offset (jday_start + day_of_month) added to the day number read from the CHS predicted table (use jday_of_first_of_month - 1). | 0 |
-enrage_meas | Parse Cape Enrage measured tide format (year jday hour min dmin followed by 12 centimeter elevation values per record) instead of standard 24-hour CHS tables. | Disabled |
-v | Enable verbose flag. | Disabled |
How It Works
- Standard CHS Predicted Mode (Default):
- Skips the first
18header lines of the CHS predicted tide file. - Reads each daily block starting with the day number (
day), followed by24hourly floating-point tide elevations (elev, in meters). -
Writes 24 lines per day to
<outfilename>(andstdout) formatted as:<jday_start + day> <hour (1..24)> 0 <elev>
- Skips the first
- Cape Enrage Measured Mode (
-enrage_meas):- Reads records containing
year jday hour min dminfollowed by12consecutive elevation readings in centimeters. - Divides each elevation by
100.0to convert centimeters to meters and increments the minute field byi * dmin(i = 0..11), writingjday hour min elev_m.
- Reads records containing
Examples
1. Convert a CHS predicted monthly tide table starting on May 1 (Julian Day 121, so -jday_start 120):
convCHSpredTide -jday_start 120 -tide chs_may_pred.txt may_tide.asc
binTide -year 2002 may_tide.asc may_tide.bin
2. Convert Cape Enrage measured centimeter tide blocks:
convCHSpredTide -enrage_meas -tide enrage_raw.txt enrage_tide.asc