wlvTide
Overview
wlvTide converts .wlv water level ASCII files (such as Caris / CHS .wlv files with a 24-line header) and UTC XTide text outputs (-UTC) into the 4-column JHC ASCII tide format (jday hour min tide).
Syntax & CLI Options
wlvTide [OPTIONS] -in <tidefilename> -out <mytideformatname>
| Option | Description | Default |
|---|---|---|
-in <filename> | Required. Input .wlv or XTide UTC ASCII file. | None |
-out <filename> | Required. Output 4-column JHC ASCII tide file (jday hour min tide). | None |
-skip <N> | Number of header lines to skip at the beginning of the input file. | 24 |
-MDY | Parse date strings as MM/DD/YYYY instead of the default YYYY/MM/DD. | YMD (YYYY/MM/DD) |
-UTC | Expect an extra timezone token (UTC) between the time string and the tide value (date time TZ tide, as produced by XTide in 24-hour UTC mode). | Disabled (date time tide) |
-v | Print parsed year, month, day, hour, minute, and tide height for each line. | Disabled |
How It Works
- Header Skipping: Reads and skips the first
skiplines (default24). - Line Parsing:
- Default mode:
sscanf(linestring, "%s %s %f", datestring, timestring, &tide) -UTCmode:sscanf(linestring, "%s %s %s %f", datestring, timestring, am_pm, &tide)
- Default mode:
- Date & Time Extraction:
- In default
YMDmode, extractsyearfromdatestring[0..3],monthfromdatestring[5..6], anddayfromdatestring[8..9]. - In
-MDYmode, extractsmonthfromdatestring[0..1],dayfromdatestring[3..4], andyearfromdatestring[6..9]. - Extracts
hour(timestring[0..1]) andmin(timestring[3..4]).
- In default
- Julian Day Calculation: Computes
jdayviastdtime_dmy_to_jul_day(day, month, year)and writesjday hour min tideto-out.
Examples
1. Convert a standard .wlv file (24-line header, YYYY/MM/DD):
wlvTide -in station_001.wlv -out station_001.asc
binTide -year 2007 station_001.asc station_001.bin
2. Convert a 24-hour UTC XTide listing with MM/DD/YYYY dates and 4 header lines:
wlvTide -skip 4 -UTC -MDY -in xtide_utc.txt -out xtide_utc.asc