Skip to content

aermet

aermet

PyAERMOD AERMET Input Generator and Output Parser

Generates AERMET input files for meteorological data preprocessing and parses AERMET output files (.SFC surface and .PFL profile).

AERMET is the EPA's meteorological preprocessor for AERMOD.

Processing stages: 1. Stage 1: Extract and QA/QC observational data 2. Stage 2: Merge surface and upper air data 3. Stage 3: Calculate boundary layer parameters

AERMETStation dataclass

Surface meteorological station information

UpperAirStation dataclass

Upper air (radiosonde) station information

AERMETStage1 dataclass

AERMET Stage 1: Extract and QA/QC observational data

Reads raw meteorological data and performs quality assurance.

to_aermet_input

to_aermet_input() -> str

Generate AERMET Stage 1 input file

AERMETStage2 dataclass

AERMET Stage 2: Merge surface and upper air data

Combines Stage 1 outputs into merged file.

to_aermet_input

to_aermet_input() -> str

Generate AERMET Stage 2 input file

AERMETStage3 dataclass

AERMET Stage 3: Calculate boundary layer parameters

Produces final AERMOD-ready meteorology files (.sfc and .pfl).

to_aermet_input

to_aermet_input() -> str

Generate AERMET Stage 3 input file

SurfaceFileHeader dataclass

Parsed header from an AERMET .SFC surface file.

ProfileFileHeader dataclass

Metadata for a .PFL file (no header line — metadata inferred from data).

write_aermet_runfile

write_aermet_runfile(stage: int, input_file: str, output_path: str = '.')

Create a simple AERMET run script

Args: stage: AERMET stage (1, 2, or 3) input_file: Path to input file output_path: Directory for outputs

parse_sfc_header

parse_sfc_header(header_line: str) -> SurfaceFileHeader

Parse the header line of an AERMET .SFC file.

Parameters:

Name Type Description Default
header_line str

First line of the .SFC file.

required

Returns:

Type Description
SurfaceFileHeader

Parsed header metadata.

read_surface_file

read_surface_file(filepath: Union[str, Path]) -> Dict

Parse an AERMET .SFC surface meteorology file.

Parameters:

Name Type Description Default
filepath str or Path

Path to the .SFC file.

required

Returns:

Type Description
dict

Dictionary with keys: - "header": :class:SurfaceFileHeader - "data": :class:pandas.DataFrame with hourly surface parameters

read_profile_file

read_profile_file(filepath: Union[str, Path]) -> Dict

Parse an AERMET .PFL profile meteorology file.

Parameters:

Name Type Description Default
filepath str or Path

Path to the .PFL file.

required

Returns:

Type Description
dict

Dictionary with keys: - "header": :class:ProfileFileHeader with summary metadata - "data": :class:pandas.DataFrame with profile observations