Metadata#
- class ctdfjorder.metadata.master_sheet.MasterSheet(master_sheet_path: str, secchi_depth_label: str = 'secchi depth', latitude_label: str = 'nominal latitude', longitude_label: str = 'nominal longitude', datetime_utc_label: str = 'date/time (ISO)', unique_id_label: str = 'UNIQUE ID CODE ', filename_label: str = 'CTD cast file name', site_names_label: str = 'location', site_names_short_label: str = 'loc id', null_values: list[str] = None)[source]
Represents a master sheet for research sample data, allowing for the integration and cross-checking of sample data.
- TIME_UNIT
The time unit for datetime operations.
- Type:
Literal[“ns”, “us”, “ms”], default “ns”
- TIME_ZONE
The time zone for datetime operations.
- Type:
str, default “UTC”
- data
The data from the master sheet.
- Type:
polars.DataFrame
- secchi_depth_label
The label for secchi depth in the master sheet.
- Type:
str
- latitude_label
The label for latitude in the master sheet.
- Type:
str
- longitude_label
The label for longitude in the master sheet.
- Type:
str
- date_utc_label
The label for UTC date in the master sheet.
- Type:
str
- time_utc_label
The label for UTC time in the master sheet.
- Type:
str
- site_names_label
The label for site names in the master sheet.
- Type:
str
- site_names_short_label
The label for short site names in the master sheet.
- Type:
str
- Parameters:
master_sheet_path (str) – The file path to the master sheet.
secchi_depth_label (str, default "secchi depth") – The label for secchi depth in the master sheet.
latitude_label (str, default "latitude") – The label for latitude in the master sheet.
longitude_label (str, default "longitude") – The label for longitude in the master sheet.
datetime_utc_label (str, default "date/time (ISO)") – The label for UTC date and time in the master sheet.
unique_id_label (str, default "UNIQUE ID CODE ") – The label for unique ID in the master sheet.
site_names_label (str, default "location") – The label for site names in the master sheet.
site_names_short_label (str, default "loc id") – The label for short site names in the master sheet.
null_values (list[str], default None) – Specifies which values should be considered null while reading master sheet.
- Raises:
IOError – If the master sheet file type is not supported or if the data cannot be read.
CTDError – If there are issues with the data, such as missing or invalid values.
- find_match(profile: DataFrame) SamplingEvent[source]
Locates the row in the master sheet with a filename value that matches the profile parameter. Returns the time, latitude, longitude, unique id, loc id, location and secchi depth from that row.
- Parameters:
profile (pl.DataFrame) – Profile to match to master sheet.
- Returns:
An object containing the estimated latitude, longitude, unique id, and secchi depth.
- Return type:
MetadataMastersheet
- Raises:
CTDError – When there is no timestamp data in the master sheet and/or CTD file.