hourly_emissions¶
hourly_emissions ¶
Hourly emission files (SO HOUREMIS) of rate-only records.
AERMOD reads a HOUREMIS file one record per source per meteorological
hour (aermod.f HRLOOP): for every hour of the surface file it loops over
the sources in the order the deck defines them and, for each source
named on a HOUREMIS card, reads the next record of that card's file.
The record's date must equal the met hour (E455) and its source ID the
source being read (E342). A record is free-format fields::
SO HOUREMIS yy mm dd hh srcid qemis
which is the layout of EPA's pset2pa.emi (surface coal mine test
case). For AREA, AREACIRC, AREAPOLY, OPENPIT, VOLUME, LINE, RLINE and
RLINEXT sources the rate is the only hourly value HRQREAD needs (eight
fields; the hourly sigmas VOLUME and the AREA and LINE types may add are
optional); a record with no rate (seven fields) is read as zero emission
for that hour with warning W344. POINT and BUOYLINE sources need more
fields per hour and are not written here.
Two pieces live in this module:
- :func:
write_hourly_emissionswrites the records; - :func:
ap42_wind_profilebuilds the hourly wind factor of AP-42 Section 13.2.4, Equation 1, from an AERMET surface (.SFC) file, so a batch-drop emission can follow the wind hour by hour.
:meth:pyaermod.sources.SourcePathway.add_hourly_emissions combines the
record writer with the HOUREMIS card in the SO pathway.
WindEmissionProfile
dataclass
¶
The AP-42 batch-drop wind factor, hour by hour, for one met file.
AP-42 Section 13.2.4, Equation 1 (rating A) scales the emission
factor of aggregate handling with (U/2.2)**1.3, U the mean wind
speed in m/s, over a stated valid range of 0.6-6.7 m/s. The term is
the same for every particle size, so applying it hourly keeps
per-size runs additive. factors holds, for every hour of the file,
q_h = (clip(U_h, u_min, u_max) / u_ref) ** exponent / mean
where U_h is the surface file's reference-height wind speed (field
16) and the mean is over every hour AERMOD models (calms included),
so the factors average to 1 over them and a constant rate Qs
times q_h keeps the period's nominal emission. Hours AERMOD skips
as missing get q_h = 1 and are left out of the mean: not only a
missing wind (U >= 90 or U < 0) but any hour metext.f CHKMSG flags,
such as a missing wind direction, temperature, Monin-Obukhov length,
mixing height, u* or w*, so counts["missing"] is the number of
missing hours AERMOD reports for the file. Calm hours (U = 0, which
AERMOD never checks for missing data) fall below u_min and are
clipped like any other, and counted in clipped_low; AERMOD
computes no concentration for them.
The reference height the AP-42 equation assumes for U is not stated
in the equation; U_h is used at the height the SFC file gives
(zref_wind).
hourly_emission_record ¶
One SO HOUREMIS record, laid out as EPA's pset2pa.emi.
rate None (or NaN) writes the record without a rate, which AERMOD
reads as zero emission for that hour with warning W344.
write_hourly_emissions ¶
write_hourly_emissions(path: Union[str, Path], hours: Sequence[Sequence[int]], rates: Mapping[str, Sequence[Optional[float]]]) -> Path
Write a HOUREMIS file of hourly emission rates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str or Path
|
File to write. |
required |
hours
|
sequence of (year, month, day, hour)
|
Every hour of the meteorological data AERMOD will read, in file
order (for instance :attr: |
required |
rates
|
mapping of source ID to a sequence of rates
|
The rate of each source for each hour (the SRCPARAM units, e.g.
g/s for VOLUME, g/(s m^2) for AREA and OPENPIT). Records are written hour by
hour, and within each hour in the mapping's order, which must
be the order in which the deck defines these sources (E342
otherwise). |
required |
Returns:
| Type | Description |
|---|---|
Path
|
The file written. |
ap42_wind_profile ¶
ap42_wind_profile(sfc_file: Union[str, Path], *, u_min: float = 0.6, u_max: float = 6.7, exponent: float = 1.3, u_ref: float = 2.2) -> WindEmissionProfile
Build the AP-42 batch-drop wind profile from a .SFC file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sfc_file
|
str or Path
|
AERMET surface file; every hour of it gets a factor, in file order. |
required |
u_min
|
float
|
The valid wind range of AP-42 13.2.4 Eq. 1 (m/s); speeds outside it are clipped to it and counted. |
0.6
|
u_max
|
float
|
The valid wind range of AP-42 13.2.4 Eq. 1 (m/s); speeds outside it are clipped to it and counted. |
0.6
|
exponent
|
float
|
The equation's |
1.3
|
u_ref
|
float
|
The equation's |
1.3
|
Returns:
| Type | Description |
|---|---|
WindEmissionProfile
|
With |