ctdam.proc.module module

class ctdam.proc.module.Module[source]

Bases: ABC

An interface to implement new processing modules against.

Is meant to perform and unify all the necessary work that is needed to streamline processing on Sea-Bird CTD data. Implementing classes should only overwrite the transformation method, that does the actual altering of the data. All other organizational overhead should be covered by this interface. This includes parsing to .cnv output with correct handling of the metadata header.

Parameters:
  • input (Path | str | CnvFile | CTDData) – The data input

  • arguments (dict = {}) – The arguments to run the module with

  • default_values (dict) – The default arguments, if any

bad_flag: float = -9.99e-29[source]
add_processing_metadata()[source]

Parses the module processing information into cnv-compliant metadata lines.

These take on the form of {MODULE_NAME}_{KEY} = {VALUE} for every key-value pair inside of the given dictionary with the modules processing info.

abstractmethod transformation()[source]
Return type:

bool

create_flag_array_if_missing()[source]

Check flag array presence and create, if not found.

handle_new_flags(new_flag_array)[source]

Write number of flagged rows to metadata info and concatenate flags.

Parameters:

new_flag_array (ndarray) – The array of new flags

check_whether_working_on_binned_data()[source]

Raise error when working with binned data.