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 |
required |
title_two
|
str
|
Deck |
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 |
required |
longitude
|
float
|
Site location in decimal degrees, written as |
required |
datum
|
str
|
|
'NAD83'
|
land_cover_file
|
str
|
NLCD land-cover raster (GeoTIFF), written as |
required |
nlcd_year
|
int
|
NLCD release year of |
required |
canopy_file
|
Optional[str]
|
Optional percent-tree-canopy and percent-impervious rasters.
|
None
|
impervious_file
|
Optional[str]
|
Optional percent-tree-canopy and percent-impervious rasters.
|
None
|
site_type
|
str
|
|
'PRIMARY'
|
zo_method
|
str
|
|
'ZORAD'
|
zo_radius_km
|
float
|
Roughness-averaging radius in km, written as |
1.0
|
moisture
|
str
|
|
'AVERAGE'
|
snow
|
bool
|
True (default) if snow is possible at the site, giving
|
True
|
arid
|
bool
|
True for arid/semi-arid regions. |
False
|
frequency
|
str
|
|
'MONTHLY'
|
sectors
|
Optional[Sequence[Tuple[float, float, str]]]
|
Wind sectors as |
None
|
airport
|
bool
|
Designation for the single default sector when |
False
|
seasons
|
Optional[Dict[str, Sequence[int]]]
|
Map of season name to the months (1-12) assigned to it.
Defaults to :data: |
None
|
sfcchar_file
|
str
|
Output path for the surface-characteristics table AERMET Stage 3
consumes. Written as |
'aersurface_sfc.txt'
|
land_cover_grid_file
|
Optional[str]
|
Optional gridded-value debug outputs ( |
None
|
canopy_grid_file
|
Optional[str]
|
Optional gridded-value debug outputs ( |
None
|
impervious_grid_file
|
Optional[str]
|
Optional gridded-value debug outputs ( |
None
|
debug_options
|
List[str]
|
Values for |
list()
|
run
|
bool
|
False writes |
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 ¶
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.