helikite.classes.data_processing_level1_5 ========================================= .. py:module:: helikite.classes.data_processing_level1_5 Classes ------- .. autoapisummary:: helikite.classes.data_processing_level1_5.DataProcessorLevel1_5 Module Contents --------------- .. py:class:: DataProcessorLevel1_5(output_schema: helikite.classes.output_schemas.OutputSchema, df: pandas.DataFrame, metadata: pydantic.BaseModel, flight_computer_version: str | None = None) Bases: :py:obj:`helikite.classes.base.BaseProcessor` Level 1.5 for detecting flags that indicate environmental or flight conditions, such as hovering, pollution exposure, or cloud immersion. .. py:property:: level :type: helikite.classes.output_schemas.Level Processing level identifier. .. py:attribute:: _df .. py:attribute:: _metadata .. py:attribute:: _automatic_flags_files :type: set[str] .. py:attribute:: _final_flags_files :type: set[str] .. py:method:: _data_state_info() -> list[str] .. py:property:: df :type: pandas.DataFrame Return the current state of dataframe. .. py:method:: fill_msems_takeoff_landing(time_window_seconds=90) Fill missing values in mSEMS columns at takeoff and landing times using nearby values. :param time_window_seconds: Number of seconds before/after to search for replacement values (default: 90). :type time_window_seconds: int, optional .. py:method:: remove_before_takeoff_and_after_landing() Trim dataframe outside flight time window. .. py:method:: drop_columns() Drop dataframe columns which are not required for the final file. .. py:method:: rename_columns() Renames columns of the input DataFrame according to predefined rules and instrument-specific rules. See `Instrument.rename_dict` .. py:method:: round_and_add_flightnbr_campaign(decimals=2) Round numeric columns of the DataFrame with special handling for 'WindDir', and add columns for flight number and campaign. :param decimals: The number of decimal places to round to (default is 2). :type decimals: int, optional .. py:method:: detect_flag(flag: helikite.classes.output_schemas.Flag = flag_pollution_cpc, auto_path: str | pathlib.Path = 'flag_auto.csv', plot_detection: bool = True) Automatically detect and record flag events. .. py:method:: choose_flag(flag: helikite.classes.output_schemas.Flag = flag_pollution_cpc, auto_path: str | pathlib.Path | None = None, corr_path: str | pathlib.Path = 'flag_corr.csv') Interactively review and correct flag detection. .. py:method:: set_flag(flag: helikite.classes.output_schemas.Flag = flag_pollution_cpc, corr_path: str | pathlib.Path = 'flag_corr.csv', mask: pandas.Series | None = None) Apply finalized flag to dataframe. .. py:method:: plot_flight_profiles(flight_basename: str, save_path: str | pathlib.Path, variables: list[helikite.classes.output_schemas.FlightProfileVariable] | None = None) Generate and save flight profile plots. .. py:method:: plot_size_distr(flight_basename: str, save_path: str | pathlib.Path, time_start: datetime.datetime | None = None, time_end: datetime.datetime | None = None) Generate and save particle size distribution plots combined in a single plot. .. py:method:: get_expected_columns(output_schema: helikite.classes.output_schemas.OutputSchema, reference_instrument: helikite.instruments.Instrument, with_dtype: bool) -> list[str] | dict[str, str] :classmethod: Generate expected dataframe columns at level 0. :param output_schema: Schema containing campaign instruments. :param with_dtype: Whether to include dtype mapping. :returns: List of column names or dict of column-to-dtype. .. py:method:: read_data(level1_5_filepath: str | pathlib.Path) -> pandas.DataFrame :staticmethod: Load Level 1.5 dataframe from CSV. .. py:method:: export_data(filepath: str | pathlib.Path | None = None) Export dataframe in its final state.