From 3355d470f9db1537ac6e4640124c6bd086e35e33 Mon Sep 17 00:00:00 2001 From: Robert Lanzafame <R.C.Lanzafame@tudelft.nl> Date: Sun, 22 Sep 2024 08:20:42 +0200 Subject: [PATCH] GA 1.4 setup --- .../Analysis_solution.ipynb} | 0 content/GA_1_4/data/gnss_observations.csv | 731 ++++++++++++++++++ content/GA_1_4/data/groundwater_levels.csv | 26 + content/GA_1_4/data/insar_observations.csv | 62 ++ content/GA_1_4/functions.py | 149 ++++ 5 files changed, 968 insertions(+) rename content/{GA_1_3/Analysis_1_4_Solution.ipynb => GA_1_4/Analysis_solution.ipynb} (100%) create mode 100644 content/GA_1_4/data/gnss_observations.csv create mode 100644 content/GA_1_4/data/groundwater_levels.csv create mode 100644 content/GA_1_4/data/insar_observations.csv create mode 100644 content/GA_1_4/functions.py diff --git a/content/GA_1_3/Analysis_1_4_Solution.ipynb b/content/GA_1_4/Analysis_solution.ipynb similarity index 100% rename from content/GA_1_3/Analysis_1_4_Solution.ipynb rename to content/GA_1_4/Analysis_solution.ipynb diff --git a/content/GA_1_4/data/gnss_observations.csv b/content/GA_1_4/data/gnss_observations.csv new file mode 100644 index 00000000..b64157e5 --- /dev/null +++ b/content/GA_1_4/data/gnss_observations.csv @@ -0,0 +1,731 @@ +,times,observations[m] +0,2017-01-01,-0.013980633493923006 +1,2017-01-02,0.010392229436626857 +2,2017-01-03,-0.01709087092486749 +3,2017-01-04,-0.007924054321565701 +4,2017-01-05,-0.014729496084847239 +5,2017-01-06,0.008820518768038469 +6,2017-01-07,-0.028232073324520983 +7,2017-01-08,-0.012472072682226894 +8,2017-01-09,-0.008943369236193939 +9,2017-01-10,-0.002403986989777219 +10,2017-01-11,-0.030359693320265706 +11,2017-01-12,-0.010588346449685255 +12,2017-01-13,0.0074069663396387885 +13,2017-01-14,-0.0027848010763760504 +14,2017-01-15,0.029432302555465036 +15,2017-01-16,-0.060283012927538605 +16,2017-01-17,-0.02842428328087463 +17,2017-01-18,-0.02348476263257201 +18,2017-01-19,-0.019851770358615135 +19,2017-01-20,0.021821381651536395 +20,2017-01-21,0.018144686872425007 +21,2017-01-22,-0.03594233808614037 +22,2017-01-23,-0.011512587645563975 +23,2017-01-24,-0.009229525262063991 +24,2017-01-25,-0.040287716995375984 +25,2017-01-26,-0.00911412660497251 +26,2017-01-27,-0.0025505932826508466 +27,2017-01-28,-0.005260189277362003 +28,2017-01-29,-0.038502943482658925 +29,2017-01-30,0.007961297297784603 +30,2017-01-31,-0.0050528778865576085 +31,2017-02-01,-0.00971585451796592 +32,2017-02-02,-0.02031988182450449 +33,2017-02-03,0.0014441529188012423 +34,2017-02-04,0.004315625300345044 +35,2017-02-05,-0.01691242655606824 +36,2017-02-06,-0.008559273759570689 +37,2017-02-07,0.002280388846362157 +38,2017-02-08,-0.03966322198896894 +39,2017-02-09,-0.008803805182009324 +40,2017-02-10,-0.03939764658672848 +41,2017-02-11,-0.024848741693069585 +42,2017-02-12,-0.004177599964829027 +43,2017-02-13,-0.01360760397304346 +44,2017-02-14,-0.017661874133777185 +45,2017-02-15,-0.04631672121167857 +46,2017-02-16,0.0006295299708419921 +47,2017-02-17,-0.001707252203119073 +48,2017-02-18,-0.024334329804524234 +49,2017-02-19,-0.008346251848624473 +50,2017-02-20,-0.05001702110883982 +51,2017-02-21,0.022895936466546567 +52,2017-02-22,-0.02447282250606749 +53,2017-02-23,-0.01828791794806174 +54,2017-02-24,-0.01904122469245815 +55,2017-02-25,-0.05060539576767478 +56,2017-02-26,-0.01211494576941593 +57,2017-02-27,-0.010346777087190655 +58,2017-02-28,-0.03893159199237228 +59,2017-03-01,-0.023459753114099494 +60,2017-03-02,-0.06487929854929686 +61,2017-03-03,0.0032614483965151646 +62,2017-03-04,0.02148968243865328 +63,2017-03-05,0.0050524004491025384 +64,2017-03-06,-0.010707996972180396 +65,2017-03-07,-0.03076868696023529 +66,2017-03-08,-0.013808736223770041 +67,2017-03-09,0.008335868062137108 +68,2017-03-10,-0.006700060271268245 +69,2017-03-11,-0.020370661774549735 +70,2017-03-12,-0.06406732494232245 +71,2017-03-13,-0.02692563075487449 +72,2017-03-14,-0.012820410841250199 +73,2017-03-15,-0.036116630192136887 +74,2017-03-16,-0.021256756708369393 +75,2017-03-17,-0.028031284066872095 +76,2017-03-18,-0.01789040447226827 +77,2017-03-19,0.01125130978846399 +78,2017-03-20,0.002979024028185586 +79,2017-03-21,-0.023241444530613296 +80,2017-03-22,-0.06951476747048582 +81,2017-03-23,-0.02004339892985907 +82,2017-03-24,-0.026731826372419568 +83,2017-03-25,-0.014050526640135945 +84,2017-03-26,0.004302918197866629 +85,2017-03-27,-0.03695571462505445 +86,2017-03-28,-0.02613560253856793 +87,2017-03-29,-0.015514542234454098 +88,2017-03-30,-0.0036698832584468426 +89,2017-03-31,-0.013228037616542173 +90,2017-04-01,-0.044868147965186116 +91,2017-04-02,-0.0011078181853280342 +92,2017-04-03,-0.014066367168620544 +93,2017-04-04,-0.025216789794562912 +94,2017-04-05,-0.020864169999325135 +95,2017-04-06,-0.0323908363908855 +96,2017-04-07,-0.013645708994858055 +97,2017-04-08,-0.007768693955721873 +98,2017-04-09,-0.06666027405350872 +99,2017-04-10,-0.003753818190557128 +100,2017-04-11,-0.05293319849324114 +101,2017-04-12,-0.015231007975540656 +102,2017-04-13,-0.01226728427188674 +103,2017-04-14,-0.05668761878655101 +104,2017-04-15,-0.04025779978106283 +105,2017-04-16,-0.027372787773513582 +106,2017-04-17,-0.03430416322456584 +107,2017-04-18,-0.018377364452772476 +108,2017-04-19,-0.03026988477848406 +109,2017-04-20,-0.048268211025135635 +110,2017-04-21,-0.043473219920457246 +111,2017-04-22,-0.006210907004661238 +112,2017-04-23,-0.014302361234536765 +113,2017-04-24,-0.03351407773716189 +114,2017-04-25,-0.026789052975625737 +115,2017-04-26,-0.014703453981545551 +116,2017-04-27,-0.013935244964165084 +117,2017-04-28,-0.0379333129286595 +118,2017-04-29,-0.0575052649328497 +119,2017-04-30,-0.074454374850697 +120,2017-05-01,-0.03337731048445455 +121,2017-05-02,-0.0152364298498023 +122,2017-05-03,-0.012136332370922803 +123,2017-05-04,0.010028894481761759 +124,2017-05-05,-0.021639687615224227 +125,2017-05-06,-0.019708097685550745 +126,2017-05-07,-0.026016365333691855 +127,2017-05-08,-0.02942205622480826 +128,2017-05-09,-0.011588380450157068 +129,2017-05-10,-0.017991405631834517 +130,2017-05-11,-0.026380992042629954 +131,2017-05-12,-0.039445160656120914 +132,2017-05-13,-0.025073319513353926 +133,2017-05-14,-0.02906925092019357 +134,2017-05-15,-0.004353833892613984 +135,2017-05-16,-0.008951147892876316 +136,2017-05-17,-0.03846897790336566 +137,2017-05-18,-0.005602751480265643 +138,2017-05-19,-0.03166557149331192 +139,2017-05-20,-0.02106418368647614 +140,2017-05-21,-0.004995101181015881 +141,2017-05-22,-0.038382254990657345 +142,2017-05-23,-0.020579364006931576 +143,2017-05-24,-0.03991656321464222 +144,2017-05-25,-0.05205270477895109 +145,2017-05-26,-0.00810771286550864 +146,2017-05-27,-0.022456436754461358 +147,2017-05-28,-0.035188226646923 +148,2017-05-29,-0.046623554449867974 +149,2017-05-30,-0.028819637289951603 +150,2017-05-31,-0.032636825955470516 +151,2017-06-01,-0.01670415393858129 +152,2017-06-02,-0.028303993245654614 +153,2017-06-03,-0.032764013366733846 +154,2017-06-04,-0.021067280177617397 +155,2017-06-05,-0.045834553270266906 +156,2017-06-06,-0.002452280978159735 +157,2017-06-07,-0.01507566172028037 +158,2017-06-08,-0.0047070773725802414 +159,2017-06-09,-0.03107347617215988 +160,2017-06-10,-0.009796733748022826 +161,2017-06-11,-0.012298589045246399 +162,2017-06-12,-0.045610907937478906 +163,2017-06-13,-0.020377907814901373 +164,2017-06-14,-0.01788281743558035 +165,2017-06-15,-0.031230143532941984 +166,2017-06-16,-0.028005567698296995 +167,2017-06-17,-0.016056573344184942 +168,2017-06-18,-0.023164204629150868 +169,2017-06-19,-0.03766199827763505 +170,2017-06-20,-0.013715007744395163 +171,2017-06-21,-0.019164830574709947 +172,2017-06-22,-0.018839435550026186 +173,2017-06-23,-0.021135430105442016 +174,2017-06-24,-0.01583105623333864 +175,2017-06-25,-0.02685065758371336 +176,2017-06-26,-0.03549599040349227 +177,2017-06-27,-0.03367572152934255 +178,2017-06-28,-0.005958200947197269 +179,2017-06-29,-0.052800834235161215 +180,2017-06-30,-0.04441991901706415 +181,2017-07-01,-0.04415523842601578 +182,2017-07-02,-0.04664598769116095 +183,2017-07-03,-0.03760399070213838 +184,2017-07-04,-0.02636045100725808 +185,2017-07-05,-0.011531574982639937 +186,2017-07-06,-0.047956706159607176 +187,2017-07-07,0.002488143895304041 +188,2017-07-08,-0.0053091990148986246 +189,2017-07-09,-0.024895484699649747 +190,2017-07-10,-0.05740215661885412 +191,2017-07-11,-0.03749280813745152 +192,2017-07-12,-0.014510330362473173 +193,2017-07-13,-0.022439800919603126 +194,2017-07-14,-0.002431509734893287 +195,2017-07-15,-0.034046128741806125 +196,2017-07-16,-0.015673926010587546 +197,2017-07-17,-0.024578784825268745 +198,2017-07-18,-0.036878025115605374 +199,2017-07-19,0.004222270767007118 +200,2017-07-20,-0.05025749274036462 +201,2017-07-21,-0.01528681633927686 +202,2017-07-22,-0.04075798743960528 +203,2017-07-23,-0.03570739970899196 +204,2017-07-24,-0.023744392437230345 +205,2017-07-25,-0.03391149156499011 +206,2017-07-26,-0.01625229119875934 +207,2017-07-27,-0.018844891518373517 +208,2017-07-28,-0.037293047865614326 +209,2017-07-29,-0.02280117622374149 +210,2017-07-30,-0.02577194571664042 +211,2017-07-31,-0.02843034071962423 +212,2017-08-01,-0.04333807701285702 +213,2017-08-02,-0.03877499318280037 +214,2017-08-03,-0.023221869321800374 +215,2017-08-04,-0.011304918610314614 +216,2017-08-05,-0.04120350758580099 +217,2017-08-06,-0.008528464508482103 +218,2017-08-07,-0.023988460199195594 +219,2017-08-08,-0.04571724548156357 +220,2017-08-09,-0.0217606822507075 +221,2017-08-10,-0.013266287904011556 +222,2017-08-11,-0.022528171052861017 +223,2017-08-12,0.008351835488165218 +224,2017-08-13,-0.021745845312943175 +225,2017-08-14,-0.012927990447956285 +226,2017-08-15,-0.026091506438185853 +227,2017-08-16,-0.011495937475918235 +228,2017-08-17,-0.062070639711755624 +229,2017-08-18,-0.03893971602608662 +230,2017-08-19,-0.03148067811850246 +231,2017-08-20,-0.018397042619620232 +232,2017-08-21,-0.023070229069080066 +233,2017-08-22,-0.009555855212456128 +234,2017-08-23,-0.020419053257844492 +235,2017-08-24,-0.02260188864478086 +236,2017-08-25,-0.027826309080505738 +237,2017-08-26,-0.02313010308728478 +238,2017-08-27,-0.013084123474062164 +239,2017-08-28,-0.014135274247301462 +240,2017-08-29,-0.012210271151476174 +241,2017-08-30,-0.028939504899360268 +242,2017-08-31,-0.0357034360105615 +243,2017-09-01,-0.03228583647798765 +244,2017-09-02,-0.019909761979812465 +245,2017-09-03,-0.0009169465236438593 +246,2017-09-04,-0.021435440678044954 +247,2017-09-05,-0.017687040874967055 +248,2017-09-06,-0.04977752935923334 +249,2017-09-07,0.015265825697789191 +250,2017-09-08,-0.07151986079517271 +251,2017-09-09,0.0022656797137706568 +252,2017-09-10,-0.03337563175661388 +253,2017-09-11,-0.010702947808915338 +254,2017-09-12,-0.01287383443988571 +255,2017-09-13,-0.024170716329447475 +256,2017-09-14,-0.027664785887682054 +257,2017-09-15,-0.03931238616618542 +258,2017-09-16,-0.026038528437826006 +259,2017-09-17,-0.008750277282116133 +260,2017-09-18,-0.01971803050936 +261,2017-09-19,-0.03858417169414908 +262,2017-09-20,-0.007993712233047515 +263,2017-09-21,-0.04345135870907785 +264,2017-09-22,-0.02228088221715338 +265,2017-09-23,-0.03882802954330353 +266,2017-09-24,-0.03723214250629654 +267,2017-09-25,-0.009327311811476835 +268,2017-09-26,-0.03249717688451695 +269,2017-09-27,-0.04831183721164555 +270,2017-09-28,-0.033697466066297664 +271,2017-09-29,-0.014298194783434618 +272,2017-09-30,-0.03661919487700272 +273,2017-10-01,-0.007487000844895106 +274,2017-10-02,-0.010614881147375584 +275,2017-10-03,-0.024670117387108267 +276,2017-10-04,-0.008193465834854516 +277,2017-10-05,0.002114879999913326 +278,2017-10-06,-0.05561373971871915 +279,2017-10-07,-0.00853851062418769 +280,2017-10-08,-0.016718247816296043 +281,2017-10-09,-0.03067399421142436 +282,2017-10-10,-0.01583214300729978 +283,2017-10-11,-0.019811646864463957 +284,2017-10-12,-0.03437235837153479 +285,2017-10-13,-0.0033752581036846745 +286,2017-10-14,-0.023562620114646604 +287,2017-10-15,-0.0078092223165175285 +288,2017-10-16,-0.02928766709476262 +289,2017-10-17,-0.05010266111634323 +290,2017-10-18,-0.021864129751606697 +291,2017-10-19,-0.02902943818473904 +292,2017-10-20,-0.04438259065555042 +293,2017-10-21,-0.050816527257801225 +294,2017-10-22,-0.016156945910574073 +295,2017-10-23,-0.00632490934582881 +296,2017-10-24,-0.0043766458843353465 +297,2017-10-25,-0.01728964693117526 +298,2017-10-26,-0.025207666213793434 +299,2017-10-27,-0.02239394490269293 +300,2017-10-28,-0.05452953903696456 +301,2017-10-29,-0.013246668735156161 +302,2017-10-30,-0.03252971996513502 +303,2017-10-31,-0.04402198908973759 +304,2017-11-01,-0.028352454996584116 +305,2017-11-02,-0.022069750280006715 +306,2017-11-03,-0.02882319831376217 +307,2017-11-04,-0.02457191145122134 +308,2017-11-05,0.008090560777547606 +309,2017-11-06,-0.011623209523909578 +310,2017-11-07,-0.045655727390274486 +311,2017-11-08,-0.01510391848726562 +312,2017-11-09,-0.057613325906698286 +313,2017-11-10,-0.015735185727657055 +314,2017-11-11,-0.01791600894025347 +315,2017-11-12,-0.024738060805910646 +316,2017-11-13,-0.039729961066116454 +317,2017-11-14,-0.03999504773938404 +318,2017-11-15,-0.01910576835763634 +319,2017-11-16,-0.0345628489566304 +320,2017-11-17,-0.012846451398216432 +321,2017-11-18,-0.03481125015779392 +322,2017-11-19,-0.030958930933230773 +323,2017-11-20,-0.014173127328683859 +324,2017-11-21,-0.026128048809120025 +325,2017-11-22,-0.028168988482753027 +326,2017-11-23,-0.02168311440025896 +327,2017-11-24,-0.020150729145203095 +328,2017-11-25,-0.027092542348159852 +329,2017-11-26,-0.022495309947541207 +330,2017-11-27,-0.02767869848059472 +331,2017-11-28,-0.019819625115635 +332,2017-11-29,-0.02172957059784534 +333,2017-11-30,-0.01853561341020474 +334,2017-12-01,-0.014088526889919201 +335,2017-12-02,-0.041664405962320884 +336,2017-12-03,-0.04662338609662768 +337,2017-12-04,-0.030307985597046144 +338,2017-12-05,-0.02893228009108715 +339,2017-12-06,-0.01947943153083498 +340,2017-12-07,-0.044765271197041163 +341,2017-12-08,-0.02363096630659634 +342,2017-12-09,-0.019959799065562354 +343,2017-12-10,-0.05098761137465116 +344,2017-12-11,-0.01991118365694625 +345,2017-12-12,-0.005439644994467564 +346,2017-12-13,-0.024508527281144565 +347,2017-12-14,-0.03972179373605383 +348,2017-12-15,-0.034974817849157055 +349,2017-12-16,-0.0274169475404277 +350,2017-12-17,-0.06409056034735416 +351,2017-12-18,-0.07430103575133148 +352,2017-12-19,-0.004265356052082621 +353,2017-12-20,-0.033180469549972544 +354,2017-12-21,-0.028833039486138193 +355,2017-12-22,-0.012247248192318939 +356,2017-12-23,-0.022560415488944337 +357,2017-12-24,-0.03338874109146377 +358,2017-12-25,-0.02742477723746487 +359,2017-12-26,-0.01796937731426123 +360,2017-12-27,-0.017707979058617818 +361,2017-12-28,-0.0288136400107314 +362,2017-12-29,-0.013990413039908106 +363,2017-12-30,-0.014104407338273183 +364,2017-12-31,-0.03316660807106439 +365,2018-01-01,-0.0409085119070888 +366,2018-01-02,-0.020876616191632932 +367,2018-01-03,-0.017074138781241123 +368,2018-01-04,-0.032628279221650625 +369,2018-01-05,-0.03223607728071672 +370,2018-01-06,-0.017624165453121544 +371,2018-01-07,-0.02328223720569414 +372,2018-01-08,-0.005224806653890739 +373,2018-01-09,-0.017916956036140103 +374,2018-01-10,0.01007432914966365 +375,2018-01-11,-0.017790006643340045 +376,2018-01-12,-0.03921025412509331 +377,2018-01-13,-0.02877540017774155 +378,2018-01-14,-0.02728045412066091 +379,2018-01-15,-0.05109499050442365 +380,2018-01-16,-0.015777581174308886 +381,2018-01-17,-0.025057106910070428 +382,2018-01-18,-0.02635338047008018 +383,2018-01-19,-0.03434719611740827 +384,2018-01-20,-0.04267884443497172 +385,2018-01-21,-0.029383515070172957 +386,2018-01-22,-0.039297243091868404 +387,2018-01-23,-0.026043522255293928 +388,2018-01-24,-0.03983820315721032 +389,2018-01-25,-0.047519977507483 +390,2018-01-26,-0.024902154956879287 +391,2018-01-27,-0.023454792960014376 +392,2018-01-28,-0.018252220969709857 +393,2018-01-29,-0.025594578772451432 +394,2018-01-30,-0.004493582094186887 +395,2018-01-31,-0.03605666097405537 +396,2018-02-01,-0.009913184347211761 +397,2018-02-02,-0.041483814773362174 +398,2018-02-03,-0.03686793953069175 +399,2018-02-04,-0.03281027094814381 +400,2018-02-05,-0.060421703552874545 +401,2018-02-06,-0.0038300756003451994 +402,2018-02-07,-0.03652761271363664 +403,2018-02-08,-0.04585939202988577 +404,2018-02-09,-0.015517424150281104 +405,2018-02-10,-0.027215525956714302 +406,2018-02-11,-0.050236298937133925 +407,2018-02-12,-0.021694079575363075 +408,2018-02-13,-0.012770006353855516 +409,2018-02-14,-0.032703676272784116 +410,2018-02-15,-0.0035343725194611694 +411,2018-02-16,-0.0037759884400649785 +412,2018-02-17,-0.03734457103423945 +413,2018-02-18,-0.014017251686221196 +414,2018-02-19,-0.058467610956559335 +415,2018-02-20,-0.024461948447484266 +416,2018-02-21,-0.03839938196702698 +417,2018-02-22,-0.012530281926703843 +418,2018-02-23,-0.0401807478746151 +419,2018-02-24,-0.011660633807456928 +420,2018-02-25,-0.039136885327101786 +421,2018-02-26,-0.03353332741246613 +422,2018-02-27,-0.03845518372062693 +423,2018-02-28,-0.023831597527701885 +424,2018-03-01,-0.047750803823156704 +425,2018-03-02,-0.01746769163720053 +426,2018-03-03,-0.03728650550853164 +427,2018-03-04,0.006429171324858443 +428,2018-03-05,-0.030910917603470686 +429,2018-03-06,-0.038682397475133024 +430,2018-03-07,-0.02003116021063624 +431,2018-03-08,-0.03973457607626511 +432,2018-03-09,-0.018374284300226675 +433,2018-03-10,-0.03401828299487466 +434,2018-03-11,-0.019985568712470456 +435,2018-03-12,-0.02658454103002344 +436,2018-03-13,-0.019370688598601388 +437,2018-03-14,-0.03793242495512919 +438,2018-03-15,-0.03769892201384912 +439,2018-03-16,-0.006352870331862461 +440,2018-03-17,-0.0073374315057548566 +441,2018-03-18,-0.01437772011316637 +442,2018-03-19,-0.03691867201326528 +443,2018-03-20,-0.009327406008381459 +444,2018-03-21,-0.03351334401104711 +445,2018-03-22,-0.030903638755899365 +446,2018-03-23,-0.012959582991809809 +447,2018-03-24,-0.03062988823524108 +448,2018-03-25,-0.029674390885106063 +449,2018-03-26,-0.03405406220545282 +450,2018-03-27,-0.03933247567545844 +451,2018-03-28,-0.04004261392366189 +452,2018-03-29,-0.0349070235380501 +453,2018-03-30,-0.027448884864558362 +454,2018-03-31,-0.034417957514324554 +455,2018-04-01,-0.04766487477141941 +456,2018-04-02,-0.032346099895440975 +457,2018-04-03,-0.0336125582043143 +458,2018-04-04,-0.02931073238440109 +459,2018-04-05,-0.023708928790345682 +460,2018-04-06,-0.026205734560401747 +461,2018-04-07,-0.04315620710604139 +462,2018-04-08,-0.04329735621819915 +463,2018-04-09,-0.03838457882543348 +464,2018-04-10,-0.04239790054446252 +465,2018-04-11,-0.05507588166013647 +466,2018-04-12,-0.03837514303954398 +467,2018-04-13,-0.05290492127443981 +468,2018-04-14,-0.050484508425404 +469,2018-04-15,-0.050229645731608194 +470,2018-04-16,-0.04751646647456892 +471,2018-04-17,-0.04879645368572921 +472,2018-04-18,-0.04557138960579071 +473,2018-04-19,-0.03590445887625285 +474,2018-04-20,-0.019874655574602336 +475,2018-04-21,-0.05239815945049257 +476,2018-04-22,-0.016388627951814155 +477,2018-04-23,-0.02450690904938147 +478,2018-04-24,-0.02446610403573852 +479,2018-04-25,-0.036365181191108806 +480,2018-04-26,-0.029773300644427396 +481,2018-04-27,-0.024304585089404043 +482,2018-04-28,-0.023429877472425274 +483,2018-04-29,-0.0380340546939117 +484,2018-04-30,-0.021970277608785616 +485,2018-05-01,-0.01507750931003429 +486,2018-05-02,-0.01865570517453121 +487,2018-05-03,-0.02274891655915119 +488,2018-05-04,-0.04247486705698829 +489,2018-05-05,-0.033422301908484595 +490,2018-05-06,-0.03138031488508081 +491,2018-05-07,-0.0406167300195163 +492,2018-05-08,-0.03049303567562215 +493,2018-05-09,-0.03133284478005315 +494,2018-05-10,-0.03470679344758393 +495,2018-05-11,-0.03629807117285545 +496,2018-05-12,-0.03467199972955589 +497,2018-05-13,-0.03369322128574369 +498,2018-05-14,-0.03975145673942229 +499,2018-05-15,-0.0406712930884274 +500,2018-05-16,-0.03512612896491249 +501,2018-05-17,-0.05127491747624295 +502,2018-05-18,-0.06233415515174648 +503,2018-05-19,-0.03777679312392705 +504,2018-05-20,-0.05227208164085821 +505,2018-05-21,-0.00996765079727453 +506,2018-05-22,-0.023842642433267176 +507,2018-05-23,-0.016026812714443277 +508,2018-05-24,-0.023813096765664638 +509,2018-05-25,-0.03967421516827161 +510,2018-05-26,-0.027400300216637148 +511,2018-05-27,-0.027169400735990622 +512,2018-05-28,-0.0556914438107114 +513,2018-05-29,-0.023307378158636698 +514,2018-05-30,-0.048577345044542454 +515,2018-05-31,-0.05286245215549899 +516,2018-06-01,-0.024124186383440632 +517,2018-06-02,-0.04388931310378116 +518,2018-06-03,-0.04976619052630672 +519,2018-06-04,-0.01758683951378004 +520,2018-06-05,-0.06195254549733316 +521,2018-06-06,-0.04707066862992042 +522,2018-06-07,-0.01870525074726536 +523,2018-06-08,0.004452048502806685 +524,2018-06-09,-0.03471085652483774 +525,2018-06-10,-0.02202954856549614 +526,2018-06-11,-0.0507411439257083 +527,2018-06-12,-0.004714521692042881 +528,2018-06-13,-0.04458277077194884 +529,2018-06-14,-0.0778596760076502 +530,2018-06-15,-0.03386614035787071 +531,2018-06-16,-0.033258880613766875 +532,2018-06-17,-0.04704903115252481 +533,2018-06-18,-0.031313879099643706 +534,2018-06-19,-0.015373706157563533 +535,2018-06-20,-0.0551924001859735 +536,2018-06-21,-0.027344404408290595 +537,2018-06-22,-0.0495046598528833 +538,2018-06-23,-0.012335537507939792 +539,2018-06-24,-0.025954161295312344 +540,2018-06-25,-0.04209699141343621 +541,2018-06-26,-0.0301563937848114 +542,2018-06-27,-0.04002158624406885 +543,2018-06-28,-0.02434362143671898 +544,2018-06-29,-0.03432715704985431 +545,2018-06-30,-0.014222554886853561 +546,2018-07-01,0.0061996995432941834 +547,2018-07-02,-0.02848713424448259 +548,2018-07-03,-0.020427612889788595 +549,2018-07-04,-0.02774511309811814 +550,2018-07-05,-0.0408949295469994 +551,2018-07-06,-0.025938735555355998 +552,2018-07-07,-0.018419293912224896 +553,2018-07-08,-0.020259140323585174 +554,2018-07-09,-0.030500827055280604 +555,2018-07-10,-0.035057242547791016 +556,2018-07-11,-0.005175990088050836 +557,2018-07-12,-0.018580278390623997 +558,2018-07-13,-0.011667605246520732 +559,2018-07-14,-0.0421489657696755 +560,2018-07-15,-0.010981592637406532 +561,2018-07-16,-0.05416637563438151 +562,2018-07-17,-0.025078262915919462 +563,2018-07-18,-0.031761242341653215 +564,2018-07-19,-0.029734289883282562 +565,2018-07-20,-0.03828453353810538 +566,2018-07-21,-0.018117313405454395 +567,2018-07-22,-0.023964957354875277 +568,2018-07-23,-0.02907020519542465 +569,2018-07-24,-0.000972792486347962 +570,2018-07-25,-0.016285444389708702 +571,2018-07-26,-0.02912547806535071 +572,2018-07-27,-0.032006577049074295 +573,2018-07-28,-0.06159977881740006 +574,2018-07-29,-0.04136463979269492 +575,2018-07-30,-0.03893198452023232 +576,2018-07-31,-0.04383362641381256 +577,2018-08-01,-0.033261907764357425 +578,2018-08-02,-0.004275922585032222 +579,2018-08-03,-0.023835383654812192 +580,2018-08-04,-0.03502521796116585 +581,2018-08-05,-0.047747631756999837 +582,2018-08-06,-0.017146481941317702 +583,2018-08-07,-0.03483724705488604 +584,2018-08-08,-0.003290212318992493 +585,2018-08-09,-0.028932794382468686 +586,2018-08-10,-0.00975273417394185 +587,2018-08-11,-0.024126277483383158 +588,2018-08-12,-0.030039545920483097 +589,2018-08-13,-0.02924079163483159 +590,2018-08-14,-0.021786964021948775 +591,2018-08-15,-0.031612235655271506 +592,2018-08-16,-0.05475779360568379 +593,2018-08-17,-0.059556478220914866 +594,2018-08-18,-0.04208403581526042 +595,2018-08-19,-0.04362800011289834 +596,2018-08-20,-0.028255965120137175 +597,2018-08-21,-0.03339339752464041 +598,2018-08-22,-0.024076833203595868 +599,2018-08-23,-0.03485060543127936 +600,2018-08-24,-0.02311850613958285 +601,2018-08-25,-0.026513157460636184 +602,2018-08-26,-0.01506338451093742 +603,2018-08-27,-0.04516337794504513 +604,2018-08-28,-0.060211473220437045 +605,2018-08-29,-0.04104644112115921 +606,2018-08-30,-0.02084355957190019 +607,2018-08-31,-0.041684876741174284 +608,2018-09-01,-0.0390310806672791 +609,2018-09-02,-0.05121969820411461 +610,2018-09-03,-0.04653306402813091 +611,2018-09-04,-0.03486882767284753 +612,2018-09-05,-0.05819552408540567 +613,2018-09-06,-0.03429631632608417 +614,2018-09-07,-0.03179996424388994 +615,2018-09-08,-0.03508074881037115 +616,2018-09-09,-0.030273355701919143 +617,2018-09-10,-0.0421363966959372 +618,2018-09-11,-0.012993587878563823 +619,2018-09-12,-0.02037064398313909 +620,2018-09-13,-0.04415778447610369 +621,2018-09-14,-0.033311529164988724 +622,2018-09-15,-0.04199719131721848 +623,2018-09-16,-0.012827477927146697 +624,2018-09-17,-0.03356921660403347 +625,2018-09-18,-0.0496617144153228 +626,2018-09-19,-0.01882535110048635 +627,2018-09-20,-0.022220752114851243 +628,2018-09-21,-0.03431429552003158 +629,2018-09-22,-0.03899388643233565 +630,2018-09-23,-0.037280898556533534 +631,2018-09-24,-0.031802020023181346 +632,2018-09-25,-0.046626969443852875 +633,2018-09-26,-0.003536509356014881 +634,2018-09-27,-0.031596469165866156 +635,2018-09-28,0.0027162569289253674 +636,2018-09-29,-0.037009255636363404 +637,2018-09-30,-0.033240323696376084 +638,2018-10-01,-0.034389897894410895 +639,2018-10-02,-0.016243078697237998 +640,2018-10-03,-0.014722452879594419 +641,2018-10-04,-0.024851295379141315 +642,2018-10-05,-0.012385838426411003 +643,2018-10-06,-0.011952136220052312 +644,2018-10-07,-0.014197906076210241 +645,2018-10-08,-0.035311756329051126 +646,2018-10-09,-0.046092367449446905 +647,2018-10-10,-0.05320309923438005 +648,2018-10-11,-0.050558895229159066 +649,2018-10-12,-0.03328507259730327 +650,2018-10-13,-0.04775234937209409 +651,2018-10-14,-0.029914313520091437 +652,2018-10-15,-0.005867497163572922 +653,2018-10-16,-0.030584466020180206 +654,2018-10-17,-0.05659479036954841 +655,2018-10-18,-0.015591646248165527 +656,2018-10-19,-0.03155213252068082 +657,2018-10-20,-0.035642447242213736 +658,2018-10-21,-0.03219338800759934 +659,2018-10-22,-0.04798556598002085 +660,2018-10-23,-0.027803796813316566 +661,2018-10-24,-0.01674061865401959 +662,2018-10-25,-0.043407889116562175 +663,2018-10-26,-0.019463734797964472 +664,2018-10-27,-0.01885145391159196 +665,2018-10-28,-0.03649119270016231 +666,2018-10-29,-0.012805362790509716 +667,2018-10-30,-0.04530088974223362 +668,2018-10-31,-0.02130093947891459 +669,2018-11-01,-0.030026854340136067 +670,2018-11-02,-0.029087697808231013 +671,2018-11-03,-0.0219985743149668 +672,2018-11-04,-0.024597212715978187 +673,2018-11-05,-0.057218483932663045 +674,2018-11-06,-0.04721034457120841 +675,2018-11-07,-0.043943050586371726 +676,2018-11-08,-0.031251487903337774 +677,2018-11-09,-0.015986741589419137 +678,2018-11-10,-0.011781823718700062 +679,2018-11-11,-0.017564592148946435 +680,2018-11-12,-0.024990225149219236 +681,2018-11-13,-0.042147862585365056 +682,2018-11-14,-0.009850216638547783 +683,2018-11-15,-0.026059297537239023 +684,2018-11-16,-0.046296439801357704 +685,2018-11-17,-0.0371031839466648 +686,2018-11-18,-0.009610897265588034 +687,2018-11-19,-0.006451065883802842 +688,2018-11-20,-0.04207600330990288 +689,2018-11-21,0.00350545066199303 +690,2018-11-22,-0.01451723782333837 +691,2018-11-23,-0.01974808633145565 +692,2018-11-24,-0.045890322123681486 +693,2018-11-25,0.003853550498139395 +694,2018-11-26,-0.029302066037451214 +695,2018-11-27,-0.0398579424047797 +696,2018-11-28,-0.03516561103451577 +697,2018-11-29,-0.030309815274697324 +698,2018-11-30,-0.04367065043076625 +699,2018-12-01,-0.019682236044429063 +700,2018-12-02,-0.030727709251151713 +701,2018-12-03,-0.05503191515714291 +702,2018-12-04,-0.04223169241571658 +703,2018-12-05,-0.0462226555874372 +704,2018-12-06,-0.041396716050090696 +705,2018-12-07,-0.03760201729721206 +706,2018-12-08,-0.02662297467395146 +707,2018-12-09,-0.03393219730934768 +708,2018-12-10,-0.032393637252551295 +709,2018-12-11,-0.04090600439805066 +710,2018-12-12,-0.019442034763003484 +711,2018-12-13,-0.03397826857187504 +712,2018-12-14,-4.956876632667903e-05 +713,2018-12-15,-0.04338167650262613 +714,2018-12-16,-0.030568592135102032 +715,2018-12-17,-0.010425683226771582 +716,2018-12-18,-0.047097458148560076 +717,2018-12-19,-0.04414654454940857 +718,2018-12-20,-0.046593473344401816 +719,2018-12-21,-0.031782856203344416 +720,2018-12-22,-0.0342074351943954 +721,2018-12-23,-0.02658440300236589 +722,2018-12-24,-0.012993104319962097 +723,2018-12-25,-0.04708673533113822 +724,2018-12-26,-0.03549789599330147 +725,2018-12-27,-0.023702261622615142 +726,2018-12-28,-0.06734038637870611 +727,2018-12-29,-0.03754363604064338 +728,2018-12-30,-0.03645739772701104 +729,2018-12-31,-0.03867337057136081 diff --git a/content/GA_1_4/data/groundwater_levels.csv b/content/GA_1_4/data/groundwater_levels.csv new file mode 100644 index 00000000..4e223bae --- /dev/null +++ b/content/GA_1_4/data/groundwater_levels.csv @@ -0,0 +1,26 @@ +,times,observations[mm] +0,2017-01-01,-109.698 +1,2017-02-01,-102.044 +2,2017-03-01,-127.198 +3,2017-04-01,-151.899 +4,2017-05-01,-149.629 +5,2017-06-01,-132.828 +6,2017-07-01,-122.058 +7,2017-08-01,-142.505 +8,2017-09-01,-122.97 +9,2017-10-01,-123.722 +10,2017-11-01,-111.894 +11,2017-12-01,-118.856 +12,2018-01-01,-109.28 +13,2018-02-01,-114.459 +14,2018-03-01,-115.165 +15,2018-04-01,-139.411 +16,2018-05-01,-156.938 +17,2018-06-01,-166.784 +18,2018-07-01,-142.645 +19,2018-08-01,-133.115 +20,2018-09-01,-139.957 +21,2018-10-01,-112.534 +22,2018-11-01,-107.121 +23,2018-12-01,-122.64 +24,2019-01-01,-117.268 diff --git a/content/GA_1_4/data/insar_observations.csv b/content/GA_1_4/data/insar_observations.csv new file mode 100644 index 00000000..9cd9ed12 --- /dev/null +++ b/content/GA_1_4/data/insar_observations.csv @@ -0,0 +1,62 @@ +,times,observations[m] +0,2017-01-01,-0.0037915269917409627 +1,2017-01-13,-0.005998562574055986 +2,2017-01-25,-0.011402835952374462 +3,2017-02-06,-0.009919855648270475 +4,2017-02-18,-0.011282623963035473 +5,2017-03-02,-0.016512756482362813 +6,2017-03-14,-0.016996845493251048 +7,2017-03-26,-0.019696104362885405 +8,2017-04-07,-0.021837098696008004 +9,2017-04-19,-0.022895436362601166 +10,2017-05-01,-0.022327056485246743 +11,2017-05-13,-0.020821197338077402 +12,2017-05-25,-0.024863340904648194 +13,2017-06-06,-0.02056783048161778 +14,2017-06-18,-0.02213817613870604 +15,2017-06-30,-0.02163775448792241 +16,2017-07-12,-0.02560414369326818 +17,2017-07-24,-0.02473621201120934 +18,2017-08-05,-0.023681466237484187 +19,2017-08-17,-0.0282966692824492 +20,2017-08-29,-0.029358013071156923 +21,2017-09-10,-0.02852166622379215 +22,2017-09-22,-0.024896329017228425 +23,2017-10-04,-0.021029517374774372 +24,2017-10-16,-0.023354103774718086 +25,2017-10-28,-0.021855914891603143 +26,2017-11-09,-0.024765897955232773 +27,2017-11-21,-0.022823151059776652 +28,2017-12-03,-0.026800418671976987 +29,2017-12-15,-0.02509500935712605 +30,2017-12-27,-0.026505283952593273 +31,2018-01-08,-0.02670526176685112 +32,2018-01-20,-0.025821579299208672 +33,2018-02-01,-0.027508046803947844 +34,2018-02-13,-0.024288527653980718 +35,2018-02-25,-0.02670351434206529 +36,2018-03-09,-0.026471702793063708 +37,2018-03-21,-0.029256128085217777 +38,2018-04-02,-0.027596164768845584 +39,2018-04-14,-0.032995994476835454 +40,2018-04-26,-0.031334671938387675 +41,2018-05-08,-0.03447316193762846 +42,2018-05-20,-0.03646288082564127 +43,2018-06-01,-0.03622067189983248 +44,2018-06-13,-0.0373391550961804 +45,2018-06-25,-0.03482925880558608 +46,2018-07-07,-0.03375116486465379 +47,2018-07-19,-0.03153714180290244 +48,2018-07-31,-0.03053964391509817 +49,2018-08-12,-0.03146927023464485 +50,2018-08-24,-0.03159840378773475 +51,2018-09-05,-0.03141629804036172 +52,2018-09-17,-0.032855680003182834 +53,2018-09-29,-0.02881159629275797 +54,2018-10-11,-0.026992604435845863 +55,2018-10-23,-0.02767485725544704 +56,2018-11-04,-0.023014576182087923 +57,2018-11-16,-0.02589125901511123 +58,2018-11-28,-0.028883565745858694 +59,2018-12-10,-0.030314178558457035 +60,2018-12-22,-0.03027546561762635 diff --git a/content/GA_1_4/functions.py b/content/GA_1_4/functions.py new file mode 100644 index 00000000..e33bc32b --- /dev/null +++ b/content/GA_1_4/functions.py @@ -0,0 +1,149 @@ + +import numpy as np +import matplotlib.pyplot as plt +from scipy.stats import norm +import ipywidgets as widgets +from ipywidgets import interact + +def plot_model(d, alt_model=None): + """Time Series of observations with model and CI. + + Uses dict as input defined from existing values in dict + Outputs figure and axes objects. + + alt_model: tuple to add a line to the plot, 3 elements: + - string: array with the times + - list or ndarray with times (x-axis) + - list or ndarray with model values (y-axis) + - e.g., alt_model=('model 2', [...], [...]) + """ + + times = d['times'] + y = d['y'] + y_hat = d['y_hat'] + CI_Y_hat = d['CI_Y_hat'] + data_type = d['data_type'] + + fig, ax = plt.subplots(figsize = (15,5)) + + ax.plot(times, y, 'k+', label = 'Observations') + ax.plot(times, y_hat, label = 'Fitted model') + ax.fill_between(times, + (y_hat - CI_Y_hat), + (y_hat + CI_Y_hat), + facecolor='orange', + alpha=0.4, + label = f'{(1-d['alpha'])*100:.1f}%' + ' Confidence Region') + + if alt_model is not None: + ax.plot(alt_model[1], + alt_model[2], + label = alt_model[0]) + + ax.legend() + ax.set(xlabel='Time', + ylabel=f'{data_type}' + ' Displacement [mm]', + title=f'{data_type}' + ' Observations and Fitted Model') + + + return fig, ax + + +def plot_residual(d): + """Time Series of residuals and CI. + + Uses dict as input defined from existing values in dict + Outputs figure and axes objects. + """ + + times = d['times'] + e_hat = d['e_hat'] + CI_res = d['CI_res'] + data_type = d['data_type'] + + fig, ax = plt.subplots(figsize = (15,5)) + + ax.plot(times, e_hat, 'o', markeredgecolor='black', label='Residual') + ax.plot(times, -CI_res, + '--', color='orange', + label = f'{(1-d['alpha'])*100:.1f}%' + ' Confidence Region') + ax.plot(times, +CI_res, + '--', color='orange') + + ax.legend() + ax.set(xlabel='Time', + ylabel=f'{data_type}' + ' residual [mm]', + title=f'{data_type}' + ' Residuals') + + return fig, ax + + +def plot_residual_histogram(d): + """Histogram of residuals with Normal PDF. + + Uses dict as input defined from existing values in dict + Outputs figure and axes objects. + """ + + e_hat = d['e_hat'] + data_type = d['data_type'] + + fig, ax = plt.subplots(figsize = (7,5)) + + ax.hist(e_hat, density=True, edgecolor='black') + x = np.linspace(np.min(e_hat), np.max(e_hat), num=100); + ax.plot(x, + norm.pdf(x, loc=0.0, scale = np.std(e_hat)), + linewidth=4.0) + + ax.set(xlabel='Residuals [mm]', + ylabel=f'{data_type}' + ' Density [-]', + title=f'{data_type}' + ' Residuals Histogram') + + print ('The mean value of the', data_type, 'residuals is', + np.around(np.mean(e_hat),5), 'mm') + print ('The standard deviation of the', data_type, 'residuals is', + np.around(np.std(e_hat),3), 'mm') + + + return fig, ax + +def xhat_slider_plot(A, y, t, Sigma_y=None): + """Interactive plot of the solution space for x_hat.""" + n, k = A.shape + + if Sigma_y is None: + Sigma_y = np.eye(n) + xhat = np.linalg.inv(A.T @ np.linalg.inv(Sigma_y) @ A) @ A.T @ np.linalg.inv(Sigma_y) @ y + Sigma_xhat = np.linalg.inv(A.T @ np.linalg.inv(Sigma_y) @ A) + std_xhat = np.sqrt(np.diag(Sigma_xhat)) + + sliders = {} + for i in range(k): + sliders[f'xhat_{i}'] = widgets.FloatSlider(value=xhat[i], + min=xhat[i] - 10*std_xhat[i], + max=xhat[i] + 10*std_xhat[i], + step=0.1*std_xhat[i], + description=f'xhat_{i}') + + def update_plot(**kwargs): + xhat_values = np.array([kwargs[f'xhat_{i}'] for i in range(k)]) + y_fit = A @ xhat_values + W = np.linalg.inv(Sigma_y) + ss_res = (y - y_fit).T @ W @ (y - y_fit) + + plt.figure(figsize=(10, 5)) + plt.plot(t, y, 'o', label='data') + plt.plot(t, y_fit, label='y_fit') + plt.title(f'Mean of squared residuals: {ss_res:.2f}') + plt.ylabel('y') + plt.xlabel('t') + plt.grid() + plt.legend() + plt.show() + + interact(update_plot, **sliders) + +# Example usage +# A, y, t should be defined before calling this function +# xhat_slider_plot(A, y, t) \ No newline at end of file -- GitLab