Aerosol2D

class aerosoltools.aerosol2d.Aerosol2D(dataframe)

A class for managing time-resolved, size-distributed aerosol data.

This class extends Aerosol1D to handle datasets that contain particle size distributions (e.g., number, mass, or surface area concentration across particle size bins). It supports transformation between physical representations (dN, dS, dV, dW), visualization, activity segmentation, and summary statistics including PM values and particle size metrics.

Parameters

dataframepandas.DataFrame

A DataFrame containing the data to load. The first column should contain time stamps or be the DataFrame index. The second column should be the total concentration. All remaining columns must represent concentration values in size bins with bin midpoints as column headers.

Notes

All data handling is done with pandas. Input DataFrames are expected to have particle size bin midpoints as column headers, and the class assumes these are numeric and represent diameters in nanometers.

Properties

Aerosol2D.activities

List of defined activity labels.

Aerosol2D.activity_periods

Dictionary of activity names and their associated time periods.

Aerosol2D.bin_edges

List of bin edges in nm

Aerosol2D.bin_mids

List of bin mids in nm

Aerosol2D.data

Dataframe with all data, times, and activity columns if marked.

Aerosol2D.density

Unit of the measurements.

Aerosol2D.dtype

Data type description of the measurements.

Aerosol2D.extra_data

List of defined activity labels.

Aerosol2D.instrument

Instrument used for the measurements.

Aerosol2D.metadata

Meta data as extracted upon loading the data

Aerosol2D.original_data

Unmodified original dataset.

Aerosol2D.serial_number

Serial number of instrument

Aerosol2D.size_data

Sizebin data

Aerosol2D.time

Timestamps of the dataset.

Aerosol2D.total_concentration

Total concentration measurements.

Aerosol2D.unit

Unit of the measurements.

Methods

Aerosol2D.convert_to_mass_concentration

Convert particle size distribution data to mass concentration (ug/m³) based on current data type.

Aerosol2D.convert_to_number_concentration

Convert particle size distribution data to number concentration (cm⁻³) from the current data type.

Aerosol2D.convert_to_surface_concentration

Convert particle size distribution data to surface area concentration (nm²/cm³) based on the current data type.

Aerosol2D.convert_to_volume_concentration

Convert particle size distribution data to volume concentration (nm³/cm³) based on the current data type.

Aerosol2D.copy_self

Create a deep copy of the current Aerosol1D object.

Aerosol2D.correct_diffusion_losses

Correct for diffusion losses in a sampling tube based on tubing geometry, flow conditions, and particle sizes.

Aerosol2D.get_activity_data

Extract data corresponding to a specified activity.

Aerosol2D.mark_activities

Mark activities in the data by adding one boolean column per activity.

Aerosol2D.normalize_logdp

Normalize the size distribution data by dlogDp to obtain, e.g., dN/dlogDp.

Aerosol2D.plot_psd

Plot the average particle size distribution (PSD) for the entire dataset and optionally selected activities.

Aerosol2D.plot_timeseries

Plot total concentration (top) and a size-resolved time series (bottom).

Aerosol2D.plot_total_conc

Plot the total concentration over time.

Aerosol2D.set_density

Set density of the aerosol particles in g/cm3

Aerosol2D.summarize

Summarize aerosol characteristics for each activity period.

Aerosol2D.timecrop

Crop the data to a specified time window.

Aerosol2D.timerebin

Resample the data to a new time frequency using an aggregation function.

Aerosol2D.timeshift

Shift the time index by a given number of seconds and/or minutes.

Aerosol2D.timesmooth

Apply rolling window smoothing to the data.

Aerosol2D.unnormalize_logdp

Reverse dlogDp normalization (e.g., convert dN/dlogDp to dN).