feat: generate figures for pv production of layer 6

This commit is contained in:
Majid Rezaei 2024-12-09 10:52:24 -05:00
parent 1adb7ced3f
commit 8d2ae716a9
5 changed files with 375 additions and 383 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 MiB

View File

@ -15,10 +15,10 @@ class MontrealFunctionToHubFunction:
def __init__(self):
self._dictionary = {'1000': cte.RESIDENTIAL,
'2089': cte.INDUSTRY,
'2089': cte.WAREHOUSE,
'1921': cte.WAREHOUSE,
'1922': cte.NON_HEATED,
'9100': cte.NON_HEATED,
'1922': cte.RESIDENTIAL,
'9100': cte.RESIDENTIAL,
'6000': cte.MEDIUM_OFFICE,
'5010': cte.STAND_ALONE_RETAIL,
'9490': cte.WAREHOUSE,
@ -33,7 +33,7 @@ class MontrealFunctionToHubFunction:
'6911': cte.CONVENTION_CENTER,
'9510': cte.RESIDENTIAL,
'1990': cte.MID_RISE_APARTMENT,
'1923': cte.NON_HEATED,
'1923': cte.RESIDENTIAL,
'7222': cte.SPORTS_LOCATION,
'5002': cte.STRIP_MALL,
'6111': cte.COMMERCIAL,
@ -42,14 +42,14 @@ class MontrealFunctionToHubFunction:
'5812': cte.FULL_SERVICE_RESTAURANT,
'4621': cte.WAREHOUSE,
'1541': cte.DORMITORY,
'7214': cte.EVENT_LOCATION,
'4821': cte.NON_HEATED,
'9520': cte.NON_HEATED,
'7112': cte.EVENT_LOCATION,
'7214': cte.WAREHOUSE,
'4821': cte.RESIDENTIAL,
'9520': cte.RESIDENTIAL,
'7112': cte.WAREHOUSE,
'6299': cte.OUT_PATIENT_HEALTH_CARE,
'5461': cte.RETAIL_SHOP_WITH_REFRIGERATED_FOOD,
'4632': cte.NON_HEATED,
'7424': cte.EVENT_LOCATION,
'4632': cte.RESIDENTIAL,
'7424': cte.WAREHOUSE,
'5811': cte.FULL_SERVICE_RESTAURANT,
'4113': cte.WAREHOUSE,
'6821': cte.SECONDARY_SCHOOL,
@ -58,22 +58,22 @@ class MontrealFunctionToHubFunction:
'5899': cte.WAREHOUSE,
'5999': cte.STAND_ALONE_RETAIL,
'5834': cte.RESIDENTIAL,
'2699': cte.INDUSTRY,
'2699': cte.WAREHOUSE,
'6812': cte.SECONDARY_SCHOOL,
'6649': cte.WAREHOUSE,
'3999': cte.INDUSTRY,
'3999': cte.WAREHOUSE,
'1553': cte.OFFICE_AND_ADMINISTRATION,
'6999': cte.WAREHOUSE,
'6541': cte.PRIMARY_SCHOOL,
'5831': cte.SMALL_HOTEL,
'6919': cte.OFFICE_AND_ADMINISTRATION,
'9900': cte.WAREHOUSE,
'1551': cte.EVENT_LOCATION,
'1551': cte.WAREHOUSE,
'5511': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'6231': cte.COMMERCIAL,
'6221': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'6599': cte.OFFICE_AND_ADMINISTRATION,
'7119': cte.EVENT_LOCATION,
'7119': cte.WAREHOUSE,
'6214': cte.COMMERCIAL,
'5412': cte.RETAIL_SHOP_WITH_REFRIGERATED_FOOD,
'4839': cte.WAREHOUSE,
@ -87,20 +87,20 @@ class MontrealFunctionToHubFunction:
'7451': cte.SPORTS_LOCATION,
'1539': cte.DORMITORY,
'6376': cte.WAREHOUSE,
'4633': cte.NON_HEATED,
'4633': cte.RESIDENTIAL,
'5813': cte.QUICK_SERVICE_RESTAURANT,
'6339': cte.COMMERCIAL,
'5911': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'5651': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'5971': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'4550': cte.NON_HEATED,
'4550': cte.RESIDENTIAL,
'5620': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'7611': cte.NON_HEATED,
'7611': cte.RESIDENTIAL,
'5531': cte.WAREHOUSE,
'6629': cte.WAREHOUSE,
'6521': cte.MEDIUM_OFFICE,
'7639': cte.WAREHOUSE,
'3399': cte.INDUSTRY,
'3399': cte.WAREHOUSE,
'3019': cte.WAREHOUSE,
'6551': cte.MEDIUM_OFFICE,
'5413': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
@ -123,10 +123,10 @@ class MontrealFunctionToHubFunction:
'4111': cte.WAREHOUSE,
'3280': cte.WAREHOUSE,
'6721': cte.OFFICE_AND_ADMINISTRATION,
'9459': cte.NON_HEATED,
'7113': cte.EVENT_LOCATION,
'9459': cte.RESIDENTIAL,
'7113': cte.WAREHOUSE,
'4743': cte.MEDIUM_OFFICE,
'7211': cte.EVENT_LOCATION,
'7211': cte.WAREHOUSE,
'6513': cte.HOSPITAL,
'6813': cte.SECONDARY_SCHOOL,
'5921': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
@ -137,16 +137,16 @@ class MontrealFunctionToHubFunction:
'1890': cte.DORMITORY,
'6372': cte.WAREHOUSE,
'1600': cte.SMALL_HOTEL,
'9451': cte.NON_HEATED,
'9451': cte.RESIDENTIAL,
'6359': cte.WAREHOUSE,
'2240': cte.INDUSTRY,
'2240': cte.WAREHOUSE,
'1559': cte.OFFICE_AND_ADMINISTRATION,
'1543': cte.DORMITORY,
'6760': cte.MEDIUM_OFFICE,
'4771': cte.MOTION_PICTURE_THEATRE,
'1552': cte.DORMITORY,
'3994': cte.INDUSTRY,
'6243': cte.NON_HEATED,
'3994': cte.WAREHOUSE,
'6243': cte.RESIDENTIAL,
'6835': cte.SECONDARY_SCHOOL,
'5004': cte.STRIP_MALL,
'6791': cte.OFFICE_AND_ADMINISTRATION,
@ -168,7 +168,7 @@ class MontrealFunctionToHubFunction:
'6532': cte.OFFICE_AND_ADMINISTRATION,
'6518': cte.OUT_PATIENT_HEALTH_CARE,
'5199': cte.WAREHOUSE,
'3840': cte.INDUSTRY,
'3840': cte.WAREHOUSE,
'2051': cte.MEDIUM_OFFICE,
'7290': cte.OFFICE_AND_ADMINISTRATION,
'5253': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
@ -185,104 +185,104 @@ class MontrealFunctionToHubFunction:
'7219': cte.OFFICE_AND_ADMINISTRATION,
'7117': cte.WAREHOUSE,
'5005': cte.STAND_ALONE_RETAIL,
'4561': cte.NON_HEATED,
'4561': cte.RESIDENTIAL,
'5631': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'4623': cte.WAREHOUSE,
'4590': cte.WAREHOUSE,
'3899': cte.INDUSTRY,
'3899': cte.WAREHOUSE,
'6563': cte.COMMERCIAL,
'5399': cte.STAND_ALONE_RETAIL,
'6241': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'6351': cte.RETAIL_SHOP_WITH_REFRIGERATED_FOOD,
'2270': cte.INDUSTRY,
'2270': cte.WAREHOUSE,
'5132': cte.WAREHOUSE,
'4221': cte.WAREHOUSE,
'6253': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'5640': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'3299': cte.INDUSTRY,
'3299': cte.WAREHOUSE,
'6831': cte.SECONDARY_SCHOOL,
'2012': cte.INDUSTRY,
'3620': cte.INDUSTRY,
'2012': cte.WAREHOUSE,
'3620': cte.WAREHOUSE,
'6519': cte.OUT_PATIENT_HEALTH_CARE,
'2291': cte.INDUSTRY,
'2291': cte.WAREHOUSE,
'5311': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'5931': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'4611': cte.WAREHOUSE,
'4719': cte.STAND_ALONE_RETAIL,
'5693': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'4490': cte.INDUSTRY,
'4490': cte.WAREHOUSE,
'5823': cte.FULL_SERVICE_RESTAURANT,
'2045': cte.INDUSTRY,
'2045': cte.WAREHOUSE,
'6542': cte.HOSPITAL,
'2014': cte.INDUSTRY,
'2014': cte.WAREHOUSE,
'6375': cte.WAREHOUSE,
'2799': cte.INDUSTRY,
'2799': cte.WAREHOUSE,
'6612': cte.WAREHOUSE,
'4222': cte.WAREHOUSE,
'7191': cte.EVENT_LOCATION,
'7191': cte.WAREHOUSE,
'6352': cte.WAREHOUSE,
'5836': cte.COMMERCIAL,
'5952': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'1512': cte.DORMITORY,
'5948': cte.WAREHOUSE,
'3580': cte.INDUSTRY,
'3580': cte.WAREHOUSE,
'5391': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'6997': cte.OFFICE_AND_ADMINISTRATION,
'6539': cte.OFFICE_AND_ADMINISTRATION,
'2899': cte.INDUSTRY,
'2899': cte.WAREHOUSE,
'1100': cte.SINGLE_FAMILY_HOUSE,
'6348': cte.WAREHOUSE,
'7499': cte.EVENT_LOCATION,
'7499': cte.WAREHOUSE,
'6373': cte.WAREHOUSE,
'3539': cte.INDUSTRY,
'3539': cte.WAREHOUSE,
'4922': cte.WAREHOUSE,
'6731': cte.OFFICE_AND_ADMINISTRATION,
'6132': cte.MEDIUM_OFFICE,
'2073': cte.INDUSTRY,
'2073': cte.WAREHOUSE,
'4761': cte.COMMERCIAL,
'7312': cte.NON_HEATED,
'7312': cte.RESIDENTIAL,
'7425': cte.SPORTS_LOCATION,
'6634': cte.INDUSTRY,
'6634': cte.WAREHOUSE,
'6639': cte.WAREHOUSE,
'3231': cte.INDUSTRY,
'3231': cte.WAREHOUSE,
'6569': cte.RETAIL_SHOP_WITH_REFRIGERATED_FOOD,
'2499': cte.INDUSTRY,
'7199': cte.EVENT_LOCATION,
'7114': cte.EVENT_LOCATION,
'2499': cte.WAREHOUSE,
'7199': cte.WAREHOUSE,
'7114': cte.WAREHOUSE,
'4733': cte.COMMERCIAL,
'4112': cte.WAREHOUSE,
'7129': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'7620': cte.NON_HEATED,
'7620': cte.RESIDENTIAL,
'9390': cte.WAREHOUSE,
'1529': cte.OFFICE_AND_ADMINISTRATION,
'7417': cte.NON_HEATED,
'7417': cte.RESIDENTIAL,
'8221': cte.OUT_PATIENT_HEALTH_CARE,
'6598': cte.OUT_PATIENT_HEALTH_CARE,
'6515': cte.OUT_PATIENT_HEALTH_CARE,
'3719': cte.WAREHOUSE,
'2471': cte.INDUSTRY,
'7433': cte.NON_HEATED,
'2471': cte.WAREHOUSE,
'7433': cte.WAREHOUSE,
'6413': cte.WAREHOUSE,
'3459': cte.INDUSTRY,
'3459': cte.WAREHOUSE,
'6152': cte.MEDIUM_OFFICE,
'2093': cte.INDUSTRY,
'3031': cte.INDUSTRY,
'2093': cte.WAREHOUSE,
'3031': cte.WAREHOUSE,
'5251': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'5394': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'5141': cte.STRIP_MALL,
'7419': cte.SPORTS_LOCATION,
'4293': cte.WAREHOUSE,
'6834': cte.SECONDARY_SCHOOL,
'2092': cte.INDUSTRY,
'2072': cte.INDUSTRY,
'2092': cte.WAREHOUSE,
'2072': cte.WAREHOUSE,
'6712': cte.MEDIUM_OFFICE,
'4411': cte.WAREHOUSE,
'4562': cte.NON_HEATED,
'2096': cte.INDUSTRY,
'4562': cte.RESIDENTIAL,
'2096': cte.WAREHOUSE,
'5997': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'7212': cte.EVENT_LOCATION,
'7212': cte.WAREHOUSE,
'6713': cte.MEDIUM_OFFICE,
'9212': cte.NON_HEATED,
'9212': cte.RESIDENTIAL,
'6725': cte.OFFICE_AND_ADMINISTRATION,
'9410': cte.RESIDENTIAL,
'4211': cte.WAREHOUSE,
@ -294,53 +294,53 @@ class MontrealFunctionToHubFunction:
'6369': cte.SECONDARY_SCHOOL,
'5171': cte.STRIP_MALL,
'5003': cte.STRIP_MALL,
'3630': cte.INDUSTRY,
'3630': cte.WAREHOUSE,
'5521': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'6531': cte.OUT_PATIENT_HEALTH_CARE,
'7413': cte.WAREHOUSE,
'3239': cte.INDUSTRY,
'3239': cte.WAREHOUSE,
'4715': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'6365': cte.UNIVERSITY,
'6121': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'6611': cte.WAREHOUSE,
'3649': cte.INDUSTRY,
'2892': cte.INDUSTRY,
'3649': cte.WAREHOUSE,
'2892': cte.WAREHOUSE,
'6269': cte.OUT_PATIENT_HEALTH_CARE,
'2020': cte.INDUSTRY,
'2020': cte.WAREHOUSE,
'6621': cte.WAREHOUSE,
'6312': cte.NON_HEATED,
'6416': cte.INDUSTRY,
'6312': cte.RESIDENTIAL,
'6416': cte.WAREHOUSE,
'5712': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'2261': cte.INDUSTRY,
'2931': cte.INDUSTRY,
'3011': cte.INDUSTRY,
'2261': cte.WAREHOUSE,
'2931': cte.WAREHOUSE,
'3011': cte.WAREHOUSE,
'6499': cte.STAND_ALONE_RETAIL,
'3599': cte.INDUSTRY,
'2299': cte.INDUSTRY,
'3831': cte.INDUSTRY,
'2410': cte.INDUSTRY,
'3599': cte.WAREHOUSE,
'2299': cte.WAREHOUSE,
'3831': cte.WAREHOUSE,
'2410': cte.WAREHOUSE,
'5112': cte.STRIP_MALL,
'5941': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'6822': cte.SECONDARY_SCHOOL,
'6753': cte.WAREHOUSE,
'5149': cte.STRIP_MALL,
'3190': cte.INDUSTRY,
'3190': cte.WAREHOUSE,
'6414': cte.WAREHOUSE,
'6633': cte.WAREHOUSE,
'3895': cte.INDUSTRY,
'3895': cte.WAREHOUSE,
'5133': cte.STRIP_MALL,
'2082': cte.INDUSTRY,
'2082': cte.WAREHOUSE,
'5512': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'9420': cte.NON_HEATED,
'9420': cte.RESIDENTIAL,
'6543': cte.HOSPITAL,
'4841': cte.INDUSTRY,
'4851': cte.INDUSTRY,
'4841': cte.WAREHOUSE,
'4851': cte.WAREHOUSE,
'5432': cte.STRIP_MALL,
'3711': cte.INDUSTRY,
'3460': cte.INDUSTRY,
'2087': cte.INDUSTRY,
'3711': cte.WAREHOUSE,
'3460': cte.WAREHOUSE,
'2087': cte.WAREHOUSE,
'1522': cte.HALL,
'8549': cte.INDUSTRY,
'8549': cte.WAREHOUSE,
'6242': cte.WAREHOUSE,
'6412': cte.WAREHOUSE,
'6811': cte.SECONDARY_SCHOOL,
@ -351,175 +351,175 @@ class MontrealFunctionToHubFunction:
'5212': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'5211': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'7990': cte.HALL,
'3714': cte.INDUSTRY,
'3714': cte.WAREHOUSE,
'6593': cte.SECONDARY_SCHOOL,
'5172': cte.STRIP_MALL,
'5955': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'6635': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'3799': cte.INDUSTRY,
'2819': cte.INDUSTRY,
'3799': cte.WAREHOUSE,
'2819': cte.WAREHOUSE,
'5894': cte.QUICK_SERVICE_RESTAURANT,
'9530': cte.NON_HEATED,
'3159': cte.INDUSTRY,
'9530': cte.RESIDENTIAL,
'3159': cte.WAREHOUSE,
'3713': cte.WAREHOUSE,
'3894': cte.INDUSTRY,
'3894': cte.WAREHOUSE,
'5721': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'5169': cte.STRIP_MALL,
'5593': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'6631': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'5731': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'2739': cte.INDUSTRY,
'2739': cte.WAREHOUSE,
'6619': cte.WAREHOUSE,
'6815': cte.SECONDARY_SCHOOL,
'5320': cte.STRIP_MALL,
'3261': cte.INDUSTRY,
'3261': cte.WAREHOUSE,
'6394': cte.WAREHOUSE,
'2031': cte.RETAIL_SHOP_WITH_REFRIGERATED_FOOD,
'6423': cte.WAREHOUSE,
'3162': cte.INDUSTRY,
'3162': cte.WAREHOUSE,
'5814': cte.QUICK_SERVICE_RESTAURANT,
'6653': cte.WAREHOUSE,
'2213': cte.INDUSTRY,
'2046': cte.INDUSTRY,
'2213': cte.WAREHOUSE,
'2046': cte.WAREHOUSE,
'6251': cte.COMMERCIAL,
'3650': cte.INDUSTRY,
'4799': cte.NON_HEATED,
'3650': cte.WAREHOUSE,
'4799': cte.RESIDENTIAL,
'5832': cte.SMALL_HOTEL,
'4229': cte.WAREHOUSE,
'4842': cte.WAREHOUSE,
'5163': cte.STRIP_MALL,
'5148': cte.STRIP_MALL,
'2011': cte.INDUSTRY,
'2011': cte.WAREHOUSE,
'5361': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'2999': cte.INDUSTRY,
'2999': cte.WAREHOUSE,
'6522': cte.MEDIUM_OFFICE,
'7121': cte.MUSEUM,
'7221': cte.SPORTS_LOCATION,
'1549': cte.OFFICE_AND_ADMINISTRATION,
'5652': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'3331': cte.INDUSTRY,
'3331': cte.WAREHOUSE,
'6219': cte.WAREHOUSE,
'5421': cte.RETAIL_SHOP_WITH_REFRIGERATED_FOOD,
'3861': cte.INDUSTRY,
'3919': cte.INDUSTRY,
'3861': cte.WAREHOUSE,
'3919': cte.WAREHOUSE,
'6441': cte.WAREHOUSE,
'6648': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'8199': cte.INDUSTRY,
'8199': cte.WAREHOUSE,
'6832': cte.SECONDARY_SCHOOL,
'6992': cte.MEDIUM_OFFICE,
'1521': cte.EVENT_LOCATION,
'1521': cte.WAREHOUSE,
'6349': cte.WAREHOUSE,
'4921': cte.WAREHOUSE,
'6498': cte.WAREHOUSE,
'6415': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'4122': cte.WAREHOUSE,
'4219': cte.WAREHOUSE,
'9440': cte.NON_HEATED,
'9440': cte.RESIDENTIAL,
'4782': cte.DATACENTER,
'2619': cte.INDUSTRY,
'2619': cte.WAREHOUSE,
'7229': cte.SPORTS_LOCATION,
'2079': cte.INDUSTRY,
'2320': cte.INDUSTRY,
'3259': cte.INDUSTRY,
'3931': cte.INDUSTRY,
'2079': cte.WAREHOUSE,
'2320': cte.WAREHOUSE,
'3259': cte.WAREHOUSE,
'3931': cte.WAREHOUSE,
'5470': cte.RETAIL_SHOP_WITH_REFRIGERATED_FOOD,
'4890': cte.WAREHOUSE,
'5599': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'3270': cte.INDUSTRY,
'3270': cte.WAREHOUSE,
'5186': cte.STRIP_MALL,
'2043': cte.INDUSTRY,
'2043': cte.WAREHOUSE,
'6733': cte.WAREHOUSE,
'4311': cte.EVENT_LOCATION,
'3451': cte.INDUSTRY,
'2812': cte.INDUSTRY,
'2130': cte.INDUSTRY,
'4311': cte.WAREHOUSE,
'3451': cte.WAREHOUSE,
'2812': cte.WAREHOUSE,
'2130': cte.WAREHOUSE,
'7449': cte.WAREHOUSE,
'2919': cte.INDUSTRY,
'2919': cte.WAREHOUSE,
'4315': cte.WAREHOUSE,
'3569': cte.INDUSTRY,
'7399': cte.EVENT_LOCATION,
'3569': cte.WAREHOUSE,
'7399': cte.WAREHOUSE,
'6160': cte.OFFICE_AND_ADMINISTRATION,
'7412': cte.NON_HEATED,
'2084': cte.INDUSTRY,
'3870': cte.INDUSTRY,
'7412': cte.RESIDENTIAL,
'2084': cte.WAREHOUSE,
'3870': cte.WAREHOUSE,
'5001': cte.STRIP_MALL,
'3411': cte.INDUSTRY,
'1702': cte.NON_HEATED,
'3243': cte.INDUSTRY,
'3411': cte.WAREHOUSE,
'1702': cte.RESIDENTIAL,
'3243': cte.WAREHOUSE,
'4926': cte.MEDIUM_OFFICE,
'3490': cte.INDUSTRY,
'2219': cte.INDUSTRY,
'2829': cte.INDUSTRY,
'3490': cte.WAREHOUSE,
'2219': cte.WAREHOUSE,
'2829': cte.WAREHOUSE,
'4399': cte.WAREHOUSE,
'4319': cte.WAREHOUSE,
'2039': cte.INDUSTRY,
'2039': cte.WAREHOUSE,
'8139': cte.GREEN_HOUSE,
'5146': cte.STRIP_MALL,
'3396': cte.INDUSTRY,
'3396': cte.WAREHOUSE,
'5161': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'2091': cte.INDUSTRY,
'3850': cte.INDUSTRY,
'2091': cte.WAREHOUSE,
'3850': cte.WAREHOUSE,
'5241': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'3049': cte.INDUSTRY,
'3049': cte.WAREHOUSE,
'5181': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'2627': cte.INDUSTRY,
'3412': cte.INDUSTRY,
'2627': cte.WAREHOUSE,
'3412': cte.WAREHOUSE,
'5220': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'3699': cte.INDUSTRY,
'3699': cte.WAREHOUSE,
'4929': cte.WAREHOUSE,
'3551': cte.INDUSTRY,
'3551': cte.WAREHOUSE,
'5198': cte.STRIP_MALL,
'6646': cte.NON_HEATED,
'6646': cte.RESIDENTIAL,
'5189': cte.STRIP_MALL,
'5312': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'4214': cte.WAREHOUSE,
'3410': cte.INDUSTRY,
'3410': cte.WAREHOUSE,
'4859': cte.WAREHOUSE,
'2736': cte.INDUSTRY,
'2736': cte.WAREHOUSE,
'6642': cte.WAREHOUSE,
'3921': cte.INDUSTRY,
'3921': cte.WAREHOUSE,
'5815': cte.FULL_SERVICE_RESTAURANT,
'6514': cte.OUT_PATIENT_HEALTH_CARE,
'8399': cte.WAREHOUSE,
'2250': cte.INDUSTRY,
'2250': cte.WAREHOUSE,
'6378': cte.WAREHOUSE,
'6343': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'2652': cte.INDUSTRY,
'3552': cte.INDUSTRY,
'2891': cte.INDUSTRY,
'2652': cte.WAREHOUSE,
'3552': cte.WAREHOUSE,
'2891': cte.WAREHOUSE,
'6368': cte.SECONDARY_SCHOOL,
'3559': cte.INDUSTRY,
'3559': cte.WAREHOUSE,
'5145': cte.STRIP_MALL,
'3244': cte.INDUSTRY,
'3292': cte.INDUSTRY,
'3244': cte.WAREHOUSE,
'3292': cte.WAREHOUSE,
'4510': cte.WAREHOUSE,
'7423': cte.SPORTS_LOCATION,
'5370': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'4824': cte.WAREHOUSE,
'4832': cte.INDUSTRY,
'4832': cte.WAREHOUSE,
'6573': cte.HEALTH_CARE,
'6623': cte.NON_HEATED,
'6623': cte.RESIDENTIAL,
'5162': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'4612': cte.WAREHOUSE,
'2629': cte.INDUSTRY,
'3291': cte.INDUSTRY,
'3229': cte.INDUSTRY,
'2629': cte.WAREHOUSE,
'3291': cte.WAREHOUSE,
'3229': cte.WAREHOUSE,
'5829': cte.STAND_ALONE_RETAIL,
'2932': cte.INDUSTRY,
'2932': cte.WAREHOUSE,
'5594': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'2722': cte.INDUSTRY,
'2811': cte.INDUSTRY,
'2235': cte.INDUSTRY,
'2722': cte.WAREHOUSE,
'2811': cte.WAREHOUSE,
'2235': cte.WAREHOUSE,
'5953': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'3170': cte.INDUSTRY,
'3662': cte.INDUSTRY,
'3170': cte.WAREHOUSE,
'3662': cte.WAREHOUSE,
'4879': cte.WAREHOUSE,
'2074': cte.INDUSTRY,
'2074': cte.WAREHOUSE,
'7429': cte.SPORTS_LOCATION,
'4843': cte.WAREHOUSE,
'6335': cte.OFFICE_AND_ADMINISTRATION,
'4116': cte.WAREHOUSE,
'2622': cte.INDUSTRY,
'2622': cte.WAREHOUSE,
'6112': cte.OFFICE_AND_ADMINISTRATION,
'4875': cte.WAREHOUSE,
'4792': cte.WAREHOUSE_REFRIGERATED,
@ -527,118 +527,118 @@ class MontrealFunctionToHubFunction:
'6425': cte.WAREHOUSE,
'6212': cte.WAREHOUSE,
'5147': cte.STRIP_MALL,
'2460': cte.INDUSTRY,
'2460': cte.WAREHOUSE,
'4874': cte.WAREHOUSE,
'6743': cte.DORMITORY,
'3241': cte.INDUSTRY,
'3241': cte.WAREHOUSE,
'5123': cte.STRIP_MALL,
'4833': cte.NON_HEATED,
'9470': cte.NON_HEATED,
'3932': cte.INDUSTRY,
'4833': cte.RESIDENTIAL,
'9470': cte.RESIDENTIAL,
'3932': cte.WAREHOUSE,
'4292': cte.WAREHOUSE,
'6424': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'6139': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'2624': cte.INDUSTRY,
'2624': cte.WAREHOUSE,
'3915': cte.WAREHOUSE,
'7233': cte.CONVENTION_CENTER,
'5184': cte.STRIP_MALL,
'2099': cte.INDUSTRY,
'2099': cte.WAREHOUSE,
'5129': cte.RETAIL_SHOP_WITH_REFRIGERATED_FOOD,
'5913': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'5717': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'4712': cte.NON_HEATED,
'4712': cte.RESIDENTIAL,
'5142': cte.STRIP_MALL,
'3210': cte.INDUSTRY,
'3210': cte.WAREHOUSE,
'4834': cte.WAREHOUSE,
'3456': cte.INDUSTRY,
'2075': cte.INDUSTRY,
'3020': cte.INDUSTRY,
'3821': cte.INDUSTRY,
'3456': cte.WAREHOUSE,
'2075': cte.WAREHOUSE,
'3020': cte.WAREHOUSE,
'3821': cte.WAREHOUSE,
'6613': cte.MEDIUM_OFFICE,
'4826': cte.WAREHOUSE,
'5839': cte.MULTI_FAMILY_HOUSE,
'4316': cte.WAREHOUSE,
'6592': cte.OFFICE_AND_ADMINISTRATION,
'3971': cte.INDUSTRY,
'3972': cte.INDUSTRY,
'2694': cte.INDUSTRY,
'3882': cte.INDUSTRY,
'3119': cte.INDUSTRY,
'2495': cte.INDUSTRY,
'3971': cte.WAREHOUSE,
'3972': cte.WAREHOUSE,
'2694': cte.WAREHOUSE,
'3882': cte.WAREHOUSE,
'3119': cte.WAREHOUSE,
'2495': cte.WAREHOUSE,
'4759': cte.MEDIUM_OFFICE,
'6439': cte.WAREHOUSE,
'6643': cte.WAREHOUSE,
'3470': cte.INDUSTRY,
'3531': cte.INDUSTRY,
'4823': cte.NON_HEATED,
'2293': cte.INDUSTRY,
'3532': cte.INDUSTRY,
'3913': cte.INDUSTRY,
'3470': cte.WAREHOUSE,
'3531': cte.WAREHOUSE,
'4823': cte.RESIDENTIAL,
'2293': cte.WAREHOUSE,
'3532': cte.WAREHOUSE,
'3913': cte.WAREHOUSE,
'6816': cte.OFFICE_AND_ADMINISTRATION,
'3562': cte.INDUSTRY,
'3562': cte.WAREHOUSE,
'6496': cte.COMMERCIAL,
'4119': cte.WAREHOUSE,
'6533': cte.OUT_PATIENT_HEALTH_CARE,
'6814': cte.PRIMARY_SCHOOL,
'6353': cte.WAREHOUSE,
'3392': cte.INDUSTRY,
'3392': cte.WAREHOUSE,
'5114': cte.STRIP_MALL,
'5131': cte.STRIP_MALL,
'3641': cte.INDUSTRY,
'2614': cte.INDUSTRY,
'3661': cte.INDUSTRY,
'2081': cte.INDUSTRY,
'3340': cte.INDUSTRY,
'3641': cte.WAREHOUSE,
'2614': cte.WAREHOUSE,
'3661': cte.WAREHOUSE,
'2081': cte.WAREHOUSE,
'3340': cte.WAREHOUSE,
'4928': cte.WORKSHOP,
'3712': cte.INDUSTRY,
'3253': cte.INDUSTRY,
'3860': cte.INDUSTRY,
'3892': cte.INDUSTRY,
'2992': cte.INDUSTRY,
'3712': cte.WAREHOUSE,
'3253': cte.WAREHOUSE,
'3860': cte.WAREHOUSE,
'3892': cte.WAREHOUSE,
'2992': cte.WAREHOUSE,
'5598': cte.RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD,
'4825': cte.NON_HEATED,
'2071': cte.INDUSTRY,
'6495': cte.INDUSTRY,
'2914': cte.INDUSTRY,
'3182': cte.INDUSTRY,
'3791': cte.INDUSTRY,
'3992': cte.INDUSTRY,
'3114': cte.INDUSTRY,
'4825': cte.RESIDENTIAL,
'2071': cte.WAREHOUSE,
'6495': cte.WAREHOUSE,
'2914': cte.WAREHOUSE,
'3182': cte.WAREHOUSE,
'3791': cte.WAREHOUSE,
'3992': cte.WAREHOUSE,
'3114': cte.WAREHOUSE,
'7920': cte.OFFICE_AND_ADMINISTRATION,
'5891': cte.RESTAURANT,
'5835': cte.SMALL_HOTEL,
'6565': cte.HEALTH_CARE,
'3391': cte.INDUSTRY,
'6615': cte.INDUSTRY,
'3883': cte.INDUSTRY,
'2032': cte.INDUSTRY,
'2994': cte.INDUSTRY,
'4871': cte.INDUSTRY,
'3391': cte.WAREHOUSE,
'6615': cte.WAREHOUSE,
'3883': cte.WAREHOUSE,
'2032': cte.WAREHOUSE,
'2994': cte.WAREHOUSE,
'4871': cte.WAREHOUSE,
'5113': cte.WORKSHOP,
'3571': cte.INDUSTRY,
'2342': cte.INDUSTRY,
'3911': cte.INDUSTRY,
'3571': cte.WAREHOUSE,
'2342': cte.WAREHOUSE,
'3911': cte.WAREHOUSE,
'7444': cte.EDUCATION,
'2221': cte.INDUSTRY,
'2221': cte.WAREHOUSE,
'8192': cte.FARM,
'2439': cte.INDUSTRY,
'3891': cte.INDUSTRY,
'2439': cte.WAREHOUSE,
'3891': cte.WAREHOUSE,
'6354': cte.WORKSHOP,
'4815': cte.NON_HEATED,
'4815': cte.RESIDENTIAL,
'6651': cte.WORKSHOP,
'2822': cte.INDUSTRY,
'2821': cte.INDUSTRY,
'2822': cte.WAREHOUSE,
'2821': cte.WAREHOUSE,
'1211': cte.RESIDENTIAL,
'8133': cte.INDUSTRY,
'8133': cte.WAREHOUSE,
'6572': cte.HEALTH_CARE,
'2734': cte.INDUSTRY,
'8132': cte.INDUSTRY,
'6659': cte.INDUSTRY,
'2734': cte.WAREHOUSE,
'8132': cte.WAREHOUSE,
'6659': cte.WAREHOUSE,
'6332': cte.COMMERCIAL,
'6595': cte.COMMERCIAL,
'5393': cte.COMMERCIAL,
'5450': cte.COMMERCIAL,
'8127': cte.INDUSTRY,
'8127': cte.WAREHOUSE,
'5595': cte.COMMERCIAL,
'6571': cte.HEALTH_CARE,
'5030': cte.COMMERCIAL,
@ -646,41 +646,41 @@ class MontrealFunctionToHubFunction:
'7516': cte.SPORTS_LOCATION,
'5523': cte.COMMERCIAL,
'5722': cte.COMMERCIAL,
'4732': cte.NON_HEATED,
'4732': cte.RESIDENTIAL,
'7491': cte.SPORTS_LOCATION,
'3262': cte.INDUSTRY,
'8543': cte.INDUSTRY,
'3262': cte.WAREHOUSE,
'8543': cte.WAREHOUSE,
'6129': cte.COMMERCIAL,
'5362': cte.COMMERCIAL,
'8122': cte.INDUSTRY,
'8122': cte.WAREHOUSE,
'5597': cte.COMMERCIAL,
'3269': cte.INDUSTRY,
'3269': cte.WAREHOUSE,
'5331': cte.COMMERCIAL,
'5522': cte.COMMERCIAL,
'7421': cte.WAREHOUSE,
'2723': cte.INDUSTRY,
'4822': cte.NON_HEATED,
'2723': cte.WAREHOUSE,
'4822': cte.RESIDENTIAL,
'6319': cte.COMMERCIAL,
'8131': cte.INDUSTRY,
'8131': cte.WAREHOUSE,
'7422': cte.SPORTS_LOCATION,
'3140': cte.INDUSTRY,
'9220': cte.NON_HEATED,
'4852': cte.NON_HEATED,
'3694': cte.INDUSTRY,
'3140': cte.WAREHOUSE,
'9220': cte.RESIDENTIAL,
'4852': cte.RESIDENTIAL,
'3694': cte.WAREHOUSE,
'6632': cte.COMMERCIAL,
'6656': cte.WAREHOUSE,
'8322': cte.INDUSTRY,
'8126': cte.INDUSTRY,
'8322': cte.WAREHOUSE,
'8126': cte.WAREHOUSE,
'6638': cte.COMMERCIAL,
'2292': cte.INDUSTRY,
'2292': cte.WAREHOUSE,
'6392': cte.COMMERCIAL,
'4313': cte.WAREHOUSE,
'4312': cte.NON_HEATED,
'4312': cte.RESIDENTIAL,
'6417': cte.COMMERCIAL,
'6234': cte.COMMERCIAL,
'6254': cte.COMMERCIAL,
'7396': cte.SPORTS_LOCATION,
'3579': cte.INDUSTRY,
'3579': cte.WAREHOUSE,
'6596': cte.COMMERCIAL,
'5397': cte.COMMERCIAL,
'5946': cte.COMMERCIAL,
@ -693,27 +693,27 @@ class MontrealFunctionToHubFunction:
'6333': cte.COMMERCIAL,
'5932': cte.COMMERCIAL,
'5332': cte.COMMERCIAL,
'3510': cte.INDUSTRY,
'3510': cte.WAREHOUSE,
'5732': cte.COMMERCIAL,
'4811': cte.INDUSTRY,
'4811': cte.WAREHOUSE,
'5422': cte.COMMERCIAL,
'5596': cte.COMMERCIAL,
'5740': cte.COMMERCIAL,
'3232': cte.INDUSTRY,
'3232': cte.WAREHOUSE,
'5933': cte.COMMERCIAL,
'5992': cte.COMMERCIAL,
'3443': cte.INDUSTRY,
'2472': cte.INDUSTRY,
'3443': cte.WAREHOUSE,
'2472': cte.WAREHOUSE,
'6151': cte.COMMERCIAL,
'3263': cte.INDUSTRY,
'3263': cte.WAREHOUSE,
'5396': cte.COMMERCIAL,
'3249': cte.INDUSTRY,
'3249': cte.WAREHOUSE,
'4752': cte.COMMERCIAL,
'6836': cte.EDUCATION,
'3934': cte.INDUSTRY,
'4849': cte.NON_HEATED,
'4749': cte.NON_HEATED,
'3441': cte.INDUSTRY,
'3934': cte.WAREHOUSE,
'4849': cte.RESIDENTIAL,
'4749': cte.RESIDENTIAL,
'3441': cte.WAREHOUSE,
'7441': cte.SPORTS_LOCATION,
'6320': cte.COMMERCIAL,
'6191': cte.COMMERCIAL,
@ -722,30 +722,30 @@ class MontrealFunctionToHubFunction:
'4731': cte.COMMERCIAL,
'5680': cte.COMMERCIAL,
'9458': cte.COMMERCIAL,
'2737': cte.INDUSTRY,
'3264': cte.INDUSTRY,
'2737': cte.WAREHOUSE,
'3264': cte.WAREHOUSE,
'6233': cte.COMMERCIAL,
'4819': cte.INDUSTRY,
'4819': cte.WAREHOUSE,
'5183': cte.COMMERCIAL,
'6724': cte.OFFICE_AND_ADMINISTRATION,
'6131': cte.COMMERCIAL,
'8121': cte.INDUSTRY,
'8121': cte.WAREHOUSE,
'6652': cte.WAREHOUSE,
'5983': cte.COMMERCIAL,
'7393': cte.SPORTS_LOCATION,
'3350': cte.INDUSTRY,
'3350': cte.WAREHOUSE,
'6397': cte.COMMERCIAL,
'3594': cte.INDUSTRY,
'3594': cte.WAREHOUSE,
'6637': cte.WAREHOUSE,
'5191': cte.COMMERCIAL,
'6636': cte.WAREHOUSE,
'2061': cte.INDUSTRY,
'2049': cte.INDUSTRY,
'2061': cte.WAREHOUSE,
'2049': cte.WAREHOUSE,
'8299': cte.WAREHOUSE,
'8180': cte.COMMERCIAL,
'6516': cte.HEALTH_CARE,
'6597': cte.OFFICE_AND_ADMINISTRATION,
'2933': cte.INDUSTRY,
'2933': cte.WAREHOUSE,
'5154': cte.COMMERCIAL,
'6371': cte.WAREHOUSE,
'5995': cte.COMMERCIAL,
@ -756,35 +756,35 @@ class MontrealFunctionToHubFunction:
'5242': cte.COMMERCIAL,
'5892': cte.COMMERCIAL,
'5719': cte.COMMERCIAL,
'2895': cte.INDUSTRY,
'2895': cte.WAREHOUSE,
'7415': cte.SPORTS_LOCATION,
'4563': cte.NON_HEATED,
'3014': cte.INDUSTRY,
'4563': cte.RESIDENTIAL,
'3014': cte.WAREHOUSE,
'5691': cte.COMMERCIAL,
'3111': cte.INDUSTRY,
'8198': cte.INDUSTRY,
'8141': cte.INDUSTRY,
'3111': cte.WAREHOUSE,
'8198': cte.WAREHOUSE,
'8141': cte.WAREHOUSE,
'7452': cte.WAREHOUSE,
'3222': cte.INDUSTRY,
'2713': cte.INDUSTRY,
'2088': cte.INDUSTRY,
'3222': cte.WAREHOUSE,
'2713': cte.WAREHOUSE,
'2088': cte.WAREHOUSE,
'6564': cte.HEALTH_CARE,
'6622': cte.WAREHOUSE,
'5440': cte.COMMERCIAL,
'2894': cte.INDUSTRY,
'2894': cte.WAREHOUSE,
'6625': cte.WAREHOUSE,
'6239': cte.COMMERCIAL,
'8129': cte.WAREHOUSE,
'6647': cte.WAREHOUSE,
'8137': cte.WAREHOUSE,
'6553': cte.COMMERCIAL,
'3442': cte.INDUSTRY,
'4391': cte.NON_HEATED,
'3442': cte.WAREHOUSE,
'4391': cte.RESIDENTIAL,
'5591': cte.COMMERCIAL,
'5151': cte.COMMERCIAL,
'5196': cte.COMMERCIAL,
'6616': cte.COMMERCIAL,
'2216': cte.INDUSTRY,
'2216': cte.WAREHOUSE,
'8191': cte.WAREHOUSE,
'6422': cte.COMMERCIAL,
'1212': cte.RESIDENTIAL,
@ -793,11 +793,11 @@ class MontrealFunctionToHubFunction:
'6658': cte.WAREHOUSE,
'8123': cte.WAREHOUSE,
'6346': cte.COMMERCIAL,
'2731': cte.INDUSTRY,
'2731': cte.WAREHOUSE,
'7445': cte.COMMERCIAL,
'8125': cte.WAREHOUSE,
'4746': cte.NON_HEATED,
'3922': cte.INDUSTRY,
'4746': cte.RESIDENTIAL,
'3922': cte.WAREHOUSE,
'5360': cte.WAREHOUSE,
'3330': cte.WAREHOUSE,
'7610': cte.WAREHOUSE,

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 KiB

View File

@ -10,8 +10,16 @@ from pv_assessment.pv_system_assessment_without_consumption import PvSystemProdu
from scripts import random_assignation
import subprocess
from pathlib import Path
import geopandas as gpd
import matplotlib.pyplot as plt
from shapely.geometry import Polygon
import os
import pandas as pd
input_file = "data/selected_buildings.geojson"
input_file_1 = "./data/updated_geojson_layers/output_layer_6.geojson"
# input_file_2 = "./data/updated_geojson_layers/output_layer_20.geojson"
# input_file_3 = "./data/updated_geojson_layers/output_layer_38.geojson"
# input_file_4 = "./data/updated_geojson_layers/output_layer_53.geojson"
output_path = (Path(__file__).parent.parent / 'hub / out_files').resolve()
output_path.mkdir(parents=True, exist_ok=True)
@ -20,7 +28,8 @@ sra_output_path.mkdir(parents=True, exist_ok=True)
pv_assessment_path = output_path / 'pv_outputs'
pv_assessment_path.mkdir(parents=True, exist_ok=True)
city = GeometryFactory(
def process_city(input_file, name_suffix):
city_obj = GeometryFactory(
"geojson",
input_file,
height_field="height",
@ -30,24 +39,25 @@ city = GeometryFactory(
lot_area_field='lot_area',
build_area_field='build_area',
function_to_hub=Dictionaries().montreal_function_to_hub_function).city
ConstructionFactory('nrcan', city).enrich()
WeatherFactory('epw', city).enrich()
ExportsFactory('sra', city, sra_output_path).export()
sra_path = (sra_output_path / f'{city.name}_sra.xml').resolve()
subprocess.run(['sra', str(sra_path)])
ResultFactory('sra', city, sra_output_path).enrich()
ConstructionFactory('nrcan', city_obj).enrich()
WeatherFactory('epw', city_obj).enrich()
tilt_angle = 37
solar_parameters = SolarCalculator(city=city,
ExportsFactory('sra', city_obj, sra_output_path).export()
sra_path = (sra_output_path / f'{city_obj.name}_sra.xml').resolve()
subprocess.run(['sra', str(sra_path)])
ResultFactory('sra', city_obj, sra_output_path).enrich()
tilt_angle = 37
solar_parameters = SolarCalculator(city=city_obj,
surface_azimuth_angle=180,
tilt_angle=tilt_angle,
standard_meridian=-75)
solar_angles = solar_parameters.solar_angles
solar_parameters.tilted_irradiance_calculator()
random_assignation.call_random(city.buildings, random_assignation.residential_systems_percentage)
EnergySystemsFactory('montreal_future', city).enrich()
for building in city.buildings:
solar_angles = solar_parameters.solar_angles
solar_parameters.tilted_irradiance_calculator()
random_assignation.call_random(city_obj.buildings, random_assignation.residential_systems_percentage)
EnergySystemsFactory('montreal_future', city_obj).enrich()
for building in city_obj.buildings:
PvSystemProduction(building=building,
pv_system=None,
battery=None,
@ -63,42 +73,38 @@ for building in city.buildings:
csv_output=False,
output_path=pv_assessment_path).enrich()
print("simulation done")
return city_obj
city1 = process_city(input_file_1, "_city1")
# city2 = process_city(input_file_2, "_city2")
# city3 = process_city(input_file_3, "_city3")
# city4 = process_city(input_file_4, "_city4")
print("All simulations done")
# PLOTTING STUFF
import geopandas as gpd
import matplotlib.pyplot as plt
from shapely.geometry import shape, Polygon
import os
# Paths
layers_file = "data/cmm_limites_avec_mtl.geojson" # Polygon layers
layers_file = "data/cmm_limites_avec_mtl.geojson"
main_dir = os.path.abspath(".")
# Read layer polygons
layers_gdf = gpd.read_file(layers_file)
if layers_gdf.crs is None:
layers_gdf.set_crs(epsg=32188, inplace=True)
buildings_data = []
for b in city.buildings:
yearly_pv = b.pv_generation['year'][0]/1000
def city_to_gdf(city_obj):
buildings_data = []
for b in city_obj.buildings:
yearly_pv = b.pv_generation['year']
if isinstance(yearly_pv, list):
yearly_pv = sum(yearly_pv)
else:
yearly_pv = yearly_pv
# Extract the ground surface polygon from the building
# Assuming the ground surface is at index 0. If not,
# you may need to find it by checking the surface type.
if not b.surfaces:
continue # no surfaces, skip
continue
ground_surface = b.surfaces[0]
coords_3d = ground_surface.solid_polygon.coordinates
# Convert 3D coordinates (X,Y,Z) into 2D (X,Y)
coords_2d = [(c[0], c[1]) for c in coords_3d]
# Create a Shapely polygon from these coordinates
footprint_poly = Polygon(coords_2d)
buildings_data.append({
@ -106,40 +112,31 @@ for b in city.buildings:
"yearly_pv": yearly_pv
})
# Create the GeoDataFrame from the buildings_data
buildings_gdf = gpd.GeoDataFrame(buildings_data, crs="EPSG:26911") # Change CRS if needed
gdf = gpd.GeoDataFrame(buildings_data, crs="EPSG:26911")
gdf = gdf.to_crs(layers_gdf.crs)
return gdf
# If layers_gdf is EPSG:32188 and buildings_gdf is EPSG:4326, reproject buildings:
buildings_gdf = buildings_gdf.to_crs(layers_gdf.crs)
gdf_city1 = city_to_gdf(city1)
# gdf_city2 = city_to_gdf(city2)
# gdf_city3 = city_to_gdf(city3)
# gdf_city4 = city_to_gdf(city4)
# Loop through selected layers (e.g., layer_6, layer_7, etc.)
# Let's say we have a list of layers we want to process:
layers_of_interest = [f"layer_{i}" for i in range(6, 21)] # example from layer_6 to layer_20
all_buildings_gdf = gpd.GeoDataFrame(pd.concat([gdf_city1], ignore_index=True), crs=gdf_city1.crs)
layers_of_interest = [f"layer_{i}" for i in range(6, 21)]
for layer_name in layers_of_interest:
layer_poly = layers_gdf[layers_gdf["region"] == layer_name]
if layer_poly.empty:
continue
# There might be multiple polygons per layer_name; dissolve them into one for simplicity
layer_union = layer_poly.unary_union
if layer_union.is_empty:
continue
# Select buildings within this layer polygon
# Spatial join or mask
buildings_in_layer = buildings_gdf[buildings_gdf.geometry.within(layer_union)]
buildings_in_layer = all_buildings_gdf[all_buildings_gdf.geometry.within(layer_union)]
if buildings_in_layer.empty:
continue
# Plot the layer polygon and buildings
fig, ax = plt.subplots(figsize=(20, 20), dpi=600)
# Plot polygon
layer_poly.plot(ax=ax, facecolor="none", edgecolor="black", linewidth=1)
# Buildings colored by pv_generation
# Let's set a colormap normalized by min/max PV
vmin = buildings_in_layer["yearly_pv"].min()
vmax = buildings_in_layer["yearly_pv"].max()
@ -154,38 +151,33 @@ for layer_name in layers_of_interest:
ax.set_title(f"Yearly PV Generation - {layer_name}", fontsize=14)
ax.set_aspect('equal', 'box')
plt.tight_layout()
plt.savefig(os.path.join(main_dir, f"{layer_name}_pv_generation.pdf"), dpi=300)
plt.savefig(os.path.join(main_dir, f"{layer_name}_pv_generation_multi_city.pdf"), dpi=300)
plt.close(fig)
# After generating individual layer plots, create a combined plot of all buildings (all layers):
fig, ax = plt.subplots(figsize=(20, 20), dpi=1200)
# If you want all buildings, possibly also plot the entire layers polygon union as context
layers_gdf.plot(ax=ax, facecolor="none", edgecolor="grey", linewidth=0.5)
vmin = buildings_gdf["yearly_pv"].min()
vmax = buildings_gdf["yearly_pv"].max()
vmin = all_buildings_gdf["yearly_pv"].min()
vmax = all_buildings_gdf["yearly_pv"].max()
buildings_gdf.plot(column="yearly_pv", ax=ax,
all_buildings_gdf.plot(column="yearly_pv", ax=ax,
cmap="plasma",
edgecolor="none",
legend=True,
legend_kwds={'label': "Yearly PV Generation (kWh)", 'orientation': "vertical"},
vmin=vmin, vmax=vmax)
ax.set_title("Yearly PV Generation - All Layers", fontsize=14)
ax.set_title("Yearly PV Generation - All Layers (All 4 Cities)", fontsize=14)
ax.set_aspect('equal', 'box')
plt.tight_layout()
plt.savefig(os.path.join(main_dir, "all_layers_pv_generation.png"), dpi=1200)
plt.savefig(os.path.join(main_dir, "all_layers_pv_generation_all_4_cities.png"), dpi=1200)
plt.close(fig)
# Finally, sum PV production by layer polygon and create a plot of polygons colored by total PV
layer_sums = []
for idx, row in layers_gdf.iterrows():
region_name = row["region"]
poly_geom = row["geometry"]
# Buildings inside this polygon
b_in_poly = buildings_gdf[buildings_gdf.geometry.within(poly_geom)]
b_in_poly = all_buildings_gdf[all_buildings_gdf.geometry.within(poly_geom)]
total_pv = b_in_poly["yearly_pv"].sum()
layer_sums.append({
"region": region_name,
@ -206,10 +198,10 @@ layers_pv_gdf.plot(column="total_pv", ax=ax,
legend_kwds={'label': "Total PV Generation per Layer (kWh)", 'orientation': "vertical"},
vmin=vmin, vmax=vmax)
ax.set_title("Total PV Generation by Layer", fontsize=14)
ax.set_title("Total PV Generation by Layer (All 4 Cities)", fontsize=14)
ax.set_aspect('equal', 'box')
plt.tight_layout()
plt.savefig(os.path.join(main_dir, "layers_total_pv.png"), dpi=300)
plt.savefig(os.path.join(main_dir, "layers_total_pv_all_4_cities.png"), dpi=300)
plt.close(fig)
print("All plots generated successfully.")
print("All plots generated successfully for the 4 cities.")