switchTide
Overview
switchTide converts 7-column predicted tide ASCII files (dum1 hour min dum2 day month rtide) into either the standard 4-column JHC ASCII tide format (jday hour min rtide) or COWLIS-formatted ASCII strings (94/month/day hour:min:00 rtide 0.030 when -cowlis is specified).
Syntax & CLI Options
switchTide [OPTIONS] <infilename> <outfilename>
| Option | Description | Default |
|---|---|---|
<infilename> | Required. Input 7-column predicted tide ASCII file. | None |
<outfilename> | Required. Output JHC ASCII (or COWLIS ASCII) tide file. | None |
-cowlis | Write output in COWLIS format (94/MM/DD HH:MM:00 tide 0.030) instead of jday hour min tide. | Disabled (JHC ASCII) |
-verbose | Print converted jday hour min rtide records to stdout. | Disabled |
How It Works
-
Reads 7 whitespace-separated fields from
<infilename>:fscanf(floatfile, "%d%d%d%d%d%d%f", &dum1, &hour, &min, &dum2, &day, &month, &rtide) - Default Mode: Converts
(month, day)into cumulative day of year (1..365) and writesday hour min rtideto<outfilename>. -cowlisMode: Preservesmonthanddayand writes94/<month>/<day> <hour>:<min>:00 <rtide> 0.030so the file can be processed by tools expecting COWLIS input (such asconvTide).
Examples
1. Convert a 7-column predicted tide file to JHC ASCII:
switchTide pred_tide.txt jhc_tide.asc
binTide -year 1994 jhc_tide.asc jhc_tide.bin
2. Convert to COWLIS format:
switchTide -cowlis pred_tide.txt cowlis_tide.txt