Commit 58cefc48 authored by Fabian Kovac's avatar Fabian Kovac
Browse files

added LINK areas to data preparation pipeline

parent 9581b5ff
{"alp": [[11.295113604703001, 46.77565965318019], [11.292915627452905, 46.685633228459004], [11.290727245366687, 46.59560218736708], [11.16037034229228, 46.59708803734367], [11.030007189468392, 46.59841585234656], [10.89963848843137, 46.599585620859386], [10.769264940961294, 46.60059733273526], [10.638887249051182, 46.60145097919739], [10.508506114876166, 46.60214655283947], [10.509368458890501, 46.69219042111057], [10.378763486449374, 46.69272896958241], [10.248156462820807, 46.69310912465001], [10.117548095263372, 46.69333088299772], [10.117747980798494, 46.78337243462127], [10.117948744630665, 46.8734094945942], [10.118150392234403, 46.96344211928183], [10.118352929131001, 47.053470365041086], [10.118556360889011, 47.14349428822067], [10.118760693124749, 47.23351394516153], [10.118965931502805, 47.32352939219705], [10.119172081736561, 47.413540685653444], [10.119379149588712, 47.503547881849975], [10.119587140871788, 47.59355103709935], [10.119796061448701, 47.683550207708016], [10.252902120727075, 47.683323543758284], [10.253345144967554, 47.77331832765367], [10.386682914941588, 47.772928977386975], [10.520018459995429, 47.77237740278654], [10.653351013071966, 47.7716636089665], [10.78667980725237, 47.770787602544694], [10.785304260864924, 47.68079792575978], [10.918395462925794, 47.67976180983029], [11.051481408882276, 47.67856382620095], [11.184561337663446, 47.67720398591843], [11.317634488475251, 47.675682301520304], [11.450700100835473, 47.673998787034165], [11.45324056669596, 47.76397471823125], [11.586530714409705, 47.76212565931665], [11.719811741640791, 47.760114476182935], [11.853082883850096, 47.757941187455465], [11.856336175606012, 47.84790093125711], [11.989830341684335, 47.84556082582794], [11.993332962522269, 47.935511853784654], [12.127050279081248, 47.933004274328525], [12.26075525188139, 47.93033399748462], [12.394447107924236, 47.927501048213585], [12.52812507482065, 47.924505452989074], [12.523684414894815, 47.83457672856524], [12.657113448356043, 47.83142491302673], [12.652459399353502, 47.74149846909088], [12.785639982050066, 47.73819108829366], [12.780774596253673, 47.64826713690485], [12.77593086008591, 47.558338928975495], [12.908632531488882, 47.55488359150849], [13.041317688562748, 47.55126703148381], [13.173985583131847, 47.54748928195626], [13.30663546780797, 47.543550377440724], [13.439266596024055, 47.5394503539102], [13.445263903176222, 47.62934054562003], [13.451287994252027, 47.71922630525896], [13.584361313430888, 47.71494801790624], [13.717414107833054, 47.71050804222344], [13.850445623420217, 47.70590641912364], [13.983455107129757, 47.701143190989626], [13.990434841374908, 47.79098801979855], [14.123653336050886, 47.7860532814464], [14.256848134629857, 47.78095670342508], [14.390018482090781, 47.77569833284617], [14.523163624535359, 47.77027821829072], [14.656282809221866, 47.76469640980653], [14.64814576288676, 47.67490456076329], [14.640044894197807, 47.58510792126328], [14.772676510539629, 47.579387546460275], [14.764382682249048, 47.489597524877055], [14.896758484276454, 47.483727981124815], [14.888273662319456, 47.39394473987851], [15.020394289386454, 47.38792666304338], [15.01172042320742, 47.29815036082847], [15.003084808132227, 47.20836890669151], [14.994487205651284, 47.11858225099431], [14.863043236406629, 47.124564531801745], [14.73157236529556, 47.13038749881227], [14.60007530708067, 47.13605110023004], [14.468552777691682, 47.1415552856472], [14.33700549419437, 47.14690000604678], [14.3295653727886, 47.05705210015355], [14.198218497626582, 47.062227045868475], [14.066848462388998, 47.06724274607692], [13.935455982564513, 47.072099156266084], [13.804041774641677, 47.07679623331512], [13.672606556077605, 47.08133393549754], [13.541151045266533, 47.08571222248362], [13.409675961508306, 47.0899310553428], [13.278182024976747, 47.09399039654581], [13.146669956687962, 47.09789020996692], [13.015140478468526, 47.101630460885964], [12.88359431292361, 47.1052111159904], [12.75203218340501, 47.10863214337715], [12.74731551699293, 47.01867725715932], [12.61596316063485, 47.02193217276055], [12.484596386707489, 47.02502771613144], [12.353215915748235, 47.0279638598029], [12.221822468905993, 47.03074057771225], [12.0904167679092, 47.03335784520483], [12.086841875545078, 46.94336933942079], [12.08328266656404, 46.85337627427382], [12.079739043713534, 46.763378594542345], [11.948992256103482, 46.76582189150371], [11.818234875382876, 46.76810663219964], [11.68746761039877, 46.770232796634616], [11.556691170435185, 46.77220036619684], [11.42590626518187, 46.774009323659186], [11.295113604703001, 46.77565965318019]], "bks": [[15.056702824415181, 46.39404979163017], [15.04822112138594, 46.3042257827836], [14.918780981141145, 46.31026005786763], [14.927046876178373, 46.40009577175449], [14.935348725798383, 46.4899258345011], [14.943686751039392, 46.57975029630976], [14.95206117480086, 46.669569207321125], [14.960472221862913, 46.759382617613944], [14.968920118906025, 46.84919057720483], [14.977405094530898, 46.938993136047976], [14.985927379278664, 47.02879034403494], [14.994487205651284, 47.11858225099431], [15.003084808132227, 47.20836890669151], [15.01172042320742, 47.29815036082847], [15.020394289386454, 47.38792666304338], [14.888273662319456, 47.39394473987851], [14.896758484276454, 47.483727981124815], [15.02910664722406, 47.47769786291032], [15.161426438221492, 47.4715072249389], [15.293717125680498, 47.465156123336804], [15.30292470890604, 47.554897122435925], [15.435413506059572, 47.54837256427149], [15.444891026114576, 47.63809533400666], [15.577577789539138, 47.631396682635724], [15.58732731289295, 47.72110083102293], [15.72021188666644, 47.71422744781583], [15.85306378557097, 47.707192886595216], [15.863317705971589, 47.796863822094934], [15.99636627906261, 47.789653632893746], [16.129380466951524, 47.78228207656816], [16.2623595284358, 47.774749220992334], [16.395302723913765, 47.767055135472084], [16.384129868608326, 47.677444173763675], [16.516807333884454, 47.66960471908322], [16.505455934857373, 47.58000392750635], [16.637868436927196, 47.57201973749204], [16.626340418858035, 47.48242924216984], [16.75848872836149, 47.474300946746844], [16.746785998808168, 47.3847208703578], [16.878670889894064, 47.37644909556445], [16.866795339426346, 47.28687955738683], [16.7351348644857, 47.29513489359597], [16.72353500407512, 47.205542972293784], [16.854972032276038, 47.19730400015392], [16.843200643985078, 47.10772238005524], [16.831480852833312, 47.018134653167614], [16.819812339810007, 46.92854077545602], [16.6890398937328, 46.936731097831625], [16.6776419697268, 46.8471149545139], [16.547052870593873, 46.85513137132064], [16.416428177382993, 46.86298988329784], [16.405518053483767, 46.77333648530348], [16.275077850951313, 46.78102193558231], [16.264433709391945, 46.69134744483128], [16.25383586715185, 46.60166690341517], [16.24328404060581, 46.51198026503842], [16.113463089366206, 46.51946402412302], [15.983609494042518, 46.5267908877397], [15.853723928997432, 46.5339607930763], [15.723807069975429, 46.540973678621086], [15.714165806553597, 46.4512246128933], [15.584435055862738, 46.45806709824032], [15.454674565106759, 46.464752745837565], [15.32488500957056, 46.471281498494115], [15.195067065794932, 46.47765330032387], [15.186331920220058, 46.38784705419072], [15.056702824415181, 46.39404979163017]], "kar": [[14.789314837329561, 46.31613782442926], [14.781299733482637, 46.22628505542421], [14.652023481658633, 46.231995209219924], [14.522722735100228, 46.23754905566468], [14.393398163940558, 46.24294654775482], [14.264050439336147, 46.24818763978468], [14.134680233438731, 46.25327228734919], [14.005288219366989, 46.25820044734637], [14.012009628289443, 46.34811503961211], [13.882380345588643, 46.35289592135394], [13.752730467408396, 46.357519931668705], [13.62306067406937, 46.361987031104185], [13.493371646754058, 46.3662971815294], [13.363664067477748, 46.37045034613678], [13.233938619059423, 46.37444648944428], [13.104195985092574, 46.378285577297234], [12.974436849915943, 46.38196757687038], [12.844661898584176, 46.385492456669596], [12.714871816838421, 46.38886018653378], [12.719446123771949, 46.478848670561185], [12.589423358377607, 46.482065473870634], [12.459386743981229, 46.48512476566576], [12.329336972791394, 46.48802651961088], [12.19927473759082, 46.49077071071891], [12.202991710236885, 46.58077751289399], [12.07269817149803, 46.583369170349], [12.076210910563555, 46.67337624498671], [12.079739043713534, 46.763378594542345], [12.08328266656404, 46.85337627427382], [12.086841875545078, 46.94336933942079], [12.0904167679092, 47.03335784520483], [12.221822468905993, 47.03074057771225], [12.353215915748235, 47.0279638598029], [12.484596386707489, 47.02502771613144], [12.61596316063485, 47.02193217276055], [12.74731551699293, 47.01867725715932], [12.75203218340501, 47.10863214337715], [12.88359431292361, 47.1052111159904], [13.015140478468526, 47.101630460885964], [13.146669956687962, 47.09789020996692], [13.278182024976747, 47.09399039654581], [13.409675961508306, 47.0899310553428], [13.541151045266533, 47.08571222248362], [13.672606556077605, 47.08133393549754], [13.804041774641677, 47.07679623331512], [13.935455982564513, 47.072099156266084], [14.066848462388998, 47.06724274607692], [14.198218497626582, 47.062227045868475], [14.3295653727886, 47.05705210015355], [14.33700549419437, 47.14690000604678], [14.468552777691682, 47.1415552856472], [14.60007530708067, 47.13605110023004], [14.73157236529556, 47.13038749881227], [14.863043236406629, 47.124564531801745], [14.994487205651284, 47.11858225099431], [14.985927379278664, 47.02879034403494], [14.977405094530898, 46.938993136047976], [14.968920118906025, 46.84919057720483], [14.960472221862913, 46.759382617613944], [14.95206117480086, 46.669569207321125], [14.943686751039392, 46.57975029630976], [14.935348725798383, 46.4899258345011], [14.927046876178373, 46.40009577175449], [14.918780981141145, 46.31026005786763], [14.789314837329561, 46.31613782442926]], "noe": [[14.896758484276454, 47.483727981124815], [14.764382682249048, 47.489597524877055], [14.772676510539629, 47.579387546460275], [14.640044894197807, 47.58510792126328], [14.64814576288676, 47.67490456076329], [14.656282809221866, 47.76469640980653], [14.789375284598881, 47.758952958905056], [14.797780700833492, 47.84872844987302], [14.806223786915028, 47.93849919730988], [14.814704783208846, 48.02826525111982], [14.823223932173192, 48.11802666114686], [14.689197398376644, 48.12381690784629], [14.697518821131839, 48.21358555893355], [14.705877831071314, 48.30334972089532], [14.71427467035268, 48.39310944375229], [14.722709583260682, 48.4828647774669], [14.587703969500998, 48.48853842141509], [14.595936615249748, 48.57830113774599], [14.604206743956215, 48.668059619731935], [14.61251459945598, 48.75781391752052], [14.62086042774566, 48.84756408120306], [14.629244477006722, 48.93731016081432], [14.765463954017328, 48.931577353477294], [14.774132560748647, 49.021307398250535], [14.782841012648756, 49.11103340196238], [14.791589571881413, 49.2007554140981], [14.92852084086364, 49.194819426188936], [15.065421435579575, 49.18871649045154], [15.2022905204449, 49.18244666798517], [15.339127261411907, 49.176010021518685], [15.47593082600882, 49.16940661540655], [15.612700383378986, 49.162636515624946], [15.602466392703215, 49.072994466134304], [15.73895435913876, 49.06607227527067], [15.87540691037269, 49.05898387134425], [16.011823226282626, 49.051729324655916], [16.00089989853147, 48.96212733173151], [16.137034277196843, 48.95472220576801], [16.2731310488937, 48.947151423071695], [16.40918940441266, 48.93941505816533], [16.420846587327468, 49.02896955489856], [16.557109796291602, 49.02105117196675], [16.693332696328845, 49.01296702158393], [16.68118763933023, 48.9234458876503], [16.817125909671013, 48.91521323890989], [16.953022545791196, 48.90681532168628], [17.0888767480611, 48.89825221829609], [17.076060620403023, 48.80877841439864], [17.211630049308596, 48.80006832449937], [17.198631661366957, 48.71060725943086], [17.18569217259784, 48.621140776185655], [17.172811203886866, 48.5316688334216], [17.159988379422124, 48.4421913896642], [17.147223326658665, 48.35270840330784], [17.281558785539765, 48.343924601602176], [17.26861622760216, 48.25445397274274], [17.402674071187672, 48.24552548843462], [17.38955599787406, 48.15606733300537], [17.376496647076287, 48.06660334332094], [17.363495646376354, 47.97713347832185], [17.350552626556425, 47.887657696813726], [17.337667221564928, 47.79817595746823], [17.324839068483012, 47.708688218824314], [17.312067807491516, 47.61919443928916], [17.299353081838312, 47.529694577139296], [17.167135603656558, 47.538479917180915], [17.034877681211345, 47.54710518064305], [17.022670549719166, 47.457564451879314], [16.890599010904022, 47.466012658383896], [16.878670889894064, 47.37644909556445], [16.746785998808168, 47.3847208703578], [16.75848872836149, 47.474300946746844], [16.626340418858035, 47.48242924216984], [16.637868436927196, 47.57201973749204], [16.505455934857373, 47.58000392750635], [16.516807333884454, 47.66960471908322], [16.384129868608326, 47.677444173763675], [16.395302723913765, 47.767055135472084], [16.406525475875586, 47.85666059457704], [16.41779844123618, 47.94626059610686], [16.429121939478723, 48.03585518498748], [16.562721970941027, 48.02795213236086], [16.57432951232595, 48.11752526997326], [16.585989265172437, 48.20709300994884], [16.597701563801945, 48.29665539642131], [16.60946674545099, 48.386212473414744], [16.474927748516134, 48.39418030891614], [16.340350351387123, 48.401984717664085], [16.205735327470354, 48.40962562529758], [16.07108345193279, 48.41710295895457], [15.936395501667429, 48.424416647276416], [15.925814406914538, 48.334781316551535], [15.91528095189836, 48.24514103894667], [15.904794832084413, 48.15549576810439], [15.89435574557826, 48.0658454575778], [16.028100695102555, 48.05859132172134], [16.017475192262825, 47.96895064148077], [16.006897153753187, 47.87930476063111], [15.99636627906261, 47.789653632893746], [15.863317705971589, 47.796863822094934], [15.85306378557097, 47.707192886595216], [15.72021188666644, 47.71422744781583], [15.58732731289295, 47.72110083102293], [15.577577789539138, 47.631396682635724], [15.444891026114576, 47.63809533400666], [15.435413506059572, 47.54837256427149], [15.30292470890604, 47.554897122435925], [15.293717125680498, 47.465156123336804], [15.161426438221492, 47.4715072249389], [15.02910664722406, 47.47769786291032], [14.896758484276454, 47.483727981124815]], "ooe": [[13.445263903176222, 47.62934054562003], [13.439266596024055, 47.5394503539102], [13.30663546780797, 47.543550377440724], [13.173985583131847, 47.54748928195626], [13.041317688562748, 47.55126703148381], [12.908632531488882, 47.55488359150849], [12.77593086008591, 47.558338928975495], [12.780774596253673, 47.64826713690485], [12.785639982050066, 47.73819108829366], [12.652459399353502, 47.74149846909088], [12.657113448356043, 47.83142491302673], [12.661788380826469, 47.921347239796205], [12.52812507482065, 47.924505452989074], [12.532585701280631, 48.014430144303894], [12.537066422290438, 48.1043508570103], [12.541567366986852, 48.19426764558896], [12.546088665639948, 48.28418056450055], [12.6806996341085, 48.280996461474246], [12.685481010803638, 48.37089901691965], [12.820315599052872, 48.36754411267826], [12.825359244564625, 48.45743596009197], [12.960417512361769, 48.453909581164794], [13.095458091498111, 48.450218678014984], [13.101007626445575, 48.54009184112228], [13.106582436683105, 48.62996121822044], [13.242088195391137, 48.62608985892836], [13.247931928940606, 48.71594746334216], [13.383661474765116, 48.71190259311473], [13.389776377202097, 48.80174805947716], [13.525729721412882, 48.797528994332396], [13.532118052022318, 48.88736195195227], [13.668295193252757, 48.8829680053172], [13.674959225027843, 48.972788078129156], [13.811360149065639, 48.968218560855654], [13.947737632853196, 48.96348271052114], [14.08409084744718, 48.95858057401659], [14.076688605263966, 48.868790148156016], [14.212770994704822, 48.86373234518027], [14.205157914660889, 48.77394856530213], [14.34097012524368, 48.76873578230136], [14.3488276411233, 48.858508698515436], [14.484857724912692, 48.85311925953244], [14.62086042774566, 48.84756408120306], [14.61251459945598, 48.75781391752052], [14.604206743956215, 48.668059619731935], [14.595936615249748, 48.57830113774599], [14.587703969500998, 48.48853842141509], [14.722709583260682, 48.4828647774669], [14.71427467035268, 48.39310944375229], [14.705877831071314, 48.30334972089532], [14.697518821131839, 48.21358555893355], [14.689197398376644, 48.12381690784629], [14.823223932173192, 48.11802666114686], [14.814704783208846, 48.02826525111982], [14.806223786915028, 47.93849919730988], [14.797780700833492, 47.84872844987302], [14.789375284598881, 47.758952958905056], [14.656282809221866, 47.76469640980653], [14.523163624535359, 47.77027821829072], [14.390018482090781, 47.77569833284617], [14.256848134629857, 47.78095670342508], [14.123653336050886, 47.7860532814464], [13.990434841374908, 47.79098801979855], [13.983455107129757, 47.701143190989626], [13.850445623420217, 47.70590641912364], [13.717414107833054, 47.71050804222344], [13.584361313430888, 47.71494801790624], [13.451287994252027, 47.71922630525896], [13.445263903176222, 47.62934054562003]], "vbg": [[10.117747980798494, 46.78337243462127], [10.117548095263372, 46.69333088299772], [9.986939091094943, 46.69339424269144], [9.856330157661487, 46.69329920317851], [9.856085853467846, 46.78334069253569], [9.725255608725222, 46.783086756518955], [9.594426859370758, 46.78267411302389], [9.59373536134286, 46.87270979693769], [9.462685779131785, 46.872137323762125], [9.461767215229113, 46.962167435173775], [9.330496569906826, 46.9614345054415], [9.32934896545858, 47.05145877482278], [9.328196291020216, 47.14147870344561], [9.327038514775506, 47.231494347535225], [9.325875604634783, 47.32150576330833], [9.32470752823204, 47.411513006973394], [9.323534252921954, 47.50151613473099], [9.32235574577691, 47.59151520277405], [9.321171973583946, 47.68151026728821], [9.454270717984196, 47.6822549982814], [9.587372586315125, 47.68283783858044], [9.586649773506494, 47.77283164027159], [9.719987159866504, 47.773253435741985], [9.853326157425272, 47.77351300387013], [9.986665998966101, 47.773610342249135], [10.12000591723328, 47.7735454499764], [10.119796061448701, 47.683550207708016], [10.119587140871788, 47.59355103709935], [10.119379149588712, 47.503547881849975], [10.119172081736561, 47.413540685653444], [10.118965931502805, 47.32352939219705], [10.118760693124749, 47.23351394516153], [10.118556360889011, 47.14349428822067], [10.118352929131001, 47.053470365041086], [10.118150392234403, 46.96344211928183], [10.117948744630665, 46.8734094945942], [10.117747980798494, 46.78337243462127]], "vie": [[16.406525475875586, 47.85666059457704], [16.395302723913765, 47.767055135472084], [16.2623595284358, 47.774749220992334], [16.129380466951524, 47.78228207656816], [15.99636627906261, 47.789653632893746], [16.006897153753187, 47.87930476063111], [16.017475192262825, 47.96895064148077], [16.028100695102555, 48.05859132172134], [15.89435574557826, 48.0658454575778], [15.904794832084413, 48.15549576810439], [15.91528095189836, 48.24514103894667], [15.925814406914538, 48.334781316551535], [15.936395501667429, 48.424416647276416], [16.07108345193279, 48.41710295895457], [16.205735327470354, 48.40962562529758], [16.340350351387123, 48.401984717664085], [16.474927748516134, 48.39418030891614], [16.60946674545099, 48.386212473414744], [16.597701563801945, 48.29665539642131], [16.585989265172437, 48.20709300994884], [16.57432951232595, 48.11752526997326], [16.562721970941027, 48.02795213236086], [16.429121939478723, 48.03585518498748], [16.41779844123618, 47.94626059610686], [16.406525475875586, 47.85666059457704]]}
\ No newline at end of file
...@@ -2,12 +2,13 @@ ...@@ -2,12 +2,13 @@
# Title: Data Preparation for LINK Configs and Transmissions # Title: Data Preparation for LINK Configs and Transmissions
# Author: Fabian Kovac <ds191008@fhstp.ac.at> # Author: Fabian Kovac <ds191008@fhstp.ac.at>
# Team: University of Applied Sciences St. Pölten # Team: University of Applied Sciences St. Pölten
# Version: 3.2 # Version: 3.3
# Last changed: 2021-11-11 # Last changed: 2021-12-15
# #
import sys import sys
import gzip import gzip
import json
import pathlib import pathlib
import argparse import argparse
import datetime import datetime
...@@ -15,6 +16,8 @@ import datetime ...@@ -15,6 +16,8 @@ import datetime
import numpy as np import numpy as np
import pandas as pd import pandas as pd
from shapely.geometry import Point, Polygon
def parse_arguments() -> argparse.Namespace: def parse_arguments() -> argparse.Namespace:
"""Parses provided commandline arguments for LINK """Parses provided commandline arguments for LINK
...@@ -68,6 +71,28 @@ def _log(msg: str) -> None: ...@@ -68,6 +71,28 @@ def _log(msg: str) -> None:
print(msg) print(msg)
def load_areas(file: pathlib.Path = 'areas.json') -> dict:
"""Load json file with areas and corresponding polygons
Parameters:
file (pathlib.Path): Path to areas json file
Returns:
areas_poly (dict): Dict containing areas and corresponding polygons
"""
# area dictionary
areas_poly = {}
# load areas geojson file
with open(file) as f:
for area, points in json.load(f).items():
transformed = Polygon([tuple(p) for p in points])
areas_poly.update({area : transformed})
return areas_poly
def load_inca_file(file_inca: pathlib.Path) -> np.array: def load_inca_file(file_inca: pathlib.Path) -> np.array:
"""Loads gzipped INCA data of a given file """Loads gzipped INCA data of a given file
...@@ -188,6 +213,28 @@ def get_distance(lon_a: np.array, lat_a: np.array, alt_a: np.array, lon_b: np.ar ...@@ -188,6 +213,28 @@ def get_distance(lon_a: np.array, lat_a: np.array, alt_a: np.array, lon_b: np.ar
return distance return distance
def get_link_area(lon: float, lat: float) -> str:
"""Get geographical area depending on the start of the link
Parameters:
lon (float): Float containing wgs 84 longitudes
lat (float): Float containing wgs 84 latitudes
Returns:
area (str): Geographical area the link belongs to
"""
# define point with start-coordinates of link
point = Point(lon, lat)
# get area depending on point
for area, poly in areas_poly.items():
if point.within(poly):
return area
return 'ukn'
def wgs84_to_lambert(lon: np.array, lat: np.array) -> tuple: def wgs84_to_lambert(lon: np.array, lat: np.array) -> tuple:
"""Convert UTM coordinates to an Austrian Lambert Conic Conformal Projection (lcc) """Convert UTM coordinates to an Austrian Lambert Conic Conformal Projection (lcc)
EPSG code: 31287, see https://epsg.io/31287 EPSG code: 31287, see https://epsg.io/31287
...@@ -451,6 +498,10 @@ def prep() -> None: ...@@ -451,6 +498,10 @@ def prep() -> None:
_log('Calculated distances between sites using a WGS84 ellipsoid') _log('Calculated distances between sites using a WGS84 ellipsoid')
# calculate geographical area of link
df_config['AREA'] = df_config.apply(lambda row: get_link_area(row['LONGITUDE_A'], row['LATITUDE_A']), axis = 1)
# convert CAPACITYINTERFACE to int # convert CAPACITYINTERFACE to int
df_config['CAPACITYINTERFACE'] = df_config['CAPACITYINTERFACE'].map(lambda x: str(x)[:-5]).astype('int') df_config['CAPACITYINTERFACE'] = df_config['CAPACITYINTERFACE'].map(lambda x: str(x)[:-5]).astype('int')
_log('Converted CAPACITYINTERFACE to int') _log('Converted CAPACITYINTERFACE to int')
...@@ -585,6 +636,7 @@ def prep() -> None: ...@@ -585,6 +636,7 @@ def prep() -> None:
'ANT_HEIGHT_ALTITUDE_B' : 'AltEnd', 'ANT_HEIGHT_ALTITUDE_B' : 'AltEnd',
'LENGTH' : 'PathLength', 'LENGTH' : 'PathLength',
'FREQUENCY' : 'Frequency', 'FREQUENCY' : 'Frequency',
'AREA' : 'Area'
} }
# check if RXFREQUENCY and TXFREQUENCY exists (only present after 2021-05) # check if RXFREQUENCY and TXFREQUENCY exists (only present after 2021-05)
...@@ -659,6 +711,9 @@ if __name__ == '__main__': ...@@ -659,6 +711,9 @@ if __name__ == '__main__':
_log('Invalid path for inca directory!') _log('Invalid path for inca directory!')
start_prep = False start_prep = False
# load areas json file
areas_poly = load_areas(pathlib.Path('areas.json'))
# start prep if flag is True, otherwise exit with code 2 # start prep if flag is True, otherwise exit with code 2
if start_prep: if start_prep:
prep() prep()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment