ctdfjorder.CTD.CTD.add_metadata(self, master_sheet_path: str, master_sheet_polars: DataFrame = None)#

Adds metadata to the CTD data from a master sheet.

Parameters:
  • master_sheet_path (str) – Path to the master sheet file.

  • master_sheet_polars (pl.DataFrame, optional) – Pre-loaded master sheet as a Polars DataFrame.

Raises:

NoSamplesError – When the function is called on a CTD object with no data.

Notes

This method adds metadata such as unique ID, Secchi depth, site name, and site ID to each profile in the CTD data. It also corrects missing location data if present in the master sheet.

If a preloaded master sheet is not provided, the method will load the master sheet from the specified file path.

Examples

ctd_data = CTD('example.csv')
ctd_data.add_metadata('path/to/master_sheet.csv')
# This will add metadata from the master sheet to the CTD dataset.