ctdam package

Subpackages

Submodules

ctdam.utils module

ctdam.utils.read_event_name(station_string, regex_string='(?P<c>[a-z]{1,3}\\\\d{1,3})(-|_|\\\\/)?(?P<cn>1|2)?(-|_)(?P<s>\\\\d{1,4})(-|_)(?P<e>\\\\d{1,2})')[source]
Return type:

Tuple[str, str]

ctdam.utils.create_event_string(cruise, station_event, leading_zeroes=True)[source]
Return type:

str

ctdam.utils.parse_xmlcon_sensor_data(sensor_info)[source]
Return type:

dict

ctdam.utils.extract_sensor_name(sensors)[source]
Return type:

list

ctdam.utils.get_unique_sensor_data(sensor_data)[source]

Returns all the unique sensors and their configuration used in the given collection of sensor data. These will typically be parsed from xml inside .cnv or .xmlcon files. If for example, the first oxygen sensor has been replaced after the 8 cast, then we will see that in the output structure by a seconde tuple, with the number 8 and the individual sensor information for that new oxygen sensor.

Parameters:

sensor_data (list[list[dict]]) – The structure of xml-parsed dicts inside two organizing lists.

Return type:

list[tuple[list[dict]]]

Returns:

  • The input structure stripped down to unique sensor data and appended by

  • the index, at which this new sensor appeared the first time.

exception ctdam.utils.UnexpectedFileFormat(file_type, error)[source]

Bases: Exception

Module contents