Median Absolute Deviation Quality Control
Switch branches/tags
Nothing to show
Clone or download
Latest commit b2ad920 Mar 21, 2015
Failed to load latest commit information. Note Python 3 is required Mar 20, 2015 Show %age in progress Mar 20, 2015 test mad.mad() Aug 14, 2014

Median Absolute Deviation Quality Control

This software will apply a very minimal QC stage to monthly temperature data (for example, from GHCN-M or ISTI), using the Median Absolute Deviation estimator.


For each combination of (station-id, element, named-month) the median and the median absolute deviation are calculated (MAD, which is the median of the distances of each datum from the median). At least 20 monthly values are required, if the number of values is insufficient, they are all rejected. Any value whose distance from the median exceeds 5 times the MAD is rejected.

The method is somewhat inspired by the "z-score" of Lawrimore et al, 2011.




Python 3 is required.

./ [tavg.dat]

Reads the file tavg.dat and creates the QC'd output tavg.qc.dat.

The input file should be in GHCN-M v3 .dat format. If the filename is not specified as an argument, a file matching the path


is used. If there are several, the ASCIIbetically last is chosen.

The QC'd output is written to a file based on the name of the input. If the input is named tavg.dat the output is named tavg.qc.dat (if the input has some other extension then .qc.dat is simply appended).