libdsproc3  2.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Internal: Dataset QC

Functions

int dsproc_exclude_from_standard_qc_checks (const char *var_name)
 Exclude a variable from the standard QC checks.
int dsproc_qc_delta_checks (CDSVar *var, CDSVar *qc_var, CDSVar *prev_var, CDSVar *prev_qc_var, int delta_flag, int bad_flags)
 Perform QC delta checks.
int dsproc_qc_limit_checks (CDSVar *var, CDSVar *qc_var, int missing_flag, int min_flag, int max_flag)
 Perform QC limit checks.
int dsproc_qc_time_checks (CDSVar *time_var, CDSVar *qc_time_var, timeval_t *prev_timeval, int lteq_zero_flag, int min_delta_flag, int max_delta_flag)
 Perform QC time checks.
int dsproc_standard_qc_checks (int ds_id, CDSGroup *dataset)
 Perform all standard QC checks.
int dsproc_solar_position_qc_check (CDSGroup *dataset, int solar_flag)
 Performs the solar position qc checks for appropriate variables.
int dsproc_qc_solar_position (CDSVar *qc_var, int solar_flag)
 Perform QC solar position check on the wc variable.

Detailed Description


Function Documentation

int dsproc_exclude_from_standard_qc_checks ( const char *  var_name)

Exclude a variable from the standard QC checks.

If an error occurs in this function it will be appended to the log and error mail messages, and the process status will be set appropriately.

Parameters:
var_name- the name of the variable to exclude
Returns:
  • 1 if successful
  • 0 if a memory allocation error occurred

Definition at line 210 of file dsproc_standard_qc.c.

int dsproc_qc_delta_checks ( CDSVar var,
CDSVar qc_var,
CDSVar prev_var,
CDSVar prev_qc_var,
int  delta_flag,
int  bad_flags 
)

Perform QC delta checks.

This function uses the following variable attribute to determine the delta limits:

  • valid_delta

If an error occurs in this function it will be appended to the log and error mail messages, and the process status will be set appropriately.

Parameters:
var- pointer to the variable
qc_var- pointer to the QC variable
prev_var- pointer to the variable from the previous dataset if delta checks need to be done on the first sample, or NULL to skip the delta checks on the first sample.
prev_qc_var- pointer to the QC variable from the previous dataset if delta checks need to be done on the first sample, or NULL to skip the delta checks on the first sample.
delta_flag- QC flag to use for failed delta checks.
bad_flags- QC flags used to determine bad or missing values that should not be used for delta checks.
Returns:
  • 1 if successful
  • 0 if an error occurred

Definition at line 760 of file dsproc_standard_qc.c.

int dsproc_qc_limit_checks ( CDSVar var,
CDSVar qc_var,
int  missing_flag,
int  min_flag,
int  max_flag 
)

Perform QC limit checks.

This function uses the following variable attributes to determine the missing_value, and min, max limits:

  • missing_value, or _FillValue, or default NetCDF fill value
  • valid_min
  • valid_max

If an error occurs in this function it will be appended to the log and error mail messages, and the process status will be set appropriately.

Parameters:
var- pointer to the variable
qc_var- pointer to the QC variable
missing_flag- QC flag to use for missing values
min_flag- QC flag to use for values below the minimum
max_flag- QC flag to use for values above the maximum
Returns:
  • 1 if successful
  • 0 if an error occurred

Definition at line 991 of file dsproc_standard_qc.c.

int dsproc_qc_solar_position ( CDSVar qc_var,
int  solar_flag 
)

Perform QC solar position check on the wc variable.

This function uses the following variable attributes to determine whether the solar position is within the defined bounds.

  • solar_azimuth_bounds
  • solar_elevation_bounds

If an error occurs in this function it will be appended to the log and error mail messages, and the process status will be set appropriately.

Parameters:
qc_var- pointer to the QC variable
solar_flag- QC flag to use for solar position
Returns:
  • 1 if successful
  • 0 if an error occurred

Definition at line 1339 of file dsproc_standard_qc.c.

int dsproc_qc_time_checks ( CDSVar time_var,
CDSVar qc_time_var,
timeval_t prev_timeval,
int  lteq_zero_flag,
int  min_delta_flag,
int  max_delta_flag 
)

Perform QC time checks.

This function uses the following time variable attributes to determine the lower and upper delta time limits:

  • delta_t_lower_limit
  • delta_t_upper_limit

If an error occurs in this function it will be appended to the log and error mail messages, and the process status will be set appropriately.

Parameters:
time_var- pointer to the time variable
qc_time_var- pointer to the qc_time variable
prev_timeval- the timeval of the previous sample in seconds since 1970-1-1 00:00:00, or NULL to skip the checks for the first sample time.
lteq_zero_flag- QC flag to use for time deltas <= zero
min_delta_flag- QC flag to use for time deltas below the minimum
max_delta_flag- QC flag to use for time deltas above the maximum
Returns:
  • 1 if successful
  • 0 if an error occurred

Definition at line 1194 of file dsproc_standard_qc.c.

int dsproc_solar_position_qc_check ( CDSGroup dataset,
int  solar_flag 
)

Performs the solar position qc checks for appropriate variables.

If the solar_flag is set to 0, the function will search the qc variable or global attributes for the qc bit description used for solar position and flag the qc variable with that bit.

The bit description must be:

"Solar position is within bound region determined by solar_azimuth_bounds and solar_elevation_bounds resulting in a data quality issue."

If an error occurs in this function it will be appended to the log and error mail messages, and the process status will be set appropriately.

Parameters:
dataset- pointer to the dataset
solar_flag- qc bit to flag the shaded regions
Returns:
  • 1 if successful
  • 0 if an error occurred

Definition at line 556 of file dsproc_standard_qc.c.

int dsproc_standard_qc_checks ( int  ds_id,
CDSGroup dataset 
)

Perform all standard QC checks.

If a qc_time variable is found in the dataset, this function will use the following time variable attributes to determine the lower and upper delta time limits, and if the previously store sample time should be used for the delta check on the first sample:

  • delta_t_lower_limit
  • delta_t_upper_limit
  • prior_sample_flag

The QC variable bit values used by these checks are:

  • bit 1 = "Delta time between current and previous samples is zero."
  • bit 2 = "Delta time between current and previous samples is less than the delta_t_lower_limit field attribute."
  • bit 3 = "Delta time between current and previous samples is greater than the delta_t_upper_limit field attribute."

For all variables that have a companion QC variable this function will use the following variable attributes to determine the missing_value, and min, max, delta limits:

  • missing_value, or _FillValue, or default NetCDF fill value
  • valid_min
  • valid_max
  • valid_delta

The QC variable bit values used by these checks are:

  • bit 1 = "Value is equal to missing_value."
  • bit 2 = "Value is less than the valid_min."
  • bit 3 = "Value is greater than the valid_max."
  • bit 4 = "Difference between current and previous values exceeds valid_delta."

If an error occurs in this function it will be appended to the log and error mail messages, and the process status will be set appropriately.

Parameters:
ds_id- datastream ID used to get the previous dataset if it is needed for the QC time and delta checks.
dataset- pointer to the dataset
Returns:
  • 1 if successful
  • 0 if an error occurred

Definition at line 299 of file dsproc_standard_qc.c.