MET Tool: ASCII2NC
MET Tool: ASCII2NCASCII2NC Tool: General
ASCII2NC Functionality
The ASCII2NC tool reformats ASCII point observations into the intermediate NetCDF format that Point-Stat and Ensemble-Stat read. ASCII2NC simply reformats the data and does much less filtering of the observations than PB2NC does. ASCII2NC supports a simple 11-column format, described below, the Little-R format often used in data assimilation, SURFace RADiation (SURFRAD) data, Western Wind and Solar Integration Studay (WWSIS) data, and AErosol RObotic NEtwork (Aeronet) data versions 2 and 3 format. MET version 9.0 added support for passing observations to ASCII2NC using a Python script. Future version of MET may be enhanced to support additional commonly used ASCII point observation formats based on community input.
MET Point Observation Format
The MET point observation format consists of one observation value per line. Each input observation line should consist of the following 11 columns of data:
- Message_Type
- Station_ID
- Valid_Time in YYYYMMDD_HHMMSS format
- Lat in degrees North
- Lon in degrees East
- Elevation in meters above sea level
- Variable_Name for this observation (or GRIB_Code for backward compatibility)
- Level as the pressure level in hPa or accumulation interval in hours
- Height in meters above sea level or above ground level
- QC_String quality control string
- Observation_Value
It is the user's responsibility to get their ASCII point observations into this format.
ASCII2NC Usage
Usage: ascii2nc | ||
ascii_file1 [...] | One or more input ASCII path/filename | |
netcdf_file | Output NetCDF path/filename | |
[-format ASCII_format] | Set to met_point, little_r, surfrad, wwsis, aeronet, aeronetv2, aeronetv3, or python | |
[-config file] | Configuration file to specify how observation data should be summarized | |
[-mask_grid string] | Named grid or a gridded data file for filtering point observations spatially | |
[-mask_poly file] | Polyline masking file for filtering point observations spatially | |
[-mask_sid file|list] | Specific station ID's to be used in an ASCII file or comma-separted list | |
[-log file] | Outputs log messages to the specified file | |
[-v level] | Level of logging | |
[-compress level] | NetCDF compression level |
At a minimum, the input ascii_file and the output netcdf_file must be passed on the command line. ASCII2NC interrogates the data to determine it's format, but the user may explicitly set it using the -format command line option. The -mask_grid, -mask_poly, and -mask_sid options can be used to filter observations spatially.
Run
RunASCII2NC Tool: Run
cd ${METPLUS_TUTORIAL_DIR}/output/met_output/ascii2nc
Since ASCII2NC performs a simple reformatting step, typically no configuration file is needed. However, when processing high-frequency (1 or 3-minute) SURFRAD data, a configuration file may be used to define a time window and summary metric for each station. For example, you might compute the average observation value +/- 15 minutes at the top of each hour for each station. In this example, we will not use a configuration file.
The sample ASCII observations in the MET tarball are still identified by GRIB code rather than the newer variable name option.
For example, 52 corresponds to RH:
${METPLUS_DATA}/met_test/data/sample_obs/ascii/sample_ascii_obs.txt \
tutorial_ascii.nc \
-v 2
ASCII2NC should perform this reformatting step very quickly since the sample file only contains data for 5 stations.
Output
OutputASCII2NC Tool: Output
When ASCII2NC is finished, you may view the output NetCDF file it wrote using the ncdump utility.
The NetCDF header should look nearly identical to the output of the NetCDF output of PB2NC. You can see the list of stations for which we have data by inspecting the hdr_sid_table variable:
This ASCII data only contains observations at a few locations.
tutorial_ascii.nc \
tutorial_ascii.ps \
-data_file ${METPLUS_DATA}/met_test/data/sample_fcst/2007033000/nam.t00z.awip1236.tm00.20070330.grb \
-v 3
Next, we'll use the NetCDF output of PB2NC and ASCII2NC to perform Grid-to-Point verification using the Point-Stat tool.