From 948e05447b2c2aeac3a84fc59ec8b85f08eb5d3a Mon Sep 17 00:00:00 2001 From: Carles Tena Date: Wed, 3 Jun 2020 15:16:58 +0200 Subject: [PATCH 1/2] Forced Molecular weight to 1 for PMC, pmc in R-LINE Output --- hermesv3_bu/sectors/traffic_sector.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hermesv3_bu/sectors/traffic_sector.py b/hermesv3_bu/sectors/traffic_sector.py index 43564b8..ce16854 100755 --- a/hermesv3_bu/sectors/traffic_sector.py +++ b/hermesv3_bu/sectors/traffic_sector.py @@ -1493,7 +1493,10 @@ class TrafficSector(Sector): emissions.drop(columns=['geometry'], inplace=True) for poll in emissions.columns.values: - mol_w = self.molecular_weights[self.speciation_map[poll]] + if poll in ['PMC', 'pmc']: + mol_w = 1 + else: + mol_w = self.molecular_weights[self.speciation_map[poll]] # From g/km.h to g/m.s emissions.loc[:, poll] = emissions.loc[:, poll] * mol_w / (1000 * 3600) -- GitLab From 64a6ba2c72f2eba683332fa6b648b6a132e91777 Mon Sep 17 00:00:00 2001 From: Carles Tena Date: Wed, 3 Jun 2020 15:19:16 +0200 Subject: [PATCH 2/2] Try to drop FID for cold emissions. --- hermesv3_bu/sectors/traffic_sector.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hermesv3_bu/sectors/traffic_sector.py b/hermesv3_bu/sectors/traffic_sector.py index ce16854..610518a 100755 --- a/hermesv3_bu/sectors/traffic_sector.py +++ b/hermesv3_bu/sectors/traffic_sector.py @@ -937,7 +937,9 @@ class TrafficSector(Sector): cold_links.drop(columns=['aadt', 'PcHeavy', 'PcMoto', 'PcMoped', 'sp_wd', 'sp_we', 'sp_hour_su', 'sp_hour_mo', 'sp_hour_tu', 'sp_hour_we', 'sp_hour_th', 'sp_hour_fr', 'sp_hour_sa', 'Road_type', 'aadt_m_mn', 'aadt_h_mn', 'aadt_h_wd', 'aadt_h_sat', 'aadt_h_sun', 'aadt_week', - 'fleet_comp', 'road_grad', 'PcLight', 'start_date', 'FID'], inplace=True) + 'fleet_comp', 'road_grad', 'PcLight', 'start_date'], inplace=True) + if 'FID' in cold_links.columns: + cold_links.drop(columns=['FID'], inplace=True) libc.malloc_trim(0) cold_links['centroid'] = cold_links['geometry'].centroid -- GitLab