Skip to content

aersurface

aersurface

AERSURFACE input-deck generation.

EPA's AERSURFACE binary derives surface-characteristic tables (albedo, Bowen ratio, surface roughness) from NLCD land-cover rasters for use in AERMET Stage 3. This module is the deck-builder; binary dispatch lives in :mod:pyaermod.aersurface_runner.

The deck format is the pathway-and-keyword layout AERSURFACE has used since v19: a CO (control) pathway and an OU (output) pathway, each bracketed by STARTING / FINISHED. It is verified against the real binary -- :mod:tests.test_real_aersurface reproduces EPA's own RDU test case through this class and compares the resulting surface characteristics to EPA's shipped reference file.

Typical usage::

cfg = AERSURFACEConfig(
    title="RDU - Met Tower, 2021 NLCD",
    site_id="RDU",
    latitude=35.8923, longitude=-78.7819,
    land_cover_file="RDU_2021_NLCD_LC.tiff",
    nlcd_year=2021,
    canopy_file="RDU_2021_NLCD_Can.tiff",
    impervious_file="RDU_2021_NLCD_Imp.tiff",
    frequency="MONTHLY",
    sectors=[(30.0, 60.0, "NONAP"), (60.0, 225.0, "AP"),
             (225.0, 30.0, "NONAP")],
    sfcchar_file="rdu_sfc.txt",
)
deck_text = cfg.to_aersurface_input()

AERSURFACEConfig dataclass

Configuration for one AERSURFACE run.

Parameters:

Name Type Description Default
title str

Deck TITLEONE / TITLETWO lines.

required
title_two str

Deck TITLEONE / TITLETWO lines.

required
site_id str

Short station identifier. Not written to the deck (AERSURFACE has no such keyword); kept for labelling outputs.

required
latitude float

Site location in decimal degrees, written as CENTERLL.

required
longitude float

Site location in decimal degrees, written as CENTERLL.

required
datum str

"NAD83" (default) or "NAD27".

'NAD83'
land_cover_file str

NLCD land-cover raster (GeoTIFF), written as DATAFILE NLCD<year>.

required
nlcd_year int

NLCD release year of land_cover_file.

required
canopy_file Optional[str]

Optional percent-tree-canopy and percent-impervious rasters. canopy_year / impervious_year default to nlcd_year.

None
impervious_file Optional[str]

Optional percent-tree-canopy and percent-impervious rasters. canopy_year / impervious_year default to nlcd_year.

None
site_type str

"PRIMARY" (default) or "SECONDARY", the OPTIONS keyword's first parameter.

'PRIMARY'
zo_method str

"ZORAD" (default, inverse-distance-weighted within a radius) or "ZOEFF".

'ZORAD'
zo_radius_km float

Roughness-averaging radius in km, written as ZORADIUS. EPA default 1.0.

1.0
moisture str

"AVERAGE" (default), "WET" or "DRY" -- the surface moisture regime for the CLIMATE keyword.

'AVERAGE'
snow bool

True (default) if snow is possible at the site, giving CLIMATE ... SNOW; False gives NOSNOW.

True
arid bool

True for arid/semi-arid regions.

False
frequency str

"ANNUAL", "SEASONAL" or "MONTHLY" (default) -- how often surface characteristics vary.

'MONTHLY'
sectors Optional[Sequence[Tuple[float, float, str]]]

Wind sectors as (start_deg, end_deg, "AP" | "NONAP") triples, clockwise from north; the last may wrap past 360. None (default) means one sector covering the compass, using airport.

None
airport bool

Designation for the single default sector when sectors is None.

False
seasons Optional[Dict[str, Sequence[int]]]

Map of season name to the months (1-12) assigned to it. Defaults to :data:DEFAULT_SEASONS. Use WINTERWS for months with continuous snow cover.

None
sfcchar_file str

Output path for the surface-characteristics table AERMET Stage 3 consumes. Written as SFCCHAR.

'aersurface_sfc.txt'
land_cover_grid_file Optional[str]

Optional gridded-value debug outputs (NLCDGRID, CNPYGRID, MPRVGRID).

None
canopy_grid_file Optional[str]

Optional gridded-value debug outputs (NLCDGRID, CNPYGRID, MPRVGRID).

None
impervious_grid_file Optional[str]

Optional gridded-value debug outputs (NLCDGRID, CNPYGRID, MPRVGRID).

None
debug_options List[str]

Values for DEBUGOPT, e.g. ["GRID", "TIFF"].

list()
run bool

False writes RUNORNOT NOT so AERSURFACE checks the deck without processing rasters.

True
extra_co_lines List[str]

Free-form lines appended verbatim inside the CO / OU pathways, for keywords not modelled here.

list()
extra_ou_lines List[str]

Free-form lines appended verbatim inside the CO / OU pathways, for keywords not modelled here.

list()

to_aersurface_input

to_aersurface_input() -> str

Render the AERSURFACE control file as a string.

The layout matches EPA's own example decks: a CO pathway carrying the site, rasters and climate, then an OU pathway naming the outputs.