This component calculates the derived parameters for a PurpleAir instrument. It takes the raw concentration intensities and produces a combined output intensity as well as a scattering from the combined intensity.
Usage
da.calc.purpleair [switches…] [[station] variables times [archive]|[file]]
Switches
- --efficiency=COEFFICIENTS…
-
This is the calibration applied to the combined intensity to generate the output light scattering value.
Default: Intensity/55
- --input-a=INPUT
-
This is the count reading from detector A.
Default: All available detectors
- --input-b=INPUT
-
This is the count reading from detector B.
Default: All available detectors
- --instruments=SUFFIX…
-
These are the instrument suffixes to calculate combined outputs for. This option is mutually exclusive with manual variable specification.
Default: All scattering instrument suffixes
- --output-intensity=SELECTION
-
This is the output for the combined intensity created from the weighted average of the input detector readings.
Default: Calculated from input intensities
- --output-scattering=SELECTION
-
This is the output for the combined scattering created by applying the scattering efficiency to the combined detector reading.
Default: Calculated from input intensities
- --wavelength=NUMBERS
-
This is the wavelength set in the metadata for the output light scattering.
Default: 550 nm
- --weight-a=INPUT
-
This is the relative weight applied to the intensity reading from detector A. The combined intensity is generated by applying the relative weights to the input intensities and normalizing by the total weight.
Default: 1.0 unless set in metadata
- --weight-b=INPUT
-
This is the relative weight applied to the intensity reading from detector B. The combined intensity is generated by applying the relative weights to the input intensities and normalizing by the total weight.
Default: 1.0 unless set in metadata
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 exampleBND,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 simplyBsB_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 asbnd: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
orclean_meta
. The argument accepts multiple archives specified as regular expressions and separated by:
or;
or,
. For exampleraw(_meta)?
selects both theraw
andraw_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
- Defaults
-
This will calculate combined intensities and scatterings for all PurpleAir intensity inputs. For example, it will calculate Ip_S81 and Bs_S81 from Ipa_S81 and Ipb_S81. The weights used to combine the intensities are read from the metadata or assumed to be 1.0 if not included in the metadata.
da.calc.purpleair bnd S11a 2015-05-01 2015-05-03
Or:
da.calc.purpleair input_file.c3d
Or:
da.get bnd S11a 2015-05-01 2015-05-03 | da.calc.purpleair
- Single instrument ignoring detector A
-
This will calculate the outputs, using only detector B for the measured intensities.
da.calc.purpleair --instruments=S91 --weight-a=0 bnd S11a 2015-05-01 2015-05-03
- Single variable
-
This will calculate BsG_S81 and Ip_S81 from Ipa_S82 and Ipa_S81 using the default weights.
da.calc.purpleair --input-a=bnd:raw:Ipa_S82 --output-scattering=bnd:raw:BsG_S81 bnd S11a 2015-05-01 2015-05-03