ctdam.parser.bottlefile module

class ctdam.parser.bottlefile.BottleFile(path_to_file, only_header=False)[source]

Bases: DataFile

Class that represents a Sea-Bird Bottle File (.btl) .

Organizes the files table information into a pandas dataframe. This allows the usage of this powerful library for statistics, visualization, data manipulation, export, etc.

Parameters:
  • path_to_file (Path | str) – The path to the .btl file

  • only_header (bool) – Whether to only check the header and not parse data

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.

setting_dataframe_dtypes()[source]

Sets the types for the column values in the dataframe.

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 (Union[list) – collection of values of the ‘statistics’ column in self.df (Default value = [‘avg’])

  • statistic_of_interest

  • str] – (Default value = [“avg”])

reading_data_header()[source]

Identifies and separatly collects the rows that specify the data tables headers.

add_station_and_event_column()[source]
add_position_columns()[source]