helikite.instruments.mcda_instrument
Mini Cloud Droplet Anlayzer (mCDA) mCDA -> mCDA_output_2025-02-12_A (has pressure)
Important variables to keep:
!!! Raspery Pie of the mCDA has an autonomous timestamp, make sur it has been corrected when creating the output file.
Attributes
Classes
Instrument definition for the mcda sensor system. |
Module Contents
- helikite.instruments.mcda_instrument.logger
- helikite.instruments.mcda_instrument.MCDA_MIDPOINT_DIAMETER_LIST
- class helikite.instruments.mcda_instrument.mCDA(*args, **kwargs)
Bases:
helikite.instruments.base.InstrumentInstrument definition for the mcda sensor system. Handles timestamp creation and optional corrections.
- __repr__()
- property has_size_distribution: bool
- file_identifier(first_lines_of_csv) bool
Identify if the file matches the expected mCDA CSV header. Only checks the first few columns for matching names, ignoring the rest.
- set_time_as_index(df: pandas.DataFrame) pandas.DataFrame
Set the DateTime as index of the dataframe and correct if needed Using values in the time_offset variable, correct DateTime index
- read_data() pandas.DataFrame
Read data into dataframe
This allows a custom read function to parse the CSV/TXT into a dataframe, for example cleaning dirty data at the end of the file in memory without altering the input file (see flight computer conf).
- data_corrections(df: pandas.DataFrame, **kwargs) pandas.DataFrame
Apply any custom corrections here. For now, this is a pass-through.
- remove_duplicates(df: pandas.DataFrame) pandas.DataFrame
- calculate_derived(df: pandas.DataFrame, verbose: bool, *args, **kwargs) pandas.DataFrame
Calculate derived data from the raw data, i.e. total concentration
- normalize(df: pandas.DataFrame, reference_instrument: helikite.instruments.base.Instrument, verbose: bool, *args, **kwargs) pandas.DataFrame
Normalize mCDA concentrations to STP conditions and insert the results right after the existing mCDA columns.
Parameters: df (pd.DataFrame): DataFrame containing mCDA measurements and metadata.
Returns: df (pd.DataFrame): Updated DataFrame with STP-normalized columns inserted.
- plot_raw_and_normalized(df: pandas.DataFrame, verbose: bool, *args, **kwargs)
Plots mCDA total concentration vs Altitude
- plot_distribution(df: pandas.DataFrame, verbose: bool, time_start: datetime.datetime, time_end: datetime.datetime, subplot: tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes] | None = None)
Plot mCDA size distribution and total concentration.
Parameters: - df (pd.DataFrame): DataFrame containing mCDA size distribution and total concentration. - Midpoint_diameter_list (list or np.array): List of particle diameters corresponding to the diameter bin midpoints.
- plot_vertical_distribution(df: pandas.DataFrame, verbose: bool, *args, **kwargs)
Plots the vertical distribution of mCDA particle size distribution versus altitude.
Parameters: - df: pandas DataFrame containing particle size distribution and altitude data. - midpoint_diameter_list: 1D NumPy array of midpoint diameters corresponding to bins.
- helikite.instruments.mcda_instrument.mcda