Class cwimport

java.lang.Object
noaa.coastwatch.tools.cwimport

public final class cwimport extends Object

The import tool translates earth data into CoastWatch HDF format.

Name

cwimport - translates earth data into CoastWatch HDF.

Synopsis

cwimport [OPTIONS] input1 [input2 ...] output

Options:

-c, --copy
-g, --nogroup
-h, --help
-m, --match=PATTERN
-v, --verbose
--version

Description

The import tool translates earth data into CoastWatch HDF format. Multiple input files may be specified, but must have matching earth transforms and dates. The utility loops over all input files and creates a single CoastWatch HDF output file. The utility does not handle multiple variables with the same name — if a variable in an input file is encountered with the same name as an existing variable from a previous input file, the new variable is skipped. Options are available to alter verbosity and variable name matching.

Parameters

Main parameters:

input1 [input2 ...]
The input data file name(s). At least one input file is required. If multiple files are specified, they must have matching dates and earth transforms. The currently supported input formats are CoastWatch HDF, NetCDF 3/4 with CF metadata, TeraScan HDF, and NOAA 1b format GAC/LAC/HRPT AVHRR.
output
The output data file name.

Options:

-c, --copy
Turns on copy mode. In copy mode, variables from the input files are copied into an existing output file. The default is to create a new output file and populate it with data. Copy mode is especially useful for copying variables from one CoastWatch HDF file to another.
-g, --nogroup
Turns on removal of the group path in variable names. If variable names contain a leading group path ending with '/', the group path is removed.
-h, --help
Prints a brief help message.
-m, --match=PATTERN
The variable name matching pattern. If specified, the pattern is used as a regular expression to match variable names. Only variables matching the pattern will be imported. By default, no pattern matching is performed and all variables are imported.
-v, --verbose
Turns verbose mode on. The current status of data conversion is printed periodically. The default is to run quietly.
--version
Prints the software version.

Exit status

0 on success, > 0 on failure. Possible causes of errors:

  • Invalid command line option
  • Invalid input or output file names
  • Unsupported input file format
  • Input file dates or earth transforms do not match

Examples

The following shows the import of a NetCDF file to CoastWatch HDF with verbose mode on:

   phollema$ cwimport --verbose --match analysed_sst 
     20220621-GHRSST-Blended-v02.0-fv01.0.nc 2022_06_21_night_sst.hdf
   [INFO] Reading input 20220621-GHRSST-Blended-v02.0-fv01.0.nc
   [INFO] Creating output 2022_06_21_night_sst.hdf
   [INFO] Reading file [1/1], 20220621-GHRSST-Blended-v02.0-fv01.0.nc
   [INFO] Writing analysed_sst
 
Since:
3.1.0
Author:
Peter Hollemans
  • Method Details

    • main

      public static void main(String[] argv)
      Performs the main function.
      Parameters:
      argv - the list of command line parameters.