ctdam.parser package¶
Submodules¶
- ctdam.parser.custom_xarray_accessors module
CTDAccessorProcessingAccessorInputAccessorMetadataAccessorDataRetrievalAccessorDataRetrievalAccessor.btl_infoDataRetrievalAccessor.pathDataRetrievalAccessor.spans()DataRetrievalAccessor.sizeDataRetrievalAccessor.sample_rateDataRetrievalAccessor.bin_unitDataRetrievalAccessor.binnedDataRetrievalAccessor.sensor_strand()DataRetrievalAccessor.flattened_ds()DataRetrievalAccessor.numpy_array()DataRetrievalAccessor.pandas_dataframe
ExportAccessorQCAccessorPlotAccessor
- ctdam.parser.geomar_ctd_file_parser module
- ctdam.parser.read_ctd_data module
- ctdam.parser.seabird_data_files module
SeabirdDataFileSeabirdDataFile.path_to_fileSeabirdDataFile.file_nameSeabirdDataFile.file_dirSeabirdDataFile.dataSeabirdDataFile.metadataSeabirdDataFile.start_timeSeabirdDataFile.start_positionSeabirdDataFile.cruiseSeabirdDataFile.stationSeabirdDataFile.event_nameSeabirdDataFile.read_file()SeabirdDataFile.reading_start_time()SeabirdDataFile.reading_start_position()SeabirdDataFile.read_event_information()SeabirdDataFile.sensor_xml_to_flattened_dict()SeabirdDataFile.structure_metadata()
CnvFileHexFileBottleLogFileBottleFile
- ctdam.parser.xmlfiles module
Module contents¶
- ctdam.parser.parse(file_path, downcast_only=False)[source]¶
Parse different file types to a cf-compliant xarray Dataset.
Can handle Seabirds .cnv and .hex file formats and Sea&Suns .TOB file format.
- Parameters:
file_path (
Path|str) – The path to the ctd data file- Return type:
Dataset
- class ctdam.parser.CnvFile(path_to_file, only_header=False)[source]¶
Bases:
SeabirdDataFileA representation of a cnv-file as used by SeaBird.
- class ctdam.parser.HexFile(path_to_file, path_to_xmlcon='', *args, **kwargs)[source]¶
Bases:
SeabirdDataFileA representation of a .hex file as used by SeaBird.
When no corresponding .xmlcon file given, a search algorithm is used to determine the matching .xmlcon automatically.
- parse_hex(hex)[source]¶
Parse the individual hex information bits using sbe.odf
- Parameters:
hex (
Path|str) – The path to the target hex file- Return type:
Dataset
- get_corresponding_xmlcon(path_to_xmlcon='')[source]¶
Finds the best matching .xmlcon file inside the same directory.
The logics works as follows:
if an .xmlcon of the same name exists, take that
else, find all .xmlcons of the same cruise inside the given directory and use the one used by the previous .hex file, sorted by file name.
- Return type:
XMLCONFile|None
- class ctdam.parser.BottleFile(path_to_file)[source]¶
Bases:
SeabirdDataFileClass that represents a Sea-Bird Bottle File (.btl) .
- create_dataframe()[source]¶
Creates a dataframe out of the .btl file. Handles the double data header correctly.
- adding_timestamp_column()[source]¶
Creates a timestamp column that holds both, Date and Time information.
- selecting_rows(df=None, statistic_of_interest=['avg'])[source]¶
Creates a dataframe with the given row identifier, using the statistics column. A single string or a list of strings can be processed.
- Parameters:
df (pandas.Dataframe :) – the files Pandas representation (Default value = self.df)
statistic_of_interest (
list|str) – collection of values of the ‘statistics’ column in self.df
- class ctdam.parser.BottleLogFile(path_to_file)[source]¶
Bases:
SeabirdDataFileBottle Log file (.bl) representation, that extracts the three different data types from the file: reset time and the table with bottle IDs and corresponding data ranges.
- class ctdam.parser.XMLCONFile(path_to_file)[source]¶
Bases:
XMLFileA representation of a Sea-Bird .XMLCON file.