metobs_toolkit.station.Station.get_qc_stats#

Station.get_qc_stats(target_obstype: str = 'temp', make_plot: bool = True) DataFrame[source]#

Generate quality control (QC) frequency statistics.

This method calculates the frequency statistics for various QC checks applied, and other labels. The order of checks is taken into account.

Frequency of labels is computed based on the set of all labels (for all records including gaps). The effectiveness of a check is shown by the frequency of outliers with respect to the number of records that were given to the check (thus taking into account the order of checks).

The frequencies are returned in a dataframe, and can be plotted as pie charts.

Parameters:
  • target_obstype (str, optional) – The target observation type for which to compute frequency statistics, by default “temp”.

  • make_plot (bool, optional) – If True, a figure with pie charts representing the frequencies is generated. The default is True.

Returns:

A DataFrame containing the QC frequency statistics. The DataFrame has a multi-index with the station name and QC check label, and includes the following columns:

  • N_all: Total number of records in the dataset (including gaps).

  • N_labeled: Number of records with the specific label.

  • N_checked: Number of records checked for the specific QC check.

Return type:

pandas.DataFrame