This component applies conventional averaging to bins defined by part of its input. That is, it averages high resolution data to the times a lower resolution variable or variables exist. Normally it also removes contaminated values from the averages. This can, for example, be used to generate whole filter PSAP/CLAP averages. Note that some types of averaging require inputs beyond the values being averaged. For example, to average raw absorptions, transmittance and path length are required because the average is performed with a difference measurement.

Usage

da.smooth.segment [switches…​] [[station] variables times [archive]|[file]]

Switches

--contamination=STRING

This defines the contamination mode in effect. The contamination mode determines which variables are removed when they are flagged as contaminated. For example the "aerosol" mode generally removes scattering, absorption, extinction and concentrations. The special mode "none" or "disable" turns off all contamination removal and values are averaged regardless of their contaminated state.

Default: aerosol

--continuous[=BOOLEAN]

If this option is set then the averages produced are the maximum continuous averages within the binning interval. This allows difference measurements to be repeatable but may cause splitting within the interval.

Default: Disabled

--cover=NUMBERS

This is the fraction of data required to exist for an average bin to be produced at all. For example if this is set to 0.95 then averages will only be produced when the fraction of missing data in a bin is greater than 95% of the total bin. So, for a one hour bin that would require at least 57 minutes of valid data. Setting this to undefined disables the requirement.

Default: Disabled

--discard-intersecting[=BOOLEAN]

If this option is set then all input data that is not completely contained within an averaging segment is discard and does not contribute to that segment. That is, any value that overlaps the start or end of the segment will not be used.

Default: Disabled; include intersecting data

--gap=INTERVAL

If two values are seperated by this much time then the average is split. Even if there is no gap the values may still be split into separate bins if the interval demands it. An undefined gap allows for infinite separation.

Default: Infinite

Undefined intervals are accepted. The interval must be greater than or equal to zero length.

--output=SELECTION

If this is set then the final output segments are written out as the variable or variables that this defines.

--segment=SELECTION

This defines the data input to create segment averages on. The resulting averages are output for any times that this exists. If there are overlaps they are fragmented into multiple segment averages.

Arguments

If no bare word input specification is supplied then data are read from standard input.

station

This argument is used to specify the station used to look up variables that do not include a station as part of an archive read specification. The station is the three letter GAW station code of the location, such as BND. The argument accepts multiple stations specified as regular expressions and separated by : or ; or ,. For example BND,MLO and (BND|MLO) are two ways of selecting both the BND and MLO stations.

The special value allstations may also be specified to select all stations.

variables

This argument may be split into multiple actual program arguments. Each part consists of one or more variable specifications separated by , (commas). The station and archive used if none are explicitly given are defined in the other arguments or inferred from system defaults. For example simply BsB_S11 selects the blue scattering from the S11 instrument and returns all cut sizes and metadata. If instead ::BsB_S11:pm10 is used then only PM10 scattering is returned. That is, the selection specifies "any" station and archive (the defaults are set in the other arguments) then requires that it has the "PM10" flavor. A specification such as bnd:BsB_S11,thd:BsB_S11 allows for data selection from multiple stations.

This may also be used to select a "record" type alias such as "S11a". In this mode all the variables defined in the alias are returned.

Finally the special value everything can be used to select all available data for the given station(s) and archive(s).

times

This argument may be split into multiple actual program arguments. This full list of time arguments defines a time bounds list that sets the range of data queried. The final resulting data are clipped to the given time bounds but any values that intersect them are returned.

archive

This argument is used to specify the archive used to look up variables that do not include an archive as part of an archive read specification. The archive is the internal name, such as raw or clean_meta. The argument accepts multiple archives specified as regular expressions and separated by : or ; or ,. For example raw(_meta)? selects both the raw and raw_meta archives.

The special value allarchives may also be used to select all available archives.

file

This argument is used to specify the the file to read data from. If it is present and exists then data is read from the given file name instead of from standard input. Alternatively - (a single dash) may be used to explicitly specify standard input.

Examples

Default zero averages

This will average all data available during the neph zero. It will also remove contamination from the standard set of variables involved in an aerosol system (generally scattering, absorption, extinction and concentrations).

da.smooth.segment --segment=bnd:raw:ZZero_S11 bnd S11a 2015-05-01 2015-05-03

Or:

da.smooth.segment --segment=bnd:raw:ZZero_S11 input_file.c3d

Or:

da.get bnd S11a 2015-05-01 2015-05-03 | da.smooth.segment --segment=bnd:raw:ZZero_S11
Mode and coverage requirement

This will average data to whenever the neph has changed operating modes while requiring at least 95% of data within each segment to exist. Contaminated data is not excluded from the averages.

da.smooth.segment --contamination=none --cover=0.95 --segment=bnd:raw:F2_S11 bnd S11a 2015-05-01 2015-05-03