Skip to content

output_parser

output_parser

PyAERMOD Output File Parser

Parses AERMOD output files (.out) and converts results to pandas DataFrames. Based on AERMOD version 26135 output format specifications (validated against 26135 and 24142; see :mod:pyaermod.versions).

ModelRunInfo dataclass

Metadata about the AERMOD run

SourceSummary dataclass

Summary information for a source

ReceptorInfo dataclass

Information about a receptor

ConcentrationResult dataclass

Results for one averaging period, as one of AERMOD's summary tables.

output_type says what the values are: "CONC" (concentration) or, for a deposition run, "DEPOS" (total), "DDEP" (dry) or "WDEP" (wet deposition). units is the unit AERMOD printed over the table (MICROGRAMS/M**3 is given as ug/m^3 and GRAMS/M**2 as g/m^2). title is the table's own heading, for example THE SUMMARY OF HIGHEST 1-HR RESULTS.

Rows read from AERMOD's summary tables carry, besides x, y and concentration, the rank, the source group, the date (YYMMDDHH, short-term averages only), zelev, zhill and zflag, the receptor_type and grid_id, the value as AERMOD printed it (value_text) and its calm/missing flag: "c" when the average included calm hours, "m" missing hours, "b" both, and "" for neither.

max_row property

max_row: Optional[Dict]

The row of the maximum, as a dict, or None for an empty table.

AERMODOutputParser

Parser for AERMOD output files

Extracts run information, source data, receptor data, and concentration results.

parse

parse() -> AERMODResults

Parse the output file and return results object

Returns: AERMODResults object with all parsed data

AERMODResults dataclass

Complete AERMOD results

Contains all parsed information from an AERMOD output file.

from_file classmethod

from_file(output_file: Union[str, Path]) -> AERMODResults

Parse AERMOD output file

Args: output_file: Path to AERMOD .out file

Returns: AERMODResults object

get_concentrations

get_concentrations(averaging_period: str = 'ANNUAL') -> Optional[pd.DataFrame]

Get the summary-table rows for one averaging period

These are the rows of AERMOD's summary tables in the .out file (the highest values, typically ten receptors), not the value at every receptor. For a map or contour of the whole grid, request a PLOTFILE (OutputPathway.period_plot_files) and read it with :func:pyaermod.aermod_outputs.read_plotfile, or pass it to :meth:pyaermod.visualization.AERMODVisualizer.plot_contours as plotfile.

Args: averaging_period: Averaging period (e.g., 'ANNUAL', '24HR', '1HR')

Returns: DataFrame with x, y, concentration columns, or None if period not found.

get_max_concentration

get_max_concentration(averaging_period: str = 'ANNUAL') -> Optional[Dict]

Get maximum concentration and its location

Args: averaging_period: Averaging period

Returns: Dictionary with 'value', 'x', 'y', 'units', or None if period not found.

get_concentration_at_point

get_concentration_at_point(x: float, y: float, averaging_period: str = 'ANNUAL', tolerance: float = 1.0, zflag: Optional[float] = None) -> Optional[float]

Get concentration at specific point (within tolerance)

A flagpole run (CO FLAGPOLE with one network per height) has several receptors at the same (x, y), one per flagpole height. Pass zflag to pick one height.

Args: x: X coordinate y: Y coordinate averaging_period: Averaging period tolerance: Distance tolerance for matching receptors, and for matching zflag when it is given zflag: Flagpole height of the receptor. When it is None and receptors at several heights lie within tolerance, the first match is returned, as before, with a :class:UserWarning naming the heights.

Returns: Concentration value or None if no receptor found

get_sources_dataframe

get_sources_dataframe() -> pd.DataFrame

Get sources as DataFrame

get_receptors_dataframe

get_receptors_dataframe() -> pd.DataFrame

Get receptors as DataFrame

summary

summary() -> str

Generate a text summary of results

export_to_csv

export_to_csv(output_dir: Union[str, Path], prefix: str = 'aermod')

Export all results to CSV files

Args: output_dir: Directory for output files prefix: Prefix for filenames

parse_aermod_output

parse_aermod_output(output_file: Union[str, Path]) -> AERMODResults

Parse an AERMOD output file

Args: output_file: Path to .out file

Returns: AERMODResults object

quick_summary

quick_summary(output_file: Union[str, Path]) -> str

Quick summary of AERMOD results

Args: output_file: Path to .out file

Returns: Text summary