ctdclient.model.fileupdater module

class ctdclient.model.fileupdater.UpdateFiles(file_path, file_dir, station_event_info)[source]

Bases: object

Uses a station log to restrospectively set metadata header and file name.

Parameters:
  • file_path (str | Path) – The path to the file to edit

  • file_dir (str | Path) – The directory of the file

  • station_event_info (str) – The station information of the last CTD cast

find_all_files()[source]

Gets the files to update from the target directory.

Assures, that all possible files, like .hex, .cnv. .xmlcon, .bl, .hdr, .ros or .btl are treated equally.

Return type:

list[Path]

rename_files(file_list, new_name)[source]

Applies the new file name to all target files.

Parameters:
  • file_list (list[Path]) – The list of target files to rename

  • new_name (str) – The new name

create_new_file_name(old_name, station_data)[source]

Builds a new file name from station information.

Parameters:
  • old_name (str) – The old files name

  • station_data (str) – The station information

Return type:

str

replace_metadata_header_info(station_event_info)[source]

Fill the custom metadata header with content.

Parameters:

station_event_info – The station information from manida export