Class cwinfo
The information utility dumps earth data information in a display-friendly format.
Name
cwinfo - prints earth data file information.
Synopsis
cwinfo [OPTIONS] input
Options:
-h, --help
-t, --transform
-c, --coord
-e, --edge
-l, --locFormat=TYPE
-v, --verbose
--version
Description
The information utility dumps earth data information in a display-friendly format. The global earth information is printed such as satellite name, sensor, date, and earth transform information. The name of each variable is printed along with its data type, dimensions, scaling factor, and so on. For more detailed printing of generic HDF file contents, use the HDF hdp command.
When the --transform option is used, various additional earth transform information is printed. Let nc and nr be the x and y coordinate dimensions respectively, and mc=(nc-1)/2, mr=(nr-1)/2 be the midpoint coordinates. Note that indexing is zero-based and coordinates refer to the pixel center. Then the following information is computed:
- Pixel width at (mc,mr)
- Pixel height at (mc,mr)
- Total width from (0,mr) to (nc-1,mr)
- Total height from (mc,0) to (mc,nr-1)
- Center lat/lon at (mc,mr)
- Upper-left lat/lon at (0,0)
- Upper-right lat/lon at (nc-1,0)
- Lower-left lat/lon at (0,nr-1)
- Lower-right lat/lon at (nc-1,nr-1)
When the --coord option is used, Common Data Model coordinate systems are printed if available. Generally this style of coordinate system information is only available for files read by the NetCDF Java library.
Parameters
Main parameters:
- input
- The input data file name.
Options:
- -h, --help
- Prints a brief help message.
- -t, --transform
- Specifies that additional earth transform information should also be printed. The default is to show only global and variable information.
- -c, --coord
- Specifies that Common Data Model coordinate system information should also be printed. The default is to show only global and variable information.
- -e, --edge
- Specifies that transform information should print the coordinates of the extreme edges of the corner pixels. The default is to print the coordinates of the center of corner pixels.
- -l, --locFormat=TYPE
- Specifies the format style for geographic coordinates printed by the
--transform option. Valid values are:
- D - Integer degrees, eg: '124 W'.
- DD - 2-digit degrees, eg: '124.36 W'.
- DDDD - 4-digit degrees, eg: '124.3600 W'.
- DDMM - Degrees, minutes, eg: '124 21.60 W'.
- DDMMSS - Degrees, minutes, seconds, eg: '124 21 36.00 W'.
- RAW - Decimal degrees up to the full 64-bit precision, eg: '-124.36003592404', in the range [-90,90] for latitude and [-180,180] for longitude.
- -v, --verbose
- Turns verbose mode on. The current status of automatic file identification is printed. This output is useful when trying to understand why a certain file is not being recognized by this and other tools. 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 file name
- Unsupported input file format
Examples
The following shows an information dump of a CoastWatch HDF file:
phollema$ cwinfo --transform 2019_320_0511_m01_wj.hdf Contents of file 2019_320_0511_m01_wj.hdf Global information: Satellite: metop-1 Sensor: avhrr Date: 2019/11/16 JD 320 Time: 05:11:42 UTC Scene time: night Projection type: mapped Transform ident: noaa.coastwatch.util.trans.MercatorProjection Map projection: Mercator Map affine: 0 -1470 1470 0 -13397799.15 3887086.51 Spheroid: WGS 84 Origin: USDOC/NOAA/NESDIS CoastWatch Format: CoastWatch HDF version 3.4 Reader ident: noaa.coastwatch.io.CWHDFReader Variable information: Variable Type Dimensions Units Scale Offset avhrr_ch3 short 1024x1024 celsius 0.01 0 avhrr_ch4 short 1024x1024 celsius 0.01 0 avhrr_ch5 short 1024x1024 celsius 0.01 0 cloud ubyte 1024x1024 - 1 0 graphics ubyte 1024x1024 - 1 0 sat_zenith short 1024x1024 degrees 0.01 0 sst short 1024x1024 celsius 0.01 0 Earth location information: Pixel width: 1.3054 km Pixel height: 1.3123 km Total width: 1334.7650 km Total height: 1340.7132 km Center: 27.2500 N, 113.6000 W Upper-left (pixel center): 33.1139 N, 120.3545 W Upper-right (pixel center): 33.1139 N, 106.8455 W Lower-left (pixel center): 21.0565 N, 120.3545 W Lower-right (pixel center): 21.0565 N, 106.8455 W
- Since:
- 3.1.0
- Author:
- Mark Robinson
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Performs the main function.static void
printSummary
(EarthDataReader reader, PrintStream stream, boolean transform) Prints earth transform data from the specified file.static void
printSummary
(EarthDataReader reader, PrintStream stream, boolean useEdges, int locFormat, boolean transform, boolean coord) Prints earth transform data from the specified file.
-
Method Details
-
main
Performs the main function.- Parameters:
argv
- the list of command line parameters.- Throws:
IOException
-
printSummary
Prints earth transform data from the specified file.- Parameters:
reader
- the reader object to use.stream
- the output stream for printing.transform
- the transform flag, true to print detailed earth location data. The earth transform data includes pixel resolution, total width and height, and latitude and longitude data for selected locations.
-
printSummary
public static void printSummary(EarthDataReader reader, PrintStream stream, boolean useEdges, int locFormat, boolean transform, boolean coord) Prints earth transform data from the specified file.- Parameters:
reader
- the reader object to use.stream
- the output stream for printing.useEdges
- true to use actual edges for location values, false to use center of edge pixels.locFormat
- the Earth location format code, seeEarthLocation.format(int)
.transform
- the transform flag, true to print detailed earth location data. The earth transform data includes pixel resolution, total width and height, and latitude and longitude data for selected locations.coord
- the coord flag, true to print detailed coordinate system data.
-