data.segmentation.avg

data.segmentation.avg can serves as the counterpart to data.avg that works on intervals defined by segments instead of fixed times. Like data.avg it rectangularizes its input. In addition to the time data.segmentation.avg may also generate names for the segments, see below.

Command Line Usage

data.segmetnation.avg [--stddev=on/off | --nostddev] 
                      [--count=on/off] [--source=archive]
                      [--contam] [--name=(Segment1)..(Segement2)]
                      segment station records start end

Arguments

start and end

The time specifiers for the data to be retrieved. Start is inclusive while end is exclusive, so all segments contained within the half open interval [start,end) will be returned. Any convertible time format is accepted. Note that only data within the start and end range is averaged even if there are segments in that range that extends beyond them.

station

The station identifier code. For example 'brw'. Case insensitive.

records

The cpd2 record type to be retrieved. For example: 'S11a'. Case sensitive. Multiple record types may be separated by ”,”, ”;” or ”:”.

segment

The segment type to split based on.

--stddev=on/off --nostddev

Enable or disable (default enabled) standard deviation calculation for each field. A separate field for each field is generated that contains the standard deviation for that record.

--count=on/off

Enable or disable (default disable) generating a count field for each variable (after cut splitting). The count field is the variable name with an “N” added to the end.

--source=archive

Selected the source archive to request data from, defaulting to clean. Has no effect when working on standard input.

--contam

Enable averaging of contaminated data.

--name=(Segment1)..(Segement2

Set the value for the NAME variable. Anything between parenthesis is interpreted as follows:

Contents Result
'(' or ')' The literal value is inserted.
YEAR The starting year.
DOY The starting DOY.
Name The data value for the segment 'Name' at this time.
DAY:Name The sequence number for segment 'Name' as a character (A-Z).

So to construct a name field like flight segment ID (YYYY_DOY_X_SITE_SEG) the switch would be:

--name=(YEAR)_(DOY)_(DAY:flight)_(site)_(leg)

If omitted the records will not contain a name variable.

Example Usage

Average all flights on a given day

data.segmentation.avg --name=(YEAR)_(DOY)_(DAY:flight)_(site)_(leg) flight aao S11a 2008:10 2008:11

Average a single flight

data.segmentation.avg --name=(YEAR)_(DOY)_(DAY:flight)_(site)_(leg) flight aao S11a `data.flight aao 201`

Filling data from a pipe to a file

data.get sgp A11a 2008 2009 raw | data.avg --fill > 2008_hourly