Description Usage Arguments Details Value
View source: R/scan_postfile.R
Reads Fortran unformatted I/O POSTFILE and conver to matrix. Hours are not written individually, nor are source groups as they are saved as attributes of the matrix.
1 | scan_postfile(f, ...)
|
f |
path to an unformatted Fortran I/O binary POST file generated by AERMOD. |
... |
arguments passed thru to |
The AERMOD user's guide (3-186–3-187) describes the format of the file as follows:
“... the resulting unformatted file includes a constant-length record for each of the selected averaging periods calculated during the model run. The first variable of each record is an integer variable (4 bytes) containing the ending date (YYMMDDHH) for the averages on that record. The second variable for each record is an integer variable (4 bytes) for the number of hours in the averaging period. The third variable for each record is a character variable of length eight containing the source group ID. The remaining variables of each record contain the calculated average concentration values for all receptors, in the order in which they were defined in the input runstream.”
The records themselves are delimited by 4 byte integers (at the start and end of each record)
giving the size (in bytes of the record). There is some predictability in the data:
As generated by AERMOD, all records have an equal
number of bytes. Additionally, the hours are numbered sequentially, without gaps, and
the source group and averaging time are the same for each record. Therefore, the only
information that needs to be stored at the record level is the ordered tuple of concentrations
at each receptor for the particular hour and source group. scan_postfile
stores
this information as a matrix, and stores the starting hour, averaging period, and source group name
as attributes of the matrix, rather than repeating the information with each row.
An impact matrix with attributes srcgrp
and hrbaseline
(first hour). The number of hours and number of receptors can be
accessed by calling the built-in dim
function on the matrix.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.