autom8qc.measures

autom8qc.measures.actris

This module provides measures that will be used in ACTRIS. ACTRIS is the pan-European research infrastructure producing high-quality data and information on short-lived atmospheric constituents and on the processes leading to the variability of these constituents in natural and controlled atmospheres.

class autom8qc.measures.actris.ACTRISHierarchyMeasure(flags=None)

Creates a flag consistent with ACTRIS standards, which combines the 3 worst flags. The flags can be passed to the constructor. If no flags are given, the standard flags will be used. The given list has to be ordered by susceptibility to errors (first element = worst flag).

Parameters
  • NAME (string) – Name of the test

  • DESCRIPTION (string) – Description of the test

  • parameters (ParameterList) – Supported parameters

  • DEFAULT_FLAGS (List(string)) – [“999”,”670”,”699”,”684”,”664”,”459”,”635”,”000”]

Supported parameters:
  • flags (list): Flags that should be used (default: DEFAULT_FLAGS)

apply(component)

Apply the measure to the given component and returns the results.

Raises

InvalidType – If component has the wrong type

Parameters

component (TestGroup or TestSequence) – Test group or test sequence

Returns

Results

Return type

pd.Series

static supported_parameters()

Returns the supported parameters.

Returns

Supported parameters

Return type

ParameterList

autom8qc.measures.base

This module provides the abstract base class BaseMeasure for measures. Each measure has to inherit from the base class and has to implement the abstract method apply. If you use a group or a sequence with several tests, each test will return its probabilities or mapped values. To combine them to a total result, you have to use a measure. An example of a measure is the weighted mean of the probabilities.

See also

class autom8qc.measures.base.BaseMeasure

Abstract base class that defines the interface for measures. Each measure has to provide its information (NAME, DESCRIPTION) and has to implement the abstract method apply. If you use a group or a sequence with several tests, each test will return its probabilities or mapped values. To combine them to a total result, you have to use a measure. An example of a measure is the weighted mean of the probabilities.

See also

Warning

If you inherit from this class, make sure that you call the super constructor and implement the abstract method apply.

Parameters
  • NAME (str) – Name of the test

  • DESCRIPTION (str) – Description of the test

  • parameters (ParameterList) – Supported parameters (default: None)

abstract apply(component)

Apply the measure to the given component and returns the results.

Warning

Make sure that you don’t override data points of the data. For effiency reasons the data won’t be copied.

Raises

InvalidType – If component has the wrong type

Parameters

component (TestGroup or TestSequence) – Test group or test sequence

Returns

Results

Return type

pd.Series

get_results(component)

Returns the data of the component.

Raises

InvalidType – If component has the wrong type

Parameters

component (TestGroup or TestSequence) – Test group or test sequence

Returns

Results of the component

Return type

pd.DataFrame

autom8qc.measures.logical

This module provides measures for logical results (True, False) of a test group.

class autom8qc.measures.logical.ANDMeasure

Applies the logical AND to the results of a test group.

Parameters
  • NAME (str) – Name of the measure

  • DESCRIPTION (str) – Description of the measure

  • parameters (ParameterList) – Supported parameters (default: None)

apply(component)

Apply the measure to the given component and returns the results.

Raises

InvalidType – If component has the wrong type

Parameters

component (TestGroup or TestSequence) – Test group or test sequence

Returns

Results

Return type

pd.Series

class autom8qc.measures.logical.ORMeasure(force_nan=True)

Applies the logical OR to the results of a test group.

Parameters
  • NAME (str) – Name of the measure

  • DESCRIPTION (str) – Description of the measure

  • parameters (ParameterList) – Supported parameters (default: None)

Supported parameters:
  • force_nan (bool): If the parameter is True, the result of the measure will be set to NaN if one of the values is NaN. If the parameter is False, the measure treats NaN values as False (default:True)

apply(component)

Apply the measure to the given component and returns the results.

Raises

InvalidType – If component has the wrong type

Parameters

component (TestGroup or TestSequence) – Test group or test sequence

Returns

Results

Return type

pd.Series

static supported_parameters()

Returns the supported parameters of the test.

Returns

Supported parameters

Return type

ParameterList

autom8qc.measures.probabilities

This module provides measures for probabilistic test groups.

class autom8qc.measures.probabilities.MeanMeasure

Calculates the weighted mean of the test group or the test sequence.

Parameters
  • NAME (str) – Name of the measure

  • DESCRIPTION (str) – Description of the measure

  • parameters (ParameterList) – Supported parameters (default: None)

apply(component)

Apply the measure to the given component and returns the results.

Raises

InvalidType – If component has the wrong type

Parameters

component (TestGroup or TestSequence) – Test group or test sequence

Returns

Results

Return type

pd.Series

class autom8qc.measures.probabilities.WorstProbabilityMeasure(force_nan=False)

Takes the worst probability for each data point.

Parameters
  • NAME (str) – Name of the measure

  • DESCRIPTION (str) – Description of the measure

  • parameters (ParameterList) – Supported parameters (default: None)

apply(component)

Apply the measure to the given component and returns the results.

Raises

InvalidType – If component has the wrong type

Parameters

component (TestGroup or TestSequence) – Test group or test sequence

Returns

Results

Return type

pd.Series

static supported_parameters()

Returns the supported parameters of the test.

Returns

Supported parameters

Return type

ParameterList

autom8qc.measures.validities

This module provides measures for validities test groups.

class autom8qc.measures.validities.WorstMeasure(missing_validity=None)

Takes the worst validity of the results.

Parameters
  • NAME (str) – Name of the measure

  • DESCRIPTION (str) – Description of the measure

  • parameters (ParameterList) – Supported parameters (default: None)

Supported parameters:
  • missing_validity (Validity): Validitiy for missing values (optional). If the validity will not be passed to the constructor, the StandardValidities will be used.

apply(component)

Apply the measure to the given component and returns the results.

Raises

InvalidType – If component has the wrong type

Parameters

component (TestGroup or TestSequence) – Test group or test sequence

Returns

Results

Return type

pd.Series

static supported_parameters()

Returns the supported parameters of the test.

Returns

Supported parameters

Return type

ParameterList