xt2

xt2 is a shorthand program for extracting data to predefined file names. It is designed to work similar to the legacy “xt” program, though it does not replicate the functionality of that program.

xt2 is a wrapper to data.get and data.legacy.cpd1.

Command Line Usage

xt2 [--header] [--short] [--raw] [--clean] 
    [-r] [-e] [-c] <-e|-h|-d|-m|record> [station] <TimeRange>

Extracted data are placed in files in the current directory. Exactly one of the -e, -h, -d, -m, record(s) extraction specifications must be used.

Arguments

-e

Extract clean data in the form of legacy “h_e” records.

-h -d -m

Extract averaged hourly (-h), daily (-d) or monthly (-m) data in the form of a legacy-like “al_X” record, that is the “a_X” and “la_X” records concatenated together. Any data flagged as contaminated are excluded from the averages.

record

Direct record specification. May either be CPD2 style which are extracted from clean data or a CPD1 specification. If the CPD1 specification ends in “e” then clean data are extracted, otherwise raw data are. If the CPD1 name ends in “H” hourly averages are used, “D” daily are, or “M” monthly.

station

The station identifier code. For example 'brw'. Case insensitive. Optional if the station can be inferred from the working directory or environment.

TimeRange

The time to extract data for. It may consist of one to four arguments with interpretation inferred from the structure. The following structures are accepted:

[startYear] startDOY [endYear] endDOY
[startYear] week
ConvertibleStart ConvertibleEnd

If only a week is specified, then exactly one week of data is extracted. In the final case any convertible time format is accepted.

--header -r

Output CPD1 headers if generating CPD1 data.

--short -s

Output short form averaged data.

--raw

Change the default archive to raw for operations that do not imply an archive. This will cause requesting CPD2 records to get the raw records.

--clean -c

Change the default archive to clean for operations that do not imply an archive. This will cause CPD1 records to be generated from clean data.

Example Usage

One minute clean for Jan. 10-14 (inclusive) of the current year

xt2 -e mlo 10 15

Hourly averages for a week

xt2 -h thd 2009 10

Short form averaged CPD1 data with a header

xt -srh thd 2009 10 2009 20

Or:

xt -s -r -h thd 2009 10 2009 20

Multiple CPD1 records with the station guessed

xt2 h_e,lm_ 2009Q1 2009Q2

Multiple CPD2 records

xt2 S11a,A11a 2009 1 10