While I was commenting on the emissions warning branch, I realized we could much more efficiently allocate emissions in the concentration_layer object. Currently, it performs the geometric intersection individually for each pollutant, which is really inefficient! Can we update this code to decompose the current allocate_emissions method of the concentration_layer object?
[x] Create a function within the concentration_layer object (intersect_geometries()) that performs the geometric intersection between the ISRM geometry and the emissions geometry and then returns a crosswalk. I believe this is effectively the intersect object on line 150.
[x] Create a function within the concentration_layer object (allocate_emissions()) that:
[x] calculates the total emissions of that pollutant at the start (old_emis)
[x] uses this crosswalk to multiply the pollutant's emissions by the scaling factor
While I was commenting on the emissions warning branch, I realized we could much more efficiently allocate emissions in the
concentration_layer
object. Currently, it performs the geometric intersection individually for each pollutant, which is really inefficient! Can we update this code to decompose the currentallocate_emissions
method of theconcentration_layer
object?concentration_layer
object (intersect_geometries()
) that performs the geometric intersection between the ISRM geometry and the emissions geometry and then returns a crosswalk. I believe this is effectively theintersect
object on line 150.concentration_layer
object (allocate_emissions()
) that:old_emis
)I think this issue will be related to Consolidate area apportionment functions into one, but should be a good starting point to modularize something that is unnecessarily repetitive!
I think this should take ~30 min to an hour