Skip to content

receptors

receptors

PyAERMOD Receptor dataclasses.

Contains CartesianGrid, PolarGrid, DiscreteReceptor, and the ReceptorPathway collection.

This module is an internal implementation detail. Public imports should go through :mod:pyaermod.input_generator (the backwards-compatible facade) or :mod:pyaermod.api.

CartesianGrid dataclass

AERMOD Cartesian receptor grid (GRIDCART)

Creates a regular rectangular grid of receptors.

x_values

x_values() -> List[float]

The receptor x coordinates, explicit or generated.

y_values

y_values() -> List[float]

The receptor y coordinates, explicit or generated.

from_bounds classmethod

from_bounds(x_min: float, x_max: float, y_min: float, y_max: float, spacing: float = 100.0, grid_name: str = 'GRID1') -> CartesianGrid

Create grid from bounding box and spacing.

The grid starts at (x_min, y_min) and runs in whole steps of spacing up to, and including, the bound when it is a multiple of the spacing; otherwise it ends at the last step at or before the bound. Raises :class:ValueError for a spacing that is not positive or a maximum below its minimum.

to_aermod_input

to_aermod_input(elevated: Optional[bool] = None, flagpole: Optional[float] = None) -> str

Generate AERMOD RE pathway text.

AERMOD requires GRIDCART blocks wrapped in STA/END: GRIDCART name STA XYINC ... GRIDCART name END

elevated is whether the run uses elevated terrain (:attr:ControlPathway.elevated_terrain) and flagpole the run's CO FLAGPOLE height (:attr:ControlPathway.flag_pole_height). Under elevated terrain a grid with neither grid_elevations nor grid_hills gets ELEV and HILL rows of z_elev and z_hill, because reset.f RECART needs both (W214 and zero heights when both are missing). A grid with only one of the two is written as given, and AERMOD stops with E218, as it does for a deck with ELEV rows and no HILL rows. With a flagpole height, a grid without grid_flags gets FLAG rows of a non-zero z_flag; with z_flag 0 they are left out and AERMOD uses the FLAGPOLE height for every receptor (W216, the same heights), which keeps EPA's own FLAGPOLE decks reading back unchanged. Without that context (None, the default) only the rows given are written, as earlier releases did.

PolarGrid dataclass

AERMOD polar receptor grid (GRIDPOLR)

Creates receptors in polar coordinates (distance and direction from origin).

ring_distances

ring_distances() -> List[float]

The ring distances, explicit or generated.

direction_angles

direction_angles() -> List[float]

The radial directions in degrees, explicit or generated.

to_aermod_input

to_aermod_input(elevated: Optional[bool] = None, flagpole: Optional[float] = None) -> str

Generate AERMOD RE pathway text.

AERMOD requires GRIDPOLR blocks wrapped in STA/END. The field layouts are those of reset.f: ORIG x y or ORIG srcid, DIST d1 d2 ... (always a list), GDIR num init delta (count first) or DDIR a1 a2 .... Before pyaermod 2.1 the writer emitted DIST init num delta and GDIR init num delta; AERMOD read the former as three rings and the latter as zero directions, so the network had no receptors (RE E185).

elevated and flagpole are the run's terrain and flagpole options, with the same effect as for :meth:CartesianGrid.to_aermod_input: under elevated terrain a network with neither elevations nor hills gets ELEV and HILL rows (one per direction) of z_elev and z_hill; a network with only one of the two is written as given; with a flagpole height a network without flags gets FLAG rows of a non-zero z_flag. Without that context (None, the default) only the rows given are written.

DiscreteReceptor dataclass

Individual receptor at specific location.

z_flag is the receptor's flagpole height; 0 means the run's CO FLAGPOLE default when there is one.

to_aermod_input

to_aermod_input(elevated: Optional[bool] = None, flagpole: Optional[float] = None) -> str

Generate AERMOD DISCCART line.

reset.f DISCAR reads the fields after x and y by the run's options: zelev zhill [zflag] under elevated terrain and [zflag] under FLAT, the flagpole field only with CO FLAGPOLE. elevated (:attr:ControlPathway.elevated_terrain) and flagpole (:attr:ControlPathway.flag_pole_height) give that context. Under elevated terrain the line always carries zelev zhill, a zero hill height included (a missing one is W228, and AERMOD then takes 0). With FLAGPOLE the flagpole field follows (after zelev zhill, or straight after x and y under FLAT, where the elevation used to go and AERMOD read it as the flagpole height), and a zero z_flag is written as the FLAGPOLE height, the one AERMOD gives a receptor that has none.

Under FLAT without FLAGPOLE, and with elevated=None (no context), the line is what earlier releases wrote: x y zelev, plus zhill zflag when either is non-zero. AERMOD ignores the extra fields under FLAT (W229), but the elevation is kept in the deck so it reads back into z_elev.

ReceptorPathway dataclass

Collection of receptor grids and discrete receptors

add_cartesian_grid

add_cartesian_grid(grid: CartesianGrid)

Add Cartesian grid

add_polar_grid

add_polar_grid(grid: PolarGrid)

Add polar grid

add_discrete_receptor

add_discrete_receptor(receptor: DiscreteReceptor)

Add discrete receptor

to_aermod_input

to_aermod_input(elevated: Optional[bool] = None, flagpole: Optional[float] = None) -> str

Generate AERMOD RE pathway text.

elevated and flagpole are the run's terrain and flagpole options (:attr:ControlPathway.elevated_terrain, :attr:ControlPathway.flag_pole_height), which decide the elevation fields AERMOD reads; :meth:AERMODProject.to_aermod_input passes them. Without them the Cartesian and polar grids and discrete receptors are written as earlier releases wrote them.