helikite.classes.data_processing_level1_5

Classes

DataProcessorLevel1_5

Level 1.5 for detecting flags that indicate environmental or flight conditions, such as hovering,

Module Contents

class helikite.classes.data_processing_level1_5.DataProcessorLevel1_5(output_schema: helikite.classes.output_schemas.OutputSchema, df: pandas.DataFrame, metadata: pydantic.BaseModel, flight_computer_version: str | None = None)

Bases: helikite.classes.base.BaseProcessor

Level 1.5 for detecting flags that indicate environmental or flight conditions, such as hovering, pollution exposure, or cloud immersion.

property level: helikite.classes.output_schemas.Level

Processing level identifier.

_df
_metadata
_automatic_flags_files: set[str]
_final_flags_files: set[str]
_data_state_info() list[str]
property df: pandas.DataFrame

Return the current state of dataframe.

fill_msems_takeoff_landing(time_window_seconds=90)

Fill missing values in mSEMS columns at takeoff and landing times using nearby values.

Parameters:

time_window_seconds (int, optional) – Number of seconds before/after to search for replacement values (default: 90).

remove_before_takeoff_and_after_landing()

Trim dataframe outside flight time window.

drop_columns()

Drop dataframe columns which are not required for the final file.

rename_columns()

Renames columns of the input DataFrame according to predefined rules and instrument-specific rules. See Instrument.rename_dict

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.

Parameters:

decimals (int, optional) – The number of decimal places to round to (default is 2).

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.

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.

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.

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.

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.

classmethod get_expected_columns(output_schema: helikite.classes.output_schemas.OutputSchema, reference_instrument: helikite.instruments.Instrument, with_dtype: bool) list[str] | dict[str, str]

Generate expected dataframe columns at level 0.

Parameters:
  • output_schema – Schema containing campaign instruments.

  • with_dtype – Whether to include dtype mapping.

Returns:

List of column names or dict of column-to-dtype.

static read_data(level1_5_filepath: str | pathlib.Path) pandas.DataFrame

Load Level 1.5 dataframe from CSV.

export_data(filepath: str | pathlib.Path | None = None)

Export dataframe in its final state.