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_regionintool_utils.pyregion_of_interest: the name of the region contained in theoutput_regionload_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 statementsLA_flag: a Boolean indicating whether or not to load layer A of ISRMLB_flag: a Boolean indicating whether or not to load layer B of ISRMLC_flag: a Boolean indicating whether or not to load layer C of ISRM
Attributes
nh3_path_L{A/B/C},nox_path_L{A/B/C},pm25_path_L{A/B/C},sox_path_L{A/B/C},voc_path_L{A/B/C}: the filepath strings for each layer of each primary pollutant ISRM variablevalid_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_regionreceptor_geometry: the geospatial information associated with the ISRM receptors within theoutput_regionPM25,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_IDswithin theoutput_regionload_isrm: calls theload_and_cutfunction for each flagged 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_IDsandreceptor_geometryobjects)
External Functions
get_pollutant_layer: returns a nested dictionary of ISRM layers and pollutant matricesmap_isrm: simple function for mapping the ISRM grid cells