Core framework

Writing portable QC operations shouldn’t depend on the underlying data storage mechanism, which might be a database, NetCDF file, or binary export. The classes in the core module are designed to provide a view of Argo data that can be passed to or returned from QC operations. Here Argo data are modeled as Trace objects that are contained by Profile objects.

class medsrtqc.core.Profile(data=None, meta=None)

A base class for the concept of a “Profile”. Unlike a “Profile” in an Argo NetCDF file, these objects should contain all parameters measured during an ascent (or some other event that can be QCed). The interface is dict-like with elements as Trace objects that can be extracted by name or iterated over using keys() or items(). The base class can wrap a dict of Trace objects.

class medsrtqc.core.Trace(value: MaskedArray, qc=None, adjusted=None, adjusted_error=None, adjusted_qc=None, pres=None, mtime=None)

Trace objects are a simple representation of a value series. All attributes of a Trace are numpy MaskedArray objects like those that might be read from an Argo NetCDF file. The value attribute is guaranteed to not be None; other attributes are optional and should be checked in code that uses these objects. QC operations can be written as functions of Trace objects and the result of QC operations is often a modified Trace.

Parameters:
  • value – The parameter value. This should be the same units as would be written to the Argo NetCDF file.

  • qc – The parameter QC value.

  • adjusted – The adjusted parameter value.

  • adjusted_error – The error estimate for the adjusted value.

  • adjusted_qc – The adjusted parameter QC value

  • pres – The pressure measurement (in dbar) corresponding to the value.

  • mtime – The measurement time