haw2gnu v3.2.3

Mercurial revision 5770:c90c3015e72d | 2026-05-22


Description

haw2gnu reformats mooring observations from the Hawaii Institute format to the MATROOS standard.


Usage

haw2gnu [OPTIONS] file

Options

Option

Description

-h, --help

Show help and exit.

-start <MM/YYYY>

Start date for extraction (format: MM/YYYY). Observations before this date are ignored.

-end <MM/YYYY>

End date for extraction (format: MM/YYYY). Observations after this date are ignored. Requires -start to be defined.

-d

Duplicate the input file for safety (creates a .duplicated.dat file).

-t

Duplicate the input file with depths multiplied by 1000 (creates a .truncated.dat file).

-f <format>

Output format: obs (default) or matroos.

-o <rootname>

Output rootname (without extension). If not provided, the input filename is used with the appropriate extension (.obs or .slv).


Examples

Basic Conversion to obs Format

Convert a Hawaii Institute file to obs format (default):

haw2gnu input.dat

Output: input.obs


Convert to matroos Format

Convert a Hawaii Institute file to matroos format:

haw2gnu -f matroos input.dat

Output: input.slv


Extract Data for a Specific Period

Extract observations between January 2000 and December 2010:

haw2gnu -start 01/2000 -end 12/2010 input.dat

Duplicate Input File for Safety

Create a backup of the input file while processing:

haw2gnu -d input.dat

Output: input.duplicated.dat (backup) + input.obs (converted file).


Duplicate Input File with Depths ×1000

Create a copy of the input file with depths multiplied by 1000:

haw2gnu -t input.dat

Output: input.truncated.dat (depths ×1000) + input.obs (converted file).


Custom Output Rootname

Specify a custom output filename:

haw2gnu -o output_root input.dat

Output: output_root.obs


Combine Options

Extract data for a specific period, duplicate the input file, and convert to matroos format:

haw2gnu -start 06/2005 -end 06/2015 -d -f matroos -o custom_output input.dat

Output:

  • input.duplicated.dat (backup)

  • custom_output.slv (converted file)


Environment Variables

None.


Notes

  1. Date Format:

  • Dates must be provided in MM/YYYY format (e.g., 01/2000 for January 2000).

  • The -end option requires the -start option to be defined.

  1. Input File:

  • Only one input file can be processed at a time.

  • The input file must be in Hawaii Institute format.

  1. Output Files:

  • If -o is not specified, the output filename is derived from the input filename:

    • .obs extension for obs format (default).

    • .slv extension for matroos format.

  1. Duplication Options:

  • -d creates a backup of the input file with .duplicated.dat extension.

  • -t creates a modified copy of the input file with depths multiplied by 1000 and .truncated.dat extension.

  1. Deprecated Options:

  • -c (time function tests) is deprecated and no longer supported.


See Also