metobs_toolkit.Dataset.apply_titan_sct_resistant_check#

Dataset.apply_titan_sct_resistant_check(obstype='temp')[source]#

Apply the TITAN spatial consistency test (resistant).

The SCT resistant check is a spatial consistency check which compares each observations to what is expected given the other observations in the nearby area. If the deviation is large, the observation is removed. The SCT uses optimal interpolation (OI) to compute an expected value for each observation. The background for the OI is computed from a general vertical profile of observations in the area.

See the titanlib documentation on the sct check for futher details.

The observation and outliers attributes will be updated accordingly.

Parameters:

obstype (String, optional) – Name of the observationtype you want to apply the checks on. The default is ‘temp’.

Return type:

None.

Note

To update the check settings, use the update_titan_qc_settings method of the Dataset class.

Warning

To use this method, you must install titanlib. Windows users must have a c++ compiler installed. See the titanlib documentation: metno/titanlib.

Warning

This method is a python wrapper on titanlib c++ scripts, and it is prone to segmentation faults. The perfomance of this check is thus not guaranteed!

Examples

import metobs_toolkit

# Import data into a Dataset
dataset = metobs_toolkit.Dataset()
dataset.update_settings(
                        input_data_file=metobs_toolkit.demo_datafile,
                        input_metadata_file=metobs_toolkit.demo_metadatafile,
                        template_file=metobs_toolkit.demo_template,
                        )
dataset.import_data_from_file()
dataset.coarsen_time_resolution(freq='1h')

#Get altitude of all stations
dataset.get_altitude()

#Update some temperature QC settings
dataset.update_titan_qc_settings(obstype='temp',
                                 sct_outer_radius=25000)

# Apply buddy check on the temperature observations
dataset.apply_titan_sct_resistant_check(obstype='temp')