ctdclient.model.metadataheader module

class ctdclient.model.metadataheader.MetadataHeader[source]

Bases: object

Collects all methods for filling the custom metadata header.

dship_values = {}[source]
classmethod build_metadata_header(psa, platform, cast, operator, pos_alias='', autostart=False)[source]

Generates the metadata header in the needed format and saves the last operator.

Parameters:
  • psa (SeasavePsa) – The config file to edit

  • platform (str) – The instrument name

  • cast (str) – The cast number

  • operator (str) – The CTD operator name

  • pos_alias (str) – A station name alias

  • autostart (bool) – Whether to start seasave automatically

classmethod create_metadata_header_line(name, value)[source]

Helper method to contruct key-value information in metadata header.

Parameters:
  • name – key

  • value – value

Return type:

Formatted key-value string.

classmethod format_dship_response(name, value)[source]

Parse DSHIP API responses.

Parameters:
  • name – key

  • value – value

Return type:

Formatted value.

classmethod build_file_name(dship_values, cast_number, platform)[source]

Assemble new file name.

Parameters:
  • dship_values (dict) – DSHIP responses

  • cast_number (int) – The CTD cast number

  • platform (str) – The CTD platform type

Return type:

The new file name.