isrm.py
The isrm
object loads, stores, and manipulates the ISRM grid data.
Inputs
isrm_path
: a string representing the folder containing all ISRM dataoutput_region
: a geodataframe of the region for results to be output, as calculated byget_output_region
intool_utils.py
region_of_interest
: the name of the region contained in theoutput_region
load_file
: a Boolean indicating whether or not the file should be loaded (for debugging)verbose
: a Boolean indicating whether or not detailed logging statements should be printeddebug_mode
: a Boolean indicating whether or not to output debug statements
Attributes
nh3_path
,nox_path
,pm25_path
,sox_path
,voc_path
: the filepath strings for each of the primary pollutant ISRM variablesvalid_file
: a Boolean indicating whether or not the file provided is validvalid_geo_file
: a Boolean indicating whether the ISRM geometry file provided is validgeodata
: a geodataframe containing the ISRM feather file informationcrs
: the inherent coordinate reference system associated with the ISRM geometrygeometry
: geospatial information associated with the ISRM geometry
Calculated Attributes
receptor_IDs
: the IDs associated with ISRM receptors within theoutput_region
receptor_geometry
: the geospatial information associated with the ISRM receptors within theoutput_region
PM25
,NH3
,NOx
,SOX
,VOC
: the ISRM matrices for each of the primary pollutants
Internal Functions
get_isrm_files
: appends the file names to the isrm_path input to generate full file pathscheck_path
: checks if the files exist at the paths specified (both data and geo files)load_and_cut
: loads the numpy layers for a pollutant and trims the columns of each vertical layer’s matrix to only include thereceptor_IDs
within theoutput_region
load_isrm
: calls theload_and_cut
function for each ISRM numeric layer and returns a list of pollutant matricesload_geodata
: loads the feather file into a geopandas dataframeclip_isrm
: clips the ISRM receptor geodata to only the relevant ones based on theoutput_region
(i.e., returns thereceptor_IDs
andreceptor_geometry
objects)
External Functions
get_pollutant_layer
: returns the ISRM matrix for a single pollutantmap_isrm
: simple function for mapping the ISRM grid cells