Commit 7f5ed051 authored by Tara Evaz Zadeh's avatar Tara Evaz Zadeh
Browse files

Added the tile-by-tile calculator to use when needed.

parent 9aec54b1
Pipeline #19923 passed with stage
in 1 minute and 37 seconds
taxonomy,fragility_function_name
W/LWAL+CDL/H:1,W_LFM-DUL_H1
CR/LFINF+CDM/H:2,CR_LFINF-DUM_H2
MUR/LWAL+CDN/H:1,MUR_LWAL-DNO_H1
CR/LDUAL+CDH/H:9/9.0,CR_LDUAL-DUM_H9
CR/LFINF+CDN/H:1,CR_LFINF-DUL_H1
MCF/LWAL+CDL/H:1,MCF_LWAL-DUM_H1
CR/LFM+CDM/H:2,CR_LFM-DUM_H2
S/LFM+CDH/RME/H:1,S_LFM-DUH_H1
asset_id;lon;lat;taxonomy;number;structural;night;occupancy;admin_name;admin_ID;tile_id;tile_geometry;building_id;building_geometry;gm_value;gm_type;PoEs;PoOs;structural_no_damage;structural_slight;structural_moderate;structural_extensive;structural_complete
GDE_Ind_65386;23.6317973417;38.063296951999995;CR/LFINF+CDM/H:2;0.2530318501965457;gmv_SA(0.3);[0.10903260255339098, 0.001677253727228907, 0.00013973591317458184, 2.273668055210119e-05];[0.890967397446609, 0.10735534882616207, 0.0015375178140543252, 0.00011699923262248065, 2.273668055210119e-05];0.224973135611;2423204507;POLYGON ((23.63055555555556 38.0611111111111, 23.63333333333335 38.0611111111111, 23.63333333333335 38.0638888888889, 23.63055555555556 38.0638888888889, 23.63055555555556 38.0611111111111));222934686;POLYGON ((23.63084695460133 38.06460056593416, 23.6310488958772 38.06460389004709, 23.63104700941511 38.0647616791486, 23.63170951693714 38.06478317974388, 23.63171589497566 38.06461258932062, 23.63181596729832 38.06461365020757, 23.63217646122183 38.06462588576923, 23.63220179371284 38.06373827179532, 23.63266658204084 38.06373827179532, 23.632668648166 38.06355777718213, 23.6328305245802 38.06355777718213, 23.63285675538649 38.06298983864114, 23.63285971982693 38.06290539011796, 23.63286205544667 38.06283897701494, 23.63288011158388 38.06207398425316, 23.63103407367501 38.06204675387153, 23.63101592770628 38.062811746918, 23.63209228907971 38.06282766061224, 23.63209246874277 38.06288728388925, 23.63208797716635 38.06298326099584, 23.63189070712995 38.06298156353891, 23.63089959587698 38.06297279334406, 23.63084695460133 38.06460056593416));0.2004437291307357;0.02415206945003437;0.000345900203685572;2.6321684227160276e-05;5.115142317191847e-06
GDE_Ind_65397;23.631329148800003;38.061657978;MUR/LWAL+CDN/H:1;0.24981596201347833;gmv_SA(0.3);[0.1020660835617418, 0.008336073338213113, 0.0014517966380687766, 0.00036903354083823477];[0.8979339164382583, 0.09373001022352868, 0.0068842767001443365, 0.0010827630972305418, 0.00036903354083823477];0.210143993123;2423204507;POLYGON ((23.63055555555556 38.0611111111111, 23.63333333333335 38.0611111111111, 23.63333333333335 38.0638888888889, 23.63055555555556 38.0638888888889, 23.63055555555556 38.0611111111111));222955279;POLYGON ((23.63092834196608 38.06133465811244, 23.63094307433673 38.06187948130493, 23.63199886429016 38.06183145667922, 23.63199886429016 38.06172048360173, 23.63192529226839 38.0617171593578, 23.63192529226839 38.06169728461972, 23.63178641272547 38.06169565786155, 23.63178856868215 38.06167408563034, 23.6313489331821 38.06148368389088, 23.6313489331821 38.06139258511221, 23.63114492578108 38.06139428260602, 23.63113657144893 38.06132808031836, 23.63092834196608 38.06133465811244));0.1886954187609098;0.019696798623831932;0.0014466893955319606;0.00022753616085825315;7.755018186806634e-05
GDE_Ind_65394;23.631329148800003;38.061657978;CR/LFINF+CDM/H:2;0.24981596201347833;gmv_SA(0.3);[0.10542879007548353, 0.001578689719780428, 0.00013002725291199076, 2.1048217897737525e-05];[0.8945712099245164, 0.1038501003557031, 0.0014486624668684372, 0.00010897903501425323, 2.1048217897737525e-05];0.224973135611;2423204507;POLYGON ((23.63055555555556 38.0611111111111, 23.63333333333335 38.0611111111111, 23.63333333333335 38.0638888888889, 23.63055555555556 38.0638888888889, 23.63055555555556 38.0611111111111));222955279;POLYGON ((23.63092834196608 38.06133465811244, 23.63094307433673 38.06187948130493, 23.63199886429016 38.06183145667922, 23.63199886429016 38.06172048360173, 23.63192529226839 38.0617171593578, 23.63192529226839 38.06169728461972, 23.63178641272547 38.06169565786155, 23.63178856868215 38.06167408563034, 23.6313489331821 38.06148368389088, 23.6313489331821 38.06139258511221, 23.63114492578108 38.06139428260602, 23.63113657144893 38.06132808031836, 23.63092834196608 38.06133465811244));0.2012544901240446;0.023363482710539552;0.0003259101376133587;2.4517355223017507e-05;4.735283579477581e-06
GDE_Ind_65390;23.6317973417;38.063296951999995;CR/LDUAL+CDH/H:9/9.0;0.08733908872110027;gmv_SA(1);[0.13679506782081105, 0.001138944690731686, 4.62691757215665e-05, 4.02447052014241e-06];[0.8632049321791889, 0.13565612313007935, 0.0010926755150101196, 4.2244705201424095e-05, 4.02447052014241e-06];0.0379540081668;2423204507;POLYGON ((23.63055555555556 38.0611111111111, 23.63333333333335 38.0611111111111, 23.63333333333335 38.0638888888889, 23.63055555555556 38.0638888888889, 23.63055555555556 38.0611111111111));222934686;POLYGON ((23.63084695460133 38.06460056593416, 23.6310488958772 38.06460389004709, 23.63104700941511 38.0647616791486, 23.63170951693714 38.06478317974388, 23.63171589497566 38.06461258932062, 23.63181596729832 38.06461365020757, 23.63217646122183 38.06462588576923, 23.63220179371284 38.06373827179532, 23.63266658204084 38.06373827179532, 23.632668648166 38.06355777718213, 23.6328305245802 38.06355777718213, 23.63285675538649 38.06298983864114, 23.63285971982693 38.06290539011796, 23.63286205544667 38.06283897701494, 23.63288011158388 38.06207398425316, 23.63103407367501 38.06204675387153, 23.63101592770628 38.062811746918, 23.63209228907971 38.06282766061224, 23.63209246874277 38.06288728388925, 23.63208797716635 38.06298326099584, 23.63189070712995 38.06298156353891, 23.63089959587698 38.06297279334406, 23.63084695460133 38.06460056593416));0.032762087045550975;0.005148693605155458;4.147141542035648e-05;1.6033558862189087e-06;1.5274478698853089e-07
GDE_Ind_65401;23.631329148800003;38.061657978;W/LWAL+CDL/H:1;0.24981596201347833;gmv_SA(0.3);[0.13694167672016833, 0.013450419221240933, 0.001911457011577599, 0.0003600230583453614];[0.8630583232798317, 0.12349125749892739, 0.011538962209663335, 0.0015514339532322376, 0.0003600230583453614];0.00992907801418;2423204507;POLYGON ((23.63055555555556 38.0611111111111, 23.63333333333335 38.0611111111111, 23.63333333333335 38.0638888888889, 23.63055555555556 38.0638888888889, 23.63055555555556 38.0611111111111));222955279;POLYGON ((23.63092834196608 38.06133465811244, 23.63094307433673 38.06187948130493, 23.63199886429016 38.06183145667922, 23.63199886429016 38.06172048360173, 23.63192529226839 38.0617171593578, 23.63192529226839 38.06169728461972, 23.63178641272547 38.06169565786155, 23.63178856868215 38.06167408563034, 23.6313489331821 38.06148368389088, 23.6313489331821 38.06139258511221, 23.63114492578108 38.06139428260602, 23.63113657144893 38.06132808031836, 23.63092834196608 38.06133465811244));0.008569373422632831;0.001226154329776041;0.00011457125598242209;1.5404308755490572e-05;3.5746970332147715e-06
GDE_Com_916837;23.631058500500004;38.0652258859;CR/LFINF+CDN/H:1;0.12764675210854076;gmv_PGA;[0.0012094770502650604, 1e-06, 0.0, 0.0];[0.9987905229497349, 0.0012084770502650605, 1e-06, -0.0, 0.0];0.47678850799999994;2423074907;POLYGON ((23.63055555555556 38.0638888888889, 23.63333333333335 38.0638888888889, 23.63333333333335 38.06666666666666, 23.63055555555556 38.06666666666666, 23.63055555555556 38.0638888888889));222934685;POLYGON ((23.63082782048578 38.06522528433379, 23.63086465141243 38.06526248578197, 23.63086572939077 38.06540322873226, 23.63103299569667 38.06540577483339, 23.63107854028158 38.06542897263961, 23.63110441176176 38.06544212748986, 23.63113288835627 38.06544467358964, 23.63113603245976 38.06536107660067, 23.63124643540818 38.06535937919889, 23.63124643540818 38.06529063439369, 23.63129584274881 38.06528893699027, 23.63129692072715 38.06516813834614, 23.63123808107604 38.06517393781721, 23.63124329130469 38.06504974416531, 23.6308604293306 38.0650505928698, 23.63086995147261 38.06519876237725, 23.63082782048578 38.06522528433379));0.4762118432417438;0.0005761879697481191;4.767885079999999e-07;-0.0;0.0
GDE_Com_916844;23.631058500500004;38.0652258859;MCF/LWAL+CDL/H:1;0.1259892518545065;gmv_PGA;[1.6568474811739413e-06, 0.0, 0.0, 0.0];[0.9999983431525188, 1.6568474811739413e-06, -0.0, -0.0, 0.0];0.5232114920000001;2423074907;POLYGON ((23.63055555555556 38.0638888888889, 23.63333333333335 38.0638888888889, 23.63333333333335 38.06666666666666, 23.63055555555556 38.06666666666666, 23.63055555555556 38.0638888888889));222934685;POLYGON ((23.63082782048578 38.06522528433379, 23.63086465141243 38.06526248578197, 23.63086572939077 38.06540322873226, 23.63103299569667 38.06540577483339, 23.63107854028158 38.06542897263961, 23.63110441176176 38.06544212748986, 23.63113288835627 38.06544467358964, 23.63113603245976 38.06536107660067, 23.63124643540818 38.06535937919889, 23.63124643540818 38.06529063439369, 23.63129584274881 38.06528893699027, 23.63129692072715 38.06516813834614, 23.63123808107604 38.06517393781721, 23.63124329130469 38.06504974416531, 23.6308604293306 38.0650505928698, 23.63086995147261 38.06519876237725, 23.63082782048578 38.06522528433379));0.5232106251183574;8.668816426414599e-07;-0.0;-0.0;0.0
GDE_Ind_63866;23.631795147600002;38.0652826876;CR/LFINF+CDM/H:2;0.24981596201347833;gmv_SA(0.3);[0.10542879007548353, 0.001578689719780428, 0.00013002725291199076, 2.1048217897737525e-05];[0.8945712099245164, 0.1038501003557031, 0.0014486624668684372, 0.00010897903501425323, 2.1048217897737525e-05];0.398963336;2423074907;POLYGON ((23.63055555555556 38.0638888888889, 23.63333333333335 38.0638888888889, 23.63333333333335 38.06666666666666, 23.63055555555556 38.06666666666666, 23.63055555555556 38.0638888888889));222934688;POLYGON ((23.63175353438607 38.06525435238713, 23.63177913637167 38.06532536042991, 23.63183573023456 38.0653123470089, 23.63181228420565 38.06523978299931, 23.63175353438607 38.06525435238713));0.35690111420104137;0.0414323824818461;0.0005779632105198212;4.347863936334728e-05;8.39746722933627e-06
GDE_Ind_63867;23.631795147600002;38.0652826876;CR/LFM+CDM/H:2;0.2530318501965457;gmv_SA(0.3);[0.003122927921459181, 9.368340276050595e-06, 0.0, 0.0];[0.9968770720785408, 0.0031135595811831304, 9.368340276050595e-06, -0.0, 0.0];0.398963336;2423074907;POLYGON ((23.63055555555556 38.0638888888889, 23.63333333333335 38.0638888888889, 23.63333333333335 38.06666666666666, 23.63055555555556 38.06666666666666, 23.63055555555556 38.0638888888889));222934688;POLYGON ((23.63175353438607 38.06525435238713, 23.63177913637167 38.06532536042991, 23.63183573023456 38.0653123470089, 23.63181228420565 38.06523978299931, 23.63175353438607 38.06525435238713));0.3977174022583671;0.0012421961173435846;3.737624289316306e-06;-0.0;0.0
GDE_Ind_63872;23.631795147600002;38.0652826876;S/LFM+CDH/RME/H:1;0.24981596201347833;gmv_SA(0.3);[0.0029037379298307653, 0.0, 0.0, 0.0];[0.9970962620701692, 0.0029037379298307653, -0.0, -0.0, 0.0];0.202073329;2423074907;POLYGON ((23.63055555555556 38.0638888888889, 23.63333333333335 38.0638888888889, 23.63333333333335 38.06666666666666, 23.63055555555556 38.06666666666666, 23.63055555555556 38.0638888888889));222934688;POLYGON ((23.63175353438607 38.06525435238713, 23.63177913637167 38.06532536042991, 23.63183573023456 38.0653123470089, 23.63181228420565 38.06523978299931, 23.63175353438607 38.06525435238713));0.20148656100997553;0.0005867679900244711;-0.0;-0.0;0.0
asset_id;lon;lat;taxonomy;number;structural;night;occupancy;admin_name;admin_ID;tile_id;tile_geometry;building_id;building_geometry;gm_value;gm_type;PoEs;PoOs;structural_no_damage;structural_slight;structural_moderate;structural_extensive;structural_complete
GDE_Ind_65386;23.6317973417;38.063296951999995;CR/LFINF+CDM/H:2;0.25303021062670217;gmv_SA(0.3);[0.10903076520646712, 0.0016772034759250452, 0.00013973096336734918, 2.273581971606073e-05];[0.8909692347935328, 0.10735356173054207, 0.001537472512557696, 0.00011699514365128846, 2.273581971606073e-05];0.224973135611;2423204507;POLYGON ((23.63055555555556 38.0611111111111, 23.63333333333335 38.0611111111111, 23.63333333333335 38.0638888888889, 23.63055555555556 38.0638888888889, 23.63055555555556 38.0611111111111));222934686;POLYGON ((23.63084695460133 38.06460056593416, 23.6310488958772 38.06460389004709, 23.63104700941511 38.0647616791486, 23.63170951693714 38.06478317974388, 23.63171589497566 38.06461258932062, 23.63181596729832 38.06461365020757, 23.63217646122183 38.06462588576923, 23.63220179371284 38.06373827179532, 23.63266658204084 38.06373827179532, 23.632668648166 38.06355777718213, 23.6328305245802 38.06355777718213, 23.63285675538649 38.06298983864114, 23.63285971982693 38.06290539011796, 23.63286205544667 38.06283897701494, 23.63288011158388 38.06207398425316, 23.63103407367501 38.06204675387153, 23.63101592770628 38.062811746918, 23.63209228907971 38.06282766061224, 23.63209246874277 38.06288728388925, 23.63208797716635 38.06298326099584, 23.63189070712995 38.06298156353891, 23.63089959587698 38.06297279334406, 23.63084695460133 38.06460056593416));0.20044414248443435;0.0241516674015291;0.0003458900120658274;2.6320764318489743e-05;5.114948652208578e-06
GDE_Ind_65397;23.631329148800003;38.061657978;MUR/LWAL+CDN/H:1;0.24981596201347833;gmv_SA(0.3);[0.1020660835617418, 0.008336073338213113, 0.0014517966380687766, 0.00036903354083823477];[0.8979339164382583, 0.09373001022352868, 0.0068842767001443365, 0.0010827630972305418, 0.00036903354083823477];0.210143993123;2423204507;POLYGON ((23.63055555555556 38.0611111111111, 23.63333333333335 38.0611111111111, 23.63333333333335 38.0638888888889, 23.63055555555556 38.0638888888889, 23.63055555555556 38.0611111111111));222955279;POLYGON ((23.63092834196608 38.06133465811244, 23.63094307433673 38.06187948130493, 23.63199886429016 38.06183145667922, 23.63199886429016 38.06172048360173, 23.63192529226839 38.0617171593578, 23.63192529226839 38.06169728461972, 23.63178641272547 38.06169565786155, 23.63178856868215 38.06167408563034, 23.6313489331821 38.06148368389088, 23.6313489331821 38.06139258511221, 23.63114492578108 38.06139428260602, 23.63113657144893 38.06132808031836, 23.63092834196608 38.06133465811244));0.1886954187609098;0.019696798623831932;0.0014466893955319606;0.00022753616085825315;7.755018186806634e-05
GDE_Ind_65394;23.631329148800003;38.061657978;CR/LFINF+CDM/H:2;0.24981596201347833;gmv_SA(0.3);[0.10542879007548353, 0.001578689719780428, 0.00013002725291199076, 2.1048217897737525e-05];[0.8945712099245164, 0.1038501003557031, 0.0014486624668684372, 0.00010897903501425323, 2.1048217897737525e-05];0.224973135611;2423204507;POLYGON ((23.63055555555556 38.0611111111111, 23.63333333333335 38.0611111111111, 23.63333333333335 38.0638888888889, 23.63055555555556 38.0638888888889, 23.63055555555556 38.0611111111111));222955279;POLYGON ((23.63092834196608 38.06133465811244, 23.63094307433673 38.06187948130493, 23.63199886429016 38.06183145667922, 23.63199886429016 38.06172048360173, 23.63192529226839 38.0617171593578, 23.63192529226839 38.06169728461972, 23.63178641272547 38.06169565786155, 23.63178856868215 38.06167408563034, 23.6313489331821 38.06148368389088, 23.6313489331821 38.06139258511221, 23.63114492578108 38.06139428260602, 23.63113657144893 38.06132808031836, 23.63092834196608 38.06133465811244));0.2012544901240446;0.023363482710539552;0.0003259101376133587;2.4517355223017507e-05;4.735283579477581e-06
GDE_Ind_65390;23.6317973417;38.063296951999995;CR/LDUAL+CDH/H:9/9.0;0.08733853033842046;gmv_SA(1);[0.1367928221964075, 0.0011389062500923733, 4.626727528546564e-05, 4.02429775322415e-06];[0.8632071778035925, 0.13565391594631512, 0.0010926389748069077, 4.224297753224149e-05, 4.02429775322415e-06];0.0379540081668;2423204507;POLYGON ((23.63055555555556 38.0611111111111, 23.63333333333335 38.0611111111111, 23.63333333333335 38.0638888888889, 23.63055555555556 38.0638888888889, 23.63055555555556 38.0611111111111));222934686;POLYGON ((23.63084695460133 38.06460056593416, 23.6310488958772 38.06460389004709, 23.63104700941511 38.0647616791486, 23.63170951693714 38.06478317974388, 23.63171589497566 38.06461258932062, 23.63181596729832 38.06461365020757, 23.63217646122183 38.06462588576923, 23.63220179371284 38.06373827179532, 23.63266658204084 38.06373827179532, 23.632668648166 38.06355777718213, 23.6328305245802 38.06355777718213, 23.63285675538649 38.06298983864114, 23.63285971982693 38.06290539011796, 23.63286205544667 38.06283897701494, 23.63288011158388 38.06207398425316, 23.63103407367501 38.06204675387153, 23.63101592770628 38.062811746918, 23.63209228907971 38.06282766061224, 23.63209246874277 38.06288728388925, 23.63208797716635 38.06298326099584, 23.63189070712995 38.06298156353891, 23.63089959587698 38.06297279334406, 23.63084695460133 38.06460056593416));0.03276217227599793;0.005148609833684845;4.147002857318536e-05;1.6032903142486427e-06;1.5273822979150428e-07
GDE_Ind_65401;23.631329148800003;38.061657978;W/LWAL+CDL/H:1;0.24981596201347833;gmv_SA(0.3);[0.13694167672016833, 0.013450419221240933, 0.001911457011577599, 0.0003600230583453614];[0.8630583232798317, 0.12349125749892739, 0.011538962209663335, 0.0015514339532322376, 0.0003600230583453614];0.00992907801418;2423204507;POLYGON ((23.63055555555556 38.0611111111111, 23.63333333333335 38.0611111111111, 23.63333333333335 38.0638888888889, 23.63055555555556 38.0638888888889, 23.63055555555556 38.0611111111111));222955279;POLYGON ((23.63092834196608 38.06133465811244, 23.63094307433673 38.06187948130493, 23.63199886429016 38.06183145667922, 23.63199886429016 38.06172048360173, 23.63192529226839 38.0617171593578, 23.63192529226839 38.06169728461972, 23.63178641272547 38.06169565786155, 23.63178856868215 38.06167408563034, 23.6313489331821 38.06148368389088, 23.6313489331821 38.06139258511221, 23.63114492578108 38.06139428260602, 23.63113657144893 38.06132808031836, 23.63092834196608 38.06133465811244));0.008569373422632831;0.001226154329776041;0.00011457125598242209;1.5404308755490572e-05;3.5746970332147715e-06
GDE_Com_916837;23.631058500500004;38.0652258859;CR/LFINF+CDN/H:1;0.12941663558644617;gmv_PGA;[0.0013584560447764114, 1.286366759950857e-06, 0.0, 0.0];[0.9986415439552236, 0.0013571696780164606, 1.286366759950857e-06, -0.0, 0.0];0.47678850799999994;2423074907;POLYGON ((23.63055555555556 38.0638888888889, 23.63333333333335 38.0638888888889, 23.63333333333335 38.06666666666666, 23.63055555555556 38.06666666666666, 23.63055555555556 38.0638888888889));222934685;POLYGON ((23.63082782048578 38.06522528433379, 23.63086465141243 38.06526248578197, 23.63086572939077 38.06540322873226, 23.63103299569667 38.06540577483339, 23.63107854028158 38.06542897263961, 23.63110441176176 38.06544212748986, 23.63113288835627 38.06544467358964, 23.63113603245976 38.06536107660067, 23.63124643540818 38.06535937919889, 23.63124643540818 38.06529063439369, 23.63129584274881 38.06528893699027, 23.63129692072715 38.06516813834614, 23.63123808107604 38.06517393781721, 23.63124329130469 38.06504974416531, 23.6308604293306 38.0650505928698, 23.63086995147261 38.06519876237725, 23.63082782048578 38.06522528433379));0.47614081176922746;0.0006470829058843085;6.133248882177633e-07;-0.0;0.0
GDE_Com_916844;23.631058500500004;38.0652258859;MCF/LWAL+CDL/H:1;0.12941663558644617;gmv_PGA;[2.286366759950857e-06, 0.0, 0.0, 0.0];[0.9999977136332401, 2.286366759950857e-06, -0.0, -0.0, 0.0];0.5232114920000001;2423074907;POLYGON ((23.63055555555556 38.0638888888889, 23.63333333333335 38.0638888888889, 23.63333333333335 38.06666666666666, 23.63055555555556 38.06666666666666, 23.63055555555556 38.0638888888889));222934685;POLYGON ((23.63082782048578 38.06522528433379, 23.63086465141243 38.06526248578197, 23.63086572939077 38.06540322873226, 23.63103299569667 38.06540577483339, 23.63107854028158 38.06542897263961, 23.63110441176176 38.06544212748986, 23.63113288835627 38.06544467358964, 23.63113603245976 38.06536107660067, 23.63124643540818 38.06535937919889, 23.63124643540818 38.06529063439369, 23.63129584274881 38.06528893699027, 23.63129692072715 38.06516813834614, 23.63123808107604 38.06517393781721, 23.63124329130469 38.06504974416531, 23.6308604293306 38.0650505928698, 23.63086995147261 38.06519876237725, 23.63082782048578 38.06522528433379));0.5232102957466364;1.1962533637330937e-06;-0.0;-0.0;0.0
GDE_Ind_63866;23.631795147600002;38.0652826876;CR/LFINF+CDM/H:2;0.25681258869619783;gmv_SA(0.3);[0.11335536475459793, 0.0018032554083471897, 0.00015242913333477298, 2.4933132291914104e-05];[0.886644635245402, 0.11155210934625073, 0.0016508262750124167, 0.0001274960010428589, 2.4933132291914104e-05];0.398963336;2423074907;POLYGON ((23.63055555555556 38.0638888888889, 23.63333333333335 38.0638888888889, 23.63333333333335 38.06666666666666, 23.63055555555556 38.06666666666666, 23.63055555555556 38.0638888888889));222934688;POLYGON ((23.63175353438607 38.06525435238713, 23.63177913637167 38.06532536042991, 23.63183573023456 38.0653123470089, 23.63181228420565 38.06523978299931, 23.63175353438607 38.06525435238713));0.35373870152400877;0.04450520168261697;0.0006586191578354072;5.086622990271846e-05;9.947405636111377e-06
GDE_Ind_63867;23.631795147600002;38.0652826876;CR/LFM+CDM/H:2;0.25681258869619783;gmv_SA(0.3);[0.0033862124031544902, 1.0593811458490795e-05, 0.0, 0.0];[0.9966137875968455, 0.0033756185916959994, 1.0593811458490795e-05, -0.0, 0.0];0.398963336;2423074907;POLYGON ((23.63055555555556 38.0638888888889, 23.63333333333335 38.0638888888889, 23.63333333333335 38.06666666666666, 23.63055555555556 38.06666666666666, 23.63055555555556 38.0638888888889));222934688;POLYGON ((23.63175353438607 38.06525435238713, 23.63177913637167 38.06532536042991, 23.63183573023456 38.0653123470089, 23.63181228420565 38.06523978299931, 23.63175353438607 38.06525435238713));0.3976123614032329;0.0013467480544066578;4.226542360434513e-06;-0.0;0.0
GDE_Ind_63872;23.631795147600002;38.0652826876;S/LFM+CDH/RME/H:1;0.25681258869619783;gmv_SA(0.3);[0.0033647702896124412, 8.483020835582769e-08, 0.0, 0.0];[0.9966352297103875, 0.0033646854594040856, 8.483020835582769e-08, -0.0, 0.0];0.202073329;2423074907;POLYGON ((23.63055555555556 38.0638888888889, 23.63333333333335 38.0638888888889, 23.63333333333335 38.06666666666666, 23.63055555555556 38.06666666666666, 23.63055555555556 38.0638888888889));222934688;POLYGON ((23.63175353438607 38.06525435238713, 23.63177913637167 38.06532536042991, 23.63183573023456 38.0653123470089, 23.63181228420565 38.06523978299931, 23.63175353438607 38.06525435238713));0.20139339866625772;0.000679913191819678;1.714192260222572e-08;-0.0;0.0
python3 ../../utils/preprocessor.py -o data/exposure_augmented.csv -i data/exposure.csv -g data/geometries.csv -w
python3 ../losscalculator/damage_calculator.py -x "building" -f data/fragilities -t data/taxonomy_mapping.csv -g data/ground_motion_values.csv -c data/cell_ids.csv -e data/exposure_plus_respective_cell_ids.csv -p data/geometries.csv -r result_building.csv -o
python3 ../../losscalculator/damage_calculator.py -f data/fragilities -t data/taxonomy_mapping.csv -g data/ground_motion_values.csv -e data/exposure_augmented.csv -r result_building_augmented_full_GMF_computed_in_a_tile.csv -o
exposure = id lon ... building_id building_geometry
0 GDE_Ind_65386 23.631797 ... 222934686 POLYGON ((23.63084695460133 38.06460056593416,...
1 GDE_Ind_65397 23.631329 ... 222955279 POLYGON ((23.63092834196608 38.06133465811244,...
2 GDE_Ind_65394 23.631329 ... 222955279 POLYGON ((23.63092834196608 38.06133465811244,...
3 GDE_Ind_65390 23.631797 ... 222934686 POLYGON ((23.63084695460133 38.06460056593416,...
4 GDE_Ind_65401 23.631329 ... 222955279 POLYGON ((23.63092834196608 38.06133465811244,...
5 GDE_Com_916837 23.631059 ... 222934685 POLYGON ((23.63082782048578 38.06522528433379,...
6 GDE_Com_916844 23.631059 ... 222934685 POLYGON ((23.63082782048578 38.06522528433379,...
7 GDE_Ind_63866 23.631795 ... 222934688 POLYGON ((23.63175353438607 38.06525435238713,...
8 GDE_Ind_63867 23.631795 ... 222934688 POLYGON ((23.63175353438607 38.06525435238713,...
9 GDE_Ind_63872 23.631795 ... 222934688 POLYGON ((23.63175353438607 38.06525435238713,...
[10 rows x 14 columns]
GMF = [[23.62917 38.06528 0.1291617 0.2559737 0.08834055]
[23.63194 38.06528 0.1296171 0.2568595 0.08864263]
[23.63472 38.06528 0.1300348 0.2576721 0.08891996]
[23.62917 38.0625 0.1264553 0.2507185 0.08655176]
[23.63194 38.0625 0.126886 0.2515539 0.08683572]
[23.63472 38.0625 0.1272809 0.2523201 0.0870963 ]
[23.62917 38.05972 0.1238315 0.2456357 0.08482726]
[23.63194 38.05972 0.1242389 0.2464242 0.08509444]
[23.63472 38.05972 0.1246124 0.2471472 0.08533953]]
lons_whole = 0 23.631797
1 23.631329
2 23.631329
3 23.631797
4 23.631329
5 23.631059
6 23.631059
7 23.631795
8 23.631795
9 23.631795
Name: lon, dtype: float64 lat_whole = 0 38.063297
1 38.061658
2 38.061658
3 38.063297
4 38.061658
5 38.065226
6 38.065226
7 38.065283
8 38.065283
9 38.065283
Name: lat, dtype: float64
interpolation_mrthod = linear
full_GMF_1 [[23.63179734 38.06329695 0.12764675 0.25303185 0.08733909]
[23.63132915 38.06165798 0.12598925 0.24981596 0.08624569]
[23.63132915 38.06165798 0.12598925 0.24981596 0.08624569]
[23.63179734 38.06329695 0.12764675 0.25303185 0.08733909]
[23.63132915 38.06165798 0.12598925 0.24981596 0.08624569]
[23.6310585 38.06522589 0.1294195 0.25647532 0.08851168]
[23.6310585 38.06522589 0.1294195 0.25647532 0.08851168]
[23.63179515 38.06528269 nan nan nan]
[23.63179515 38.06528269 nan nan nan]
[23.63179515 38.06528269 nan nan nan]]
cell-ids = [2423204507 2423074907]
len(cell_ids) = 2
cell_ids[i] = 2423204507
full_GMF_2 = [[23.63179734 38.06329695 0.12764675 0.25303185 0.08733909]
[23.63132915 38.06165798 0.12598925 0.24981596 0.08624569]
[23.63132915 38.06165798 0.12598925 0.24981596 0.08624569]
[23.63179734 38.06329695 0.12764675 0.25303185 0.08733909]
[23.63132915 38.06165798 0.12598925 0.24981596 0.08624569]
[23.6310585 38.06522589 0.1294195 0.25647532 0.08851168]
[23.6310585 38.06522589 0.1294195 0.25647532 0.08851168]
[23.63179515 38.06528269 nan nan nan]
[23.63179515 38.06528269 nan nan nan]
[23.63179515 38.06528269 nan nan nan]] result_filepath = result_building_augmented.csv fragility_pathname = data/fragilities exposure_per_tile = id lon ... building_id building_geometry
0 GDE_Ind_65386 23.631797 ... 222934686 POLYGON ((23.63084695460133 38.06460056593416,...
1 GDE_Ind_65397 23.631329 ... 222955279 POLYGON ((23.63092834196608 38.06133465811244,...
2 GDE_Ind_65394 23.631329 ... 222955279 POLYGON ((23.63092834196608 38.06133465811244,...
3 GDE_Ind_65390 23.631797 ... 222934686 POLYGON ((23.63084695460133 38.06460056593416,...
4 GDE_Ind_65401 23.631329 ... 222955279 POLYGON ((23.63092834196608 38.06133465811244,...
[5 rows x 14 columns] taxonomy_conversion_filepath = data/taxonomy_mapping.csv ground_motion_field_filepath = data/ground_motion_values.csv ground_motion_type_index_map = {'gmv_PGA': 2, 'gmv_SA(0.3)': 3, 'gmv_SA(1)': 4} interpolation_method = linear
ground_motion_type_index_map = {'gmv_PGA': 2, 'gmv_SA(0.3)': 3, 'gmv_SA(1)': 4}
2021-03-01 17:44:57.327508
exposure
HHHHEEEEEEEEEEEEEEEEEEEEERRRRRRRRRRRRRREEEEEEEEEEEE
key_list = ['gmv_PGA', 'gmv_SA(0.3)', 'gmv_SA(1)']
value_list = [2, 3, 4]
HHHHEEEEEEEEEEEEEEEEEEEEERRRRRRRRRRRRRREEEEEEEEEEEE 22222222222222222222
taxonomy_to_fragility_map = {'W/LWAL+CDL/H:1': ['W_LFM-DUL_H1', 3], 'CR/LFINF+CDM/H:2': ['CR_LFINF-DUM_H2', 3], 'MUR/LWAL+CDN/H:1': ['MUR_LWAL-DNO_H1', 3], 'CR/LDUAL+CDH/H:9/9.0': ['CR_LDUAL-DUM_H9', 4], 'CR/LFINF+CDN/H:1': ['CR_LFINF-DUL_H1', 2], 'MCF/LWAL+CDL/H:1': ['MCF_LWAL-DUM_H1', 2], 'CR/LFM+CDM/H:2': ['CR_LFM-DUM_H2', 3], 'S/LFM+CDH/RME/H:1': ['S_LFM-DUH_H1', 3]}
result_filepath = result_building_augmented.csv
GDE_Ind_65386
asset = 0
taxonomy_to_fragility_map[taxonomy][1] = 3
23.6317973417 38.063296951999995 0.2530318501965457
el gm_value in range
GDE_Ind_65397
asset = 1
taxonomy_to_fragility_map[taxonomy][1] = 3
23.631329148800003 38.061657978 0.24981596201347833
el gm_value in range
GDE_Ind_65394
asset = 2
taxonomy_to_fragility_map[taxonomy][1] = 3
23.631329148800003 38.061657978 0.24981596201347833
el gm_value in range
GDE_Ind_65390
asset = 3
taxonomy_to_fragility_map[taxonomy][1] = 4
23.6317973417 38.063296951999995 0.08733908872110027
el gm_value in range
GDE_Ind_65401
asset = 4
taxonomy_to_fragility_map[taxonomy][1] = 3
23.631329148800003 38.061657978 0.24981596201347833
el gm_value in range
Execution time of the script 0:00:00.007844
cell_ids[i] = 2423074907
full_GMF_2 = [[23.63179734 38.06329695 0.12764675 0.25303185 0.08733909]
[23.63132915 38.06165798 0.12598925 0.24981596 0.08624569]
[23.63132915 38.06165798 0.12598925 0.24981596 0.08624569]
[23.63179734 38.06329695 0.12764675 0.25303185 0.08733909]
[23.63132915 38.06165798 0.12598925 0.24981596 0.08624569]
[23.6310585 38.06522589 0.1294195 0.25647532 0.08851168]
[23.6310585 38.06522589 0.1294195 0.25647532 0.08851168]
[23.63179515 38.06528269 nan nan nan]
[23.63179515 38.06528269 nan nan nan]
[23.63179515 38.06528269 nan nan nan]] result_filepath = result_building_augmented.csv fragility_pathname = data/fragilities exposure_per_tile = id lon ... building_id building_geometry
5 GDE_Com_916837 23.631059 ... 222934685 POLYGON ((23.63082782048578 38.06522528433379,...
6 GDE_Com_916844 23.631059 ... 222934685 POLYGON ((23.63082782048578 38.06522528433379,...
7 GDE_Ind_63866 23.631795 ... 222934688 POLYGON ((23.63175353438607 38.06525435238713,...
8 GDE_Ind_63867 23.631795 ... 222934688 POLYGON ((23.63175353438607 38.06525435238713,...
9 GDE_Ind_63872 23.631795 ... 222934688 POLYGON ((23.63175353438607 38.06525435238713,...
[5 rows x 14 columns] taxonomy_conversion_filepath = data/taxonomy_mapping.csv ground_motion_field_filepath = data/ground_motion_values.csv ground_motion_type_index_map = {'gmv_PGA': 2, 'gmv_SA(0.3)': 3, 'gmv_SA(1)': 4} interpolation_method = linear
ground_motion_type_index_map = {'gmv_PGA': 2, 'gmv_SA(0.3)': 3, 'gmv_SA(1)': 4}
2021-03-01 17:44:57.356159
exposure
HHHHEEEEEEEEEEEEEEEEEEEEERRRRRRRRRRRRRREEEEEEEEEEEE
key_list = ['gmv_PGA', 'gmv_SA(0.3)', 'gmv_SA(1)']
value_list = [2, 3, 4]
HHHHEEEEEEEEEEEEEEEEEEEEERRRRRRRRRRRRRREEEEEEEEEEEE 22222222222222222222
taxonomy_to_fragility_map = {'W/LWAL+CDL/H:1': ['W_LFM-DUL_H1', 3], 'CR/LFINF+CDM/H:2': ['CR_LFINF-DUM_H2', 3], 'MUR/LWAL+CDN/H:1': ['MUR_LWAL-DNO_H1', 3], 'CR/LDUAL+CDH/H:9/9.0': ['CR_LDUAL-DUM_H9', 4], 'CR/LFINF+CDN/H:1': ['CR_LFINF-DUL_H1', 2], 'MCF/LWAL+CDL/H:1': ['MCF_LWAL-DUM_H1', 2], 'CR/LFM+CDM/H:2': ['CR_LFM-DUM_H2', 3], 'S/LFM+CDH/RME/H:1': ['S_LFM-DUH_H1', 3]}
result_filepath = result_building_augmented.csv
GDE_Com_916837
asset = 0
taxonomy_to_fragility_map[taxonomy][1] = 2
23.631058500500004 38.0652258859 0.12764675210854076
el gm_value in range
GDE_Com_916844
asset = 1
taxonomy_to_fragility_map[taxonomy][1] = 2
23.631058500500004 38.0652258859 0.1259892518545065
el gm_value in range
GDE_Ind_63866
asset = 2
taxonomy_to_fragility_map[taxonomy][1] = 3
23.631795147600002 38.0652826876 0.24981596201347833
el gm_value in range
GDE_Ind_63867
asset = 3
taxonomy_to_fragility_map[taxonomy][1] = 3
23.631795147600002 38.0652826876 0.2530318501965457
el gm_value in range
GDE_Ind_63872
asset = 4
taxonomy_to_fragility_map[taxonomy][1] = 3
23.631795147600002 38.0652826876 0.24981596201347833
el gm_value in range
Execution time of the script 0:00:00.005379
This calculator splits the exposure into tiles, but computes the ground-motion field for all
the assets once (at first and before going into any tile) and then writes the full ground-motion
field into a dictionary along with the `asset-ids`. Whenever in a tile, the corresponding
ground-motion values can be read from the dictionary using the `asset-ids`.
This makes the program 23 times faster than when the ground-motion values for a tile are
computed in the tile. But still 23 times slower than the case when we do not split the exposure
into tiles (and compute the full ground-motion field once for all the assets and assign the
gm value of each asset using the line number which is same for an asset in the exposure
model and its corresponding gm-value in the full ground-motion field).
The input to this calculator is the augmented exposure model file. The code to convert an
exposure model into an augmented one is given in the directory `utils` named `preprocessor.py`.
......@@ -24,6 +24,7 @@ import os
import argparse
from damage_calculator_tile_version import damageCalculator_TileVersion
import csv
import datetime
def get_exposure_per_tile(
......@@ -31,20 +32,59 @@ def get_exposure_per_tile(
fragility_pathname,
taxonomy_conversion_filepath,
ground_motion_field_filepath,
geometry_source_filepath,
cell_id_source_filepath,
exposure_type="cell",
# exposure_type="cell",
interpolation_method="linear",
result_filepath="damage_result.csv",
):
interpolation_method = "linear" # why should this be included?
exposure = pd.read_csv(exposure_filepath)
lons_whole_area = exposure.lon
lats_whole_area = exposure.lat
asset_ids_whole_area = exposure.id
ground_motion_field = np.loadtxt(ground_motion_field_filepath, delimiter=",", skiprows=1)
"""print('exposure = ',exposure)
print('GMF = ',ground_motion_field)
print('lons_whole = ',lons_whole_area, 'lat_whole = ',lats_whole_area)
print('interpolation_mrthod = ',interpolation_method)
full_ground_motion_field = losslib.get_full_GMF(
ground_motion_field, lons_whole_area, lats_whole_area, interpolation_method
ground_motion_field,
lons_whole_area, lats_whole_area,
asset_ids_whole_area,
interpolation_method,
)
print('full_GMF_1',full_ground_motion_field)
print('FULL GROUND MOTION . SHAPE [ 1 ]')
print(full_ground_motion_field.shape[0])
print(full_ground_motion_field.shape[1])
print('FULL GROUND MOTION . SHAPE -- DONEEEEEEEEEEE')
full_ground_motion_field_map = losslib.get_fullGMF_map(full_ground_motion_field)
print('full_GMF_item_in4 = \n' , full_GMF_item_in4, 'i4', i4)"""
full_ground_motion_field_map = losslib.get_fullGMF_map(
losslib.get_full_GMF(
ground_motion_field,
lons_whole_area,
lats_whole_area,
asset_ids_whole_area,
interpolation_method,
)
)
"""Can it be like:??? to not store full_ground_motion_field?
losslib.get_fullGMF_map
(
losslib.get_full_GMF(
ground_motion_field,
lons_whole_area,
lats_whole_area,
asset_ids_whole_area,
interpolation_method)
)
"""
# Creating an empty dictionary to later fill with ground-motion types and their column
# numbers (as they appear in the ground-motion-field file) as its key and value.
......@@ -59,66 +99,61 @@ def get_exposure_per_tile(
# ground-motion-field file) to the `ground_motion_type_index_map` as the dictionary
# key and value, respectively.
ground_motion_type_index_map[gm_types[i]] = i + 2
cell_ids = pd.read_csv(cell_id_source_filepath)
cell_ids = exposure.tile_id.unique()
"""print('cell-ids = ', cell_ids)"""
with open(result_filepath, mode="w") as write_obj:
if exposure_type == "building":
field_names = [
"geometry",
"origin_id",
"respective_cell_id",
"asset_id",
"lon",
"lat",
"taxonomy",
"gm_value",
"PoEs",
"PoOs",
"num_buildings",
"structural_no_damage",
"structural_slight",
"structural_moderate",
"structural_extensive",
"structural_complete",
]
tile_id = "respective_cell_id"
else:
field_names = [
"geometry",
"origin_id",
"asset_id",
"lon",
"lat",
"taxonomy",
"gm_value",
"PoEs",
"PoOs",
"num_buildings",
"structural_no_damage",
"structural_slight",
"structural_moderate",
"structural_extensive",
"structural_complete",
]
tile_id = "origin_id"
field_names = [
"asset_id",
"lon",
"lat",
"taxonomy",
"number",
"structural",
"night",
"occupancy",
"admin_name",
"admin_ID",
"tile_id",
"tile_geometry",
"building_id",
"building_geometry",
"gm_value",
"gm_type",
"PoEs",
"PoOs",
"structural_no_damage",
"structural_slight",
"structural_moderate",
"structural_extensive",
"structural_complete",
]
writer = csv.DictWriter(write_obj, fieldnames=field_names, delimiter=";")
writer.writeheader()
"""print('len(cell_ids) = ',len(cell_ids))"""
for i in range(len(cell_ids)):
"""print('cell_ids[i] = ',cell_ids[i])"""
# exposure_per_tile = exposure.loc[exposure[tile_id] == cell_id[i]]
exposure_per_tile = exposure.loc[exposure["tile_id"] == cell_ids[i]]
for i in range(cell_ids.shape[0]):
cell_id = cell_ids.loc[i][0]
exposure_per_tile = exposure.loc[exposure[tile_id] == cell_id]
"""print(
#'full_GMF_2 = ', full_ground_motion_field,
'result_filepath = ',result_filepath,
'fragility_pathname = ',fragility_pathname,
'exposure_per_tile = ', exposure_per_tile,
'taxonomy_conversion_filepath = ', taxonomy_conversion_filepath,
'ground_motion_field_filepath = ',ground_motion_field_filepath,
'ground_motion_type_index_map = ',ground_motion_type_index_map,
'interpolation_method = ',interpolation_method,
)"""
damageCalculator_TileVersion(
full_ground_motion_field,
full_ground_motion_field_map,
result_filepath,
fragility_pathname,
exposure_per_tile,
taxonomy_conversion_filepath,
ground_motion_field_filepath,
geometry_source_filepath,
ground_motion_type_index_map,
exposure_type,
interpolation_method,
)
......@@ -143,16 +178,6 @@ if __name__ == "__main__":
+ "the exposure locations (asset locations). "
+ "Options: [‘linear’, ‘nearest’, ‘cubic’] (default set to linear)",
)
parser.add_argument(
"-x",
"--exposure-type",
required=False,
type=str,
default="cell",
choices=["cell", "building"],
help="exposure type. 'cell' if your assets belong to a tile and 'building' if "
+ "your assets are buildings. Options = [‘cell’, ‘building’] (default set to cell)",
)
parser.add_argument(
"-f",
"--fragilities",
......@@ -177,15 +202,6 @@ if __name__ == "__main__":
help="path to the ground-motion values file. This file should include all the "
+ " intensity measure types that you have in your fragility functions (Required)",
)
parser.add_argument(
"-c",
"--cell-ids",
required=True,
type=str,
help="path to the file that includes all the unique cell-ids you have in your "
+ "exposure file (same as the origin-ids of the cell parts of the exposure "
+ "files or simpy cell-ids) (Required)",
)
parser.add_argument(
"-e",
"--exposure",
......@@ -193,17 +209,6 @@ if __name__ == "__main__":
type=str,
help="path to the file that includes the exposure assets (Required)",
)
parser.add_argument(
"-p",
"--geometry",
required=True,
type=str,
help="path to the file that includes the origin-ids of either your tiles "
+ "(in case exposure-type = 'cell'. As an example of the origin-id: "
+ "cell_92258412) "
+ "or the buildings (in case exposure-type = 'building'. As an example of the "
+ "origin-id: OSM_529613252) and their respective polygons. (Required)",
)
parser.add_argument(
"-r",
"--results",
......@@ -225,13 +230,10 @@ if __name__ == "__main__":
# read arguments from command line
interpolation_method = args.interpolation_method
exposure_type = args.exposure_type
fragility_pathname = args.fragilities
taxonomy_conversion_filepath = args.taxonomy_map
ground_motion_field_filepath = args.ground_motion_field
cell_id_source_filepath = args.cell_ids
exposure_filepath = args.exposure
geometry_source_filepath = args.geometry
result_filepath = args.results
overwrite_result_file = args.overwrite
......@@ -244,15 +246,14 @@ if __name__ == "__main__":
)
else:
os.remove(result_filepath)
startTime = datetime.datetime.now()
print(startTime)
get_exposure_per_tile(
exposure_filepath,
fragility_pathname,
taxonomy_conversion_filepath,
ground_motion_field_filepath,
geometry_source_filepath,
cell_id_source_filepath,
exposure_type,
interpolation_method,
result_filepath,
)
print("Execution time of the script", (datetime.datetime.now() - startTime))
......@@ -18,20 +18,20 @@
import numpy as np
import csv
import datetime
# import datetime
import losslib
def damageCalculator_TileVersion(
full_ground_motion_field,
full_ground_motion_field_map,
result_filepath,
fragility_pathname,
exposure,
taxonomy_conversion_path,
ground_motion_field_filepath,
geometry_source_path,
ground_motion_type_index_map,
exposure_type="cell",
# exposure_type="cell",
method="linear",
):
......@@ -136,58 +136,89 @@ def damageCalculator_TileVersion(
0.00015147218260022435,,4.834756765710135e-06,,5.24089746254536e-07,,
1.3276239491934405e-07
"""
"""print('full_ground_motion_field_map = \n', full_ground_motion_field_map)
print('ground_motion_type_index_map = ',ground_motion_type_index_map)"""
# Show the time the script begins running
startTime = datetime.datetime.now()
print(startTime)
# startTime = datetime.datetime.now()
# print(startTime)
# Read inputs as Numpy arrays or Pandas data-frames
taxonomy_to_fragility_source = csv.reader(open(taxonomy_conversion_path))
# Skip the header
next(taxonomy_to_fragility_source, None)
geometry_source = csv.reader(open(geometry_source_path), delimiter=";")
# print('geometry_source_path',geometry_source_path)
# geometry_source = csv.reader(open(geometry_source_path), delimiter=";")
# Skip the header
next(geometry_source, None)
# next(geometry_source, None)
# Read each column of the exposure model
"""print('exposure')"""
exposure
taxonomies = exposure.taxonomy
tot_num_buildings = exposure.number
lons = exposure.lon
lats = exposure.lat
asset_ids = exposure.id
origin_ids = exposure.origin_id
tile_geometries = exposure.tile_geometry
tile_ids = exposure.tile_id
building_geometries = exposure.building_geometry
building_ids = exposure.building_id
# origin_ids = exposure.origin_id
# Begin Computation
# Calling the function "taxonomy_to_fragility" to get a dictionary with keys as the
# taxonomy and the values as both the fragility function name (excluding the ".csv" part)
# and the column number of the respective ground-motion type in `ground-motion-field` file.
"""taxonomy_to_fragility_map, ground_motion_type = losslib.taxonomy_to_fragility(
ground_motion_type_index_map, taxonomy_to_fragility_source, fragility_pathname
)"""
key_list = list(ground_motion_type_index_map.keys())
"""print('key_list = ', key_list)"""
val_list = list(ground_motion_type_index_map.values())
"""print('value_list = ', val_list)"""
taxonomy_to_fragility_map = losslib.taxonomy_to_fragility(
ground_motion_type_index_map, taxonomy_to_fragility_source, fragility_pathname
)
"""print('taxonomy_to_fragility_map = \n ', taxonomy_to_fragility_map)"""
# Calling the function "origin_id_to_geometry" to get a dictionary with keys as the
# origin_id and the value as the respective polygon.
origin_id_to_geometry_map = losslib.origin_id_to_geometry(geometry_source, exposure_type)
# origin_id_to_geometry_map = losslib.origin_id_to_geometry(geometry_source, exposure_type)
# Define number of columns that contain the data in the fragility function files.
cls = range(1, 101)
# Looping through each line of the exposure file to run the computations asset by asset.
with open(result_filepath, "a+", newline="") as write_obj:
"""print('result_filepath = \n', result_filepath)"""
csv_writer = csv.writer(write_obj, delimiter=";")
for asset in range(exposure.shape[0]):
taxonomy = taxonomies.iloc[asset]
fragilityfunction_filename = taxonomy_to_fragility_map[taxonomy][0] + ".csv"
val = taxonomy_to_fragility_map[taxonomy][1]
ind = val_list.index(val)
ground_motion_type = key_list[ind]
num_buildings = tot_num_buildings.iloc[asset]
lon = lons.iloc[asset]
lat = lats.iloc[asset]
asset_id = asset_ids.iloc[asset]
origin_id = origin_ids.iloc[asset]
"""print(asset_id)"""
tile_geometry = tile_geometries.iloc[asset]
tile_id = tile_ids.iloc[asset]
building_geometry = building_geometries.iloc[asset]