Commit af46a06f authored by Harmel Tristan's avatar Harmel Tristan
Browse files

inclusion of iwr process in main, fix for first guess x0 in iwr.process

parent 9c5a17f4
...@@ -75,10 +75,26 @@ Usage: ...@@ -75,10 +75,26 @@ Usage:
## Running the tests ## Running the tests
- For `awr` data:
``` ```
trios_processing ./test/data/ 150 awr --lat 42.30351823 --lon 9.462897398 --odir ./test/results --no_clobber trios_processing ./test/data/ 150 awr --lat 42.30351823 --lon 9.462897398 --odir ./test/results --no_clobber
trios_processing ./test/data/ 150 awr --lat 42.30351823 --lon 9.462897398 --odir ./test/results --method M99 --name _M99 --plot --figdir ./test/fig trios_processing ./test/data/ 150 awr --lat 42.30351823 --lon 9.462897398 --odir ./test/results --method M99 --name _M99 --plot --figdir ./test/fig
trios_processing ./test/data/ 150 awr --lat 42.30351823 --lon 9.462897398 --odir ./test/results --method osoaa --name _osoaa --plot trios_processing ./test/data/ 150 awr --lat 42.30351823 --lon 9.462897398 --odir ./test/results --method osoaa --name _osoaa --plot --figdir ./test/fig
trios_processing ./test/data/ 150 awr --lat 42.30351823 --lon 9.462897398 --odir ./test/results --method osoaa --ws 5 --aot=0.2 --name _osoaaws5_aot0.1 --plot --figdir ./test/fig
trios_processing ./test/data/ 150 awr --lat 42.30351823 --lon 9.462897398 --odir ./test/results --method temp_opt --name _optimization --plot --figdir ./test/fig
```
- For `iwr` data:
```
trios_processing ./test/data/ 150 iwr --lat 42.30351823 --lon 9.462897398 --odir ./test/results --no_clobber --plot --figdir ./test/fig
```
- For `swr` data:
```
trios_processing ./test/data/ 150 swr --lat 42.30351823 --lon 9.462897398 --odir ./test/results --no_clobber --plot --figdir ./test/fig
``` ```
......
wl,count,mean,std,min,25%,50%,75%,max
320,44.0,0.0017045888583330365,0.0006990263123009018,-0.0008121938469997822,0.0015077750322556943,0.001854080459176192,0.0021534483265304807,0.0025318446423163534
323,44.0,0.001484538312195173,0.000668993020449514,-0.0009019002566028747,0.001301607715091286,0.0016310588699996757,0.0019018572543714988,0.0022816838554528215
326,44.0,0.0013106867132257156,0.0006253800351103312,-0.0009314136264035575,0.0011288058354750339,0.001445550626171981,0.001710867042277216,0.0020601141102374074
329,44.0,0.0012577988896700439,0.00060670933509971,-0.0009160878850122753,0.0010658188311891462,0.0013882870962630993,0.0016512127572639338,0.0020133402929331835
332,44.0,0.0011966136465893988,0.00058559167579526,-0.000901207772185629,0.001021677150545358,0.0013199291538661196,0.0015656217038824117,0.001937872936820053
335,44.0,0.0011943358692543676,0.000574137304216373,-0.0008543207199326003,0.001018184832607407,0.001314428541312719,0.0015510171339341095,0.0019334731814512826
338,44.0,0.0011723059850172301,0.0005571893321655491,-0.0008154232891432319,0.0010005215734512414,0.0012848408263054075,0.0015179645812303576,0.001903559759760481
341,44.0,0.0011855176227922723,0.0005430040698623547,-0.0007544053760663204,0.0010142158358185838,0.0012878086027029282,0.001521572276257343,0.0019138118185927713
344,44.0,0.0011863732707998115,0.0005352675679258446,-0.0007238251789813174,0.001015078754301809,0.00128485771450426,0.0015154571766724328,0.0019266929389963189
347,44.0,0.001217853707664041,0.0005286229263015372,-0.0006649366903950049,0.0010501992201942777,0.001317089095470195,0.001539058716113888,0.0019702899646835996
350,44.0,0.0012446149372522418,0.0005196553475757753,-0.0006044478062869842,0.0010819663035757528,0.0013421136106266127,0.001560009524146397,0.002002110463460143
353,44.0,0.0012666791126036624,0.0005081708046099807,-0.0005438670768002092,0.001103242728342981,0.001357905507475264,0.0015720774506387191,0.0020298714947560963
356,44.0,0.0012528234334730976,0.0004967587539673674,-0.0005178047666065995,0.0010932011184577074,0.0013432538695433557,0.0015517800803424681,0.002017476957325837
359,44.0,0.001268477864540537,0.0004900836231032628,-0.00047840717451034777,0.0011107364901127756,0.0013591481674613058,0.0015602726785740686,0.0020494118611883395
362,44.0,0.001316807898057588,0.00048231082018530174,-0.00040043905445295787,0.0011637493560227902,0.0014039453498552235,0.0016005328381720747,0.0021098899883694577
365,44.0,0.0013304552754553579,0.0004700724376449865,-0.0003446837956441228,0.001177230768918815,0.0014130486761588304,0.001604660009409465,0.0021255187419872068
368,44.0,0.0013253899300784704,0.0004595742591537751,-0.00031138485576970716,0.0011757590337810057,0.0014065075196241289,0.0015917349634206853,0.002127156862768945
371,44.0,0.0013402220936191039,0.0004494279100834804,-0.00025833219115468155,0.0011956258797839933,0.0014211928562476838,0.0015980779059432738,0.0021397870931413295
374,44.0,0.0013190968056138671,0.0004346687122674797,-0.00022512215851515255,0.0011802243241261674,0.001398309894375691,0.0015631112783977643,0.0021111115393460476
377,44.0,0.001316665102166427,0.0004233971397014517,-0.00018688959527660216,0.0011809370119042332,0.0013926407040876368,0.0015532937406698825,0.002109829538771121
380,44.0,0.0013480321529044251,0.0004133594613558541,-0.0001195538669171243,0.00121379657456592,0.001420057304076336,0.0015805277856674343,0.0021391113481563995
383,44.0,0.001310429633292453,0.00039738077248678013,-9.752447555600717e-05,0.0011823593759149225,0.0013811607102119788,0.0015354223370695164,0.0020866707215146966
386,44.0,0.001301288561460712,0.00038588177804194345,-6.521078334057839e-05,0.001181833621569405,0.0013720886716268271,0.001514212571182024,0.0020717380340362712
389,44.0,0.0013295489064511256,0.0003755915340366181,-2.3369976982200072e-06,0.001213288103123453,0.0013977446885853509,0.0015400654158537318,0.0020933176459349816
392,44.0,0.0013373671511280167,0.000367936462794912,3.344364885400361e-05,0.0012257611456344918,0.0014041204478735824,0.0015443511134594968,0.0021015634130576075
395,44.0,0.0014040254786266857,0.0003633820260217025,0.00011624038721834235,0.0012963207923341424,0.001470284127397733,0.0016071618722860845,0.002170044316840186
398,44.0,0.001400713450287796,0.0003509498520686195,0.00015929689354446112,0.0012966255817759046,0.0014638468331695895,0.0015963353810932298,0.0021581758755665555
401,44.0,0.0013781577415653075,0.0003418193315604411,0.00017042405532340023,0.0012762409612650184,0.0014391059217671834,0.001568533289945201,0.0021310331563490644
404,44.0,0.0014075745188456992,0.0003354273272969653,0.0002225560853049736,0.0013090195268511918,0.001467047899788292,0.0015929170594694093,0.002157813165709652
407,44.0,0.0014292032651954932,0.0003277133905230532,0.0002725320066831706,0.0013349636698802016,0.001487791138921633,0.0016074433822348723,0.002174242195780106
410,44.0,0.0014525182977009584,0.0003211448304281169,0.000321102878226256,0.0013621118577529737,0.0015110921557352822,0.0016241714752244243,0.0021948926038468765
413,44.0,0.0014845443213152983,0.00031452936396004767,0.0003765981541520698,0.0013980846244655318,0.0015419446555275187,0.0016502170665554394,0.002225184743920688
416,44.0,0.0015179136389989458,0.00030842022955823245,0.0004329982218881784,0.001434176182254864,0.0015730057352697563,0.0016784220832246235,0.002258145831568407
419,44.0,0.0015475851227644195,0.00030200027491710576,0.0004868962210965412,0.0014670492214387057,0.0016015385173958696,0.0017039821024423117,0.002285634421601274
422,44.0,0.0015778937990944231,0.00029541771083840406,0.0005420048256960171,0.0015006207837669114,0.0016302776350683153,0.0017284318059954374,0.002312823889956676
425,44.0,0.0016102188411651758,0.00028959920284543313,0.0005962518973240758,0.0015370133746274138,0.0016604814810652717,0.0017546794326437232,0.002340700645400289
428,44.0,0.0016687319686471641,0.00028505073523108187,0.0006714724671662331,0.0015991169671019192,0.001716148052326723,0.0018091072322224567,0.002400222309144859
431,44.0,0.0017170253880008624,0.00028014364171269546,0.0007390496884328498,0.001651205862907782,0.0017629357026482516,0.0018529817764920823,0.002450699745534235
434,44.0,0.0017644965874409493,0.0002758504284970984,0.0008040324231487895,0.0017018072839515706,0.001809107128498794,0.001896308261226897,0.0025004422081611145
437,44.0,0.0018176279370638044,0.00027191208793737995,0.0008731641265121076,0.0017574413946941628,0.0018609749135802827,0.001946178263279474,0.002555109849000765
440,44.0,0.0018630058176522712,0.00026704895810701574,0.0009378154258800417,0.0018056586153547074,0.0019047833392751615,0.0019873422874362593,0.0026001562286405194
443,44.0,0.0019167829471815297,0.00026268072283931526,0.0010080862150274915,0.0018627796728727165,0.001956997161976136,0.0020372636025167506,0.002652924067459363
446,44.0,0.0019754720082143166,0.00025941221289238405,0.0010807833746532538,0.0019233758090820951,0.0020144786619575904,0.0020918225941558653,0.0027146202660026882
449,44.0,0.002023260723006048,0.0002551865188422333,0.0011453035380285916,0.0019696847140745124,0.002061204459650527,0.0021359736828159563,0.002759561963504992
452,44.0,0.002072537541755136,0.000251324053412573,0.001209399625189002,0.0020173208596630187,0.002109325991551809,0.002182155040847496,0.0028080438110503546
455,44.0,0.00212774912438754,0.0002481948363989657,0.0012772508858587572,0.0020751559857201045,0.00216372602159749,0.0022350674447761563,0.0028628147446511727
458,44.0,0.002175263878603074,0.0002448569446316031,0.0013386473696268785,0.0021257166563623843,0.002210065604437432,0.0022799177568668737,0.0029092342917106414
461,44.0,0.002224914112076813,0.0002417896805209526,0.001401065456982743,0.00217840214141864,0.0022571387613091855,0.002326611150974159,0.002958678595584534
464,44.0,0.0022737744029769007,0.00023872567291862047,0.0014626796366409784,0.0022303366696152078,0.0023037243932346615,0.0023733017766413345,0.003005642658183727
467,44.0,0.002319009181340276,0.00023553438446706002,0.0015208156365987546,0.0022781330232600184,0.0023467906954018286,0.0024164608469619134,0.0030480692569505585
470,44.0,0.002362842159477246,0.00023264328037923804,0.0015765536561622889,0.0023235819496240898,0.002390237262819184,0.0024566467806216583,0.003091489777880642
473,44.0,0.0024137386812931104,0.00023025928562259146,0.0016388193763723783,0.002376181928782673,0.002439987414301537,0.0025066100626397014,0.003141255229985898
476,44.0,0.002461840128913673,0.00022780094105264196,0.0016961852445929455,0.0024238558923491307,0.002486713271595018,0.002552911897291599,0.003187217604322131
479,44.0,0.0025034885953477875,0.00022531247735264464,0.0017483218506797618,0.0024676983829207302,0.002527711937077891,0.0025941461517379255,0.0032272826214184893
482,44.0,0.002546542555361867,0.0002228803108617943,0.001801565208215394,0.0025129666689255436,0.0025697031468415207,0.002637380114616783,0.0032658039150388436
485,44.0,0.0025955507072829777,0.00022112046510559927,0.0018583959455546807,0.002563251347262011,0.0026174913986544476,0.002685156990123233,0.003312677142060102
488,44.0,0.002639652476576954,0.00021913198946664576,0.0019113564169963198,0.002608039852640131,0.0026600320141625796,0.0027286310757457665,0.003354926145039659
491,44.0,0.0026816330933557304,0.00021706146321016258,0.001962571810025755,0.002651179897406792,0.0027006614634208902,0.002769715019974024,0.0033958293978552517
494,44.0,0.002732482697179484,0.00021573140290507466,0.0020205115888840713,0.0027031601476490944,0.0027506134243362366,0.0028189010950616868,0.0034470446690358474
497,44.0,0.002783022738020396,0.00021417009370529587,0.0020783801743788836,0.0027541573791928804,0.002799905191304666,0.0028669093395405935,0.003495305530978454
500,44.0,0.0028310853944191238,0.0002120728155830891,0.002134632901949963,0.0028028413399183256,0.002845197717656664,0.002911421689380579,0.0035404173529482766
503,44.0,0.0028795187031958503,0.00020985054297829766,0.0021953390036291666,0.0028504423390016504,0.0028925094881751363,0.002956709258212326,0.0035875783079230422
506,44.0,0.002923874112505853,0.00020808507460665405,0.0022484331304856555,0.0028937826628752062,0.0029358450941002487,0.002998808763530871,0.0036338379509171055
509,44.0,0.0029533740541463943,0.0002056393306598843,0.0022888109775309616,0.0029243605707001564,0.0029647888250466975,0.003026555349650314,0.003661253333877917
512,44.0,0.0029877755360118844,0.00020308097765677415,0.0023342090969534915,0.0029595101971058,0.0029981455368474036,0.003060723716493805,0.0036919455836997685
515,44.0,0.0030395771184124937,0.00020105680281400998,0.002395048299199766,0.0030127548879494773,0.0030485615925888773,0.0031108863161883092,0.0037406200685457876
518,44.0,0.003102781922368995,0.00019928743653245236,0.002468921641634033,0.003077637229024692,0.003111243971759923,0.0031730677126056545,0.003803483212494405
521,44.0,0.0031737162353934548,0.0001976405050878046,0.0025500528128822838,0.003149273238373204,0.003183045397737475,0.0032439316808919186,0.0038745220846177196
524,44.0,0.0032466542569705866,0.00019615301027231297,0.002631889348045692,0.0032219282699215753,0.003256955457108667,0.003316350488155029,0.003947444902640549
527,44.0,0.003311650325676917,0.00019441454870633467,0.002706864040744474,0.0032866552563918707,0.0033224523278896564,0.003380487910381352,0.004010722404202711
530,44.0,0.003369546121584137,0.00019261832625210653,0.0027734018244872692,0.003342083222534855,0.003378294766565048,0.0034373419397273532,0.004065953784226896
533,44.0,0.0034235455144892295,0.00019115422871771474,0.002836748072278061,0.0033942814612415925,0.003430910590451605,0.003489848148162694,0.004121944921524352
536,44.0,0.0034613793404979355,0.00018917560940914593,0.002883866773048298,0.003431285459826349,0.0034681013822738705,0.0035259706599452267,0.004155443495451851
539,44.0,0.003494589826899412,0.00018709923472127131,0.0029277459546215123,0.00346346391558559,0.0035018543757539206,0.0035596129995199882,0.004185367384777048
542,44.0,0.003518554410509522,0.0001852171176561095,0.0029621593155924634,0.0034870383183922275,0.003526517802136195,0.003581789073010006,0.00420957235902882
545,44.0,0.003529253052033818,0.0001829535723759858,0.0029846124350462887,0.003497951404741234,0.0035379386012659923,0.0035896090907014643,0.0042189308570404925
548,44.0,0.0035333656780451774,0.0001805685200439247,0.0030012556415917654,0.0035049325940584917,0.003540295874107124,0.0035924457790229443,0.004221651319175079
551,44.0,0.003534046066252688,0.00017806421993235054,0.0030140698977898102,0.0035052017012969826,0.0035387469624218026,0.0035903309878819872,0.004219650501882791
554,44.0,0.003537295456166342,0.00017559030726896734,0.0030291862082453625,0.0035063211601058953,0.0035422832848870513,0.003590979615459693,0.0042199904574319646
557,44.0,0.003540623024824359,0.00017331995981107422,0.0030449301927925614,0.003508963377950519,0.003546600781923671,0.0035936263959283066,0.0042210404662624
560,44.0,0.0035389786893396825,0.0001709408685730403,0.0030559389676240666,0.003506126016270856,0.003545315366509887,0.0035903284558935723,0.004213866977185884
563,44.0,0.0035314370000755447,0.00016851994002296534,0.003060880538379931,0.0034965966147877266,0.003535963812177571,0.0035813552358447518,0.004204015733349126
566,44.0,0.0035063095697635744,0.0001665725646176742,0.003047910107644211,0.00346965453464789,0.003508870202092883,0.0035537341194225125,0.0041787046868811085
569,44.0,0.0034652779585546693,0.0001650455355624237,0.0030160781319884815,0.003426665466053249,0.0034692521972143463,0.0035116103530167435,0.004134367222570566
572,44.0,0.003399891867236188,0.00016374959964221992,0.0029610383160776662,0.0033588288195438216,0.0034036006691325503,0.0034454113190636832,0.004069963565959236
575,44.0,0.0033012521676990263,0.00016252784175200508,0.002872839790232421,0.003259998913223424,0.003304123062992095,0.003344796439441654,0.003969848721147701
578,44.0,0.003168323140676099,0.0001614984976063097,0.0027509837355052533,0.003125972497703652,0.0031701224853885944,0.003208285072055975,0.0038367073981214763
581,44.0,0.003005041755366772,0.0001609823094134718,0.0025956331740888327,0.0029612799259855715,0.0030065452604879197,0.0030423471045608634,0.003675343485997385
584,44.0,0.0028228633746360606,0.00016030140858215195,0.002422502109284727,0.0027793381400722907,0.002823323031564677,0.0028580366542758926,0.00349218689189794
587,44.0,0.00261366031380074,0.0001582069539359802,0.0022250879175596525,0.002570068271159223,0.0026144396878582865,0.0026463902737965317,0.003274230084576478
590,44.0,0.002382427618317343,0.0001559382586743497,0.0020064322456499833,0.002338242167511616,0.0023825273994504586,0.0024149565071617564,0.003033511564863388
593,44.0,0.002157201126707801,0.0001554535828580859,0.00178938732683972,0.0021118983074998677,0.0021553193909831965,0.0021893709411348696,0.002803779004821024
596,44.0,0.001935580123229469,0.00015569424893597308,0.0015723565332844624,0.0018911335097354953,0.0019293154618546158,0.0019644184816579903,0.0025785873913016385
599,44.0,0.001732259025846119,0.0001563819151063645,0.001368819845079855,0.0016892351099850535,0.0017240203972672657,0.0017597129618002396,0.00236786667392833
602,44.0,0.001566615404128753,0.00015733023735841405,0.0012040355450905317,0.0015237619806821386,0.0015587168139467177,0.0015938784188050813,0.002197284522270039
605,44.0,0.0014495147563136765,0.0001582128067762403,0.0010874553382118166,0.0014074547581331455,0.0014423148810258123,0.0014762960148497026,0.0020751061567256994
608,44.0,0.0013756686857565926,0.0001590333375081924,0.0010143061012753106,0.0013346331895944595,0.00136844185863365,0.0014016916484486943,0.0019946909401995215
611,44.0,0.0013294306416993793,0.00015973418502681806,0.0009687888416577084,0.0012892335849418034,0.0013221559602239093,0.001354620379879609,0.0019500775276611725
614,44.0,0.0012949572478642838,0.00016041254169247467,0.0009363801152598266,0.0012549033615722586,0.0012876302972905562,0.0013196570329221376,0.001930083472586279
617,44.0,0.0012672425770349502,0.00016182579111951716,0.0009108311716380992,0.0012262868293966332,0.001259511220436103,0.0012915766915753113,0.0019189908526167138
620,44.0,0.0012465224079290461,0.00016409858187222247,0.0008896411614707777,0.0012050224434454124,0.0012386082994062333,0.0012697192368424893,0.00191530656689217
623,44.0,0.0012214967797792842,0.0001658761783042669,0.0008673052558960825,0.0011793432702869324,0.0012117866251464056,0.0012437519690675527,0.0019046639837669898
626,44.0,0.0011950407190695314,0.00016736312177380503,0.0008424155242587376,0.0011519059107643606,0.0011838315223406724,0.001215592699928084,0.0018921022723398964
629,44.0,0.001169422129746921,0.00016872854638886163,0.000820839038665509,0.0011264603192504175,0.0011578168416824005,0.0011886818661616364,0.0018806595060893512
632,44.0,0.0011457797463491808,0.0001702303475020083,0.0008010560472170011,0.0011029727543550953,0.001134875314771989,0.0011644719525433806,0.0018733674780066821
635,44.0,0.0011214797752188324,0.00017201497653998352,0.0007787190948201134,0.0010792592105045833,0.001109801680079294,0.0011404479882586628,0.0018660772143259867
638,44.0,0.0010986624923814954,0.00017399395576831684,0.0007560557717284441,0.0010553109906331424,0.0010862312269686323,0.0011179958815149655,0.0018609801095448384
641,44.0,0.0010754857086594538,0.0001758872310599736,0.0007325790602996745,0.0010302106640728502,0.001062616209926101,0.0010941837539730315,0.0018568504195439718
644,44.0,0.0010473510445347088,0.0001772425888660094,0.0007058694980743455,0.0010022779237866502,0.0010334500787091416,0.0010662831237728742,0.0018455312717161525
647,44.0,0.0010154801057200554,0.00017873295632787325,0.0006766658044763742,0.0009719227341282497,0.0010016608690839026,0.0010331021912442333,0.0018343283926468244
650,44.0,0.0009782652221960277,0.0001798919110060141,0.0006391106695945959,0.0009344778355394247,0.0009626579822607384,0.0009940335118976554,0.0018154818272838327
653,44.0,0.0009333450259720166,0.00018065671751258956,0.0005972520369240816,0.000888878230563365,0.0009178375641137383,0.0009488381752067123,0.0017842053123725214
656,44.0,0.0008833673208894847,0.00018188097756728107,0.0005481636006792461,0.0008385813666838339,0.0008681060644313127,0.000898362205121108,0.001748618641814934
659,44.0,0.0008366276723192905,0.00018361264415131203,0.0005001555698847898,0.0007912074162382749,0.0008208285356987488,0.0008529081916999869,0.0017167423549543466
662,44.0,0.0007999361795080471,0.0001856975526841232,0.00046152139111028153,0.0007542384676681356,0.0007842507216398436,0.0008154354668950124,0.0016963024453126054
665,44.0,0.0007793587101998352,0.00018792998583553992,0.000441241929488048,0.0007334196361091627,0.0007632722743241463,0.0007938687344684671,0.0016934925457921387
668,44.0,0.0007673916062236868,0.00018976102664080362,0.0004306853387686685,0.0007202267299760655,0.0007509631241353098,0.0007815786048123301,0.0016974623009943506
671,44.0,0.0007629619620311758,0.00019152236362990455,0.0004276171105089542,0.0007140289982046932,0.000746121562699424,0.0007770856374875551,0.0017096219170348104
674,44.0,0.0007635675421779339,0.00019359393475041183,0.0004287687649599484,0.0007151655735469491,0.0007458816254219624,0.0007769994052767141,0.0017289219876159489
677,44.0,0.0007681153335604118,0.00019587246924546273,0.0004330634215629553,0.0007190484078053927,0.0007483906503656917,0.0007804919962414944,0.001752574250063484
680,44.0,0.0007741806539438172,0.00019806348749646643,0.0004410587062325701,0.0007241192943019998,0.0007538902307771169,0.0007855176372014964,0.001779373688000877
683,44.0,0.0007707924815693255,0.00019924352453902253,0.00044842611120012407,0.0007198825241198925,0.0007480977540711257,0.0007814201664018318,0.0017937774651292217
686,44.0,0.000761095910731224,0.00020092138951286284,0.0004480371942992775,0.0007094173629226999,0.0007372732685399003,0.0007701567937788132,0.0018060356954854664
689,44.0,0.0007377298620898726,0.00020243690698637667,0.00043671900468749276,0.0006864257458588989,0.0007120587908617623,0.0007435841127698921,0.0018048916563327064
692,44.0,0.0007010035309471714,0.0002037090133808386,0.00041684283329309377,0.0006485651910402998,0.0006760242233281491,0.0007037574648603733,0.0017883477169565508
695,44.0,0.0006621760693954073,0.00020552128488606703,0.00039533845855123156,0.000608855235267135,0.0006350222058109158,0.000661788428790749,0.0017726670031220008
698,44.0,0.0006233566290719818,0.00020741709684373824,0.0003723295108749275,0.0005702571624776096,0.0005915665968729328,0.000620110651423297,0.0017565185853960408
701,44.0,0.0005839875041913736,0.00020915546714413258,0.00034974965203582844,0.0005303271352505828,0.0005467530329520498,0.0005743296158108836,0.0017364385423193698
704,44.0,0.0005441242871814767,0.00021083465945216876,0.000330230349309522,0.00048581975662935793,0.0005056989836314717,0.0005263086948911973,0.0017155518694189774
707,44.0,0.0005085233616054318,0.00021316065493776236,0.00031543259850459694,0.0004516073685135606,0.00046595490255827533,0.00048277809357756476,0.001700729084355681
710,44.0,0.000473106562687093,0.0002151280447619416,0.0003010012095510455,0.00041173215534022185,0.0004268130900391872,0.00044394657369099344,0.001681258646429419
713,44.0,0.00043605415187276156,0.00021525720328088288,0.00028668407145020154,0.00037520342202123773,0.00038941201203484405,0.0004033311056843636,0.0016496131129048342
716,44.0,0.00040125955288463337,0.00021620450604548523,0.00027264061009340694,0.00033565573673449684,0.0003531749610993803,0.0003704884307424324,0.0016230420529884837
719,44.0,0.0003662411894700093,0.00021826861943433526,0.00024779590518749894,0.0002957857988071207,0.0003179918762609798,0.0003394445553933813,0.0016018048360834738
722,44.0,0.0003338603472355102,0.0002202354250340942,0.00022512827145939086,0.00025992982584889643,0.0002823093242684322,0.0003088230835718678,0.0015780441248818141
725,44.0,0.00030753896487497814,0.0002232855855705855,0.0001998993733269921,0.00022731390535521168,0.00025842163926988957,0.00028401206163924887,0.0015656013532036695
728,44.0,0.0002851520443022652,0.00022646445346073536,0.00017006459871192334,0.00019880266806326344,0.0002370985616655595,0.0002645710544089477,0.001556411057560285
731,44.0,0.00026837963607026646,0.0002304634232711262,0.00014547060731928842,0.00017858632525290404,0.00021794304073735854,0.0002497475572509626,0.0015551959719558354
734,44.0,0.00025914630609048225,0.00023540747156786367,0.00012839670508944229,0.00016276578538430944,0.00020859702887140958,0.00024379970691425467,0.001567330000359921
737,44.0,0.00025549044851383033,0.00023927636874548726,0.0001152907987764706,0.00015544643460663708,0.00020218459611605544,0.00024201710060894324,0.0015771587001017142
740,44.0,0.00025638903451635076,0.00024254628757394893,0.00011001863789013275,0.00015119985133277855,0.0002019270398975876,0.00024626441943889193,0.0015904729142971596
743,44.0,0.0002596652321555429,0.0002465861356790752,0.00010608316921962859,0.00015186715898364068,0.00020383893828001902,0.000250098482469019,0.001613921823458455
746,44.0,0.00026342638351914264,0.00025031134476872775,0.00010631043417189465,0.00015192904959274988,0.00020953858975649814,0.00025656866383685597,0.0016336088836920424
749,44.0,0.000266680203898364,0.0002542016012843479,0.00010362896814077854,0.00015094068880890451,0.0002112754290843292,0.0002591931526613783,0.0016563251464599242
752,44.0,0.00027028867044351346,0.00025793825847450665,0.00010223567570302691,0.00015129422499510472,0.0002126945131361644,0.0002635068836853177,0.0016773685980337276
755,44.0,0.00027306143450982754,0.00026094134629954524,0.00010349834999116808,0.00015085285204974926,0.00021502802013473267,0.00026784796029332634,0.0016940959702192364
758,44.0,0.0002737379554143084,0.00026141396157261027,0.00010385692355219959,0.00014849210234853765,0.00021495150972609774,0.0002695211706775709,0.0016981442139858084
761,44.0,0.00026989122105356263,0.00025874034926722406,0.00010198642509017952,0.00014281984669259264,0.00021002510742905447,0.00026796546133591554,0.0016831671768336033
764,44.0,0.0002607901995304242,0.00026024508561437923,9.691864222497811e-05,0.0001332985645289965,0.0001996031258957839,0.0002602602689798639,0.0016843102403100152
767,44.0,0.00026257236201122355,0.0002704708756826979,8.951093497461463e-05,0.00013077871628093085,0.00019751879944347977,0.0002634046142274613,0.0017407228750104659
770,44.0,0.0002801305782686823,0.0002782826572944699,0.00010291477260642926,0.0001437451711300566,0.0002167286164459755,0.0002808260311764786,0.001801618666790424
773,44.0,0.00028479290105057933,0.00028087630589630026,0.0001070619707138902,0.00014913649867257485,0.00022154091249266042,0.0002837508241295342,0.001828321082113553
776,44.0,0.00028550508675187936,0.00028262090014268064,0.00010521481166258928,0.00014945140972422624,0.00022113122403465656,0.00028261454537698824,0.0018412879550652173
779,44.0,0.00028703818063396735,0.0002845879118583189,0.00010805357048535641,0.00014815010358600668,0.00022328214854224176,0.00028692536783799666,0.001855260792068794
782,44.0,0.0002889770502245003,0.00028712652369916803,0.00011094244866336703,0.0001484592024345466,0.0002236013642090297,0.0002900658877487162,0.0018748475135928
785,44.0,0.00029073651752702605,0.00028987800823822367,0.00011043734887671925,0.00014957164789155546,0.0002241134970021432,0.0002912876022918404,0.0018944915703308371
788,44.0,0.00029317698858118824,0.0002925874543492177,0.00010879522463688051,0.0001526266254310982,0.00022475211857751778,0.00029216751048370324,0.0019137196648712955
791,44.0,0.0002963154863763984,0.00029527222371352244,0.00010915683235345299,0.0001548738337345892,0.00022603665326825236,0.000296247645825155,0.0019339270240782656
794,44.0,0.0003002068303267807,0.00029853818394331386,0.00011280410974949915,0.0001536005979865721,0.00022987133915835985,0.00030243733124983737,0.00195730925384124
797,44.0,0.00030499094409001135,0.00030214343129249173,0.0001175523814010521,0.0001567840414707984,0.00023322714695619352,0.0003051420629393132,0.0019831977687015815
800,44.0,0.000309807140506164,0.0003057159542857226,0.00012080449332963234,0.0001611262306753954,0.00023415770176018515,0.0003084538320200691,0.00201171551633359
803,44.0,0.0003139024064782912,0.00030902904005053244,0.00012141246943941193,0.00016161614887127168,0.00023924509167894215,0.00031364353917537937,0.0020368588880988747
806,44.0,0.0003196086549476494,0.00031304176150871266,0.0001269538410953521,0.00016876758602467942,0.00024295866221431083,0.00032052094271807486,0.0020663632730302498
809,44.0,0.00031930857557535905,0.00031409700494826917,0.00012566394821212558,0.00016439899078941702,0.0002455722756515978,0.00032127627372742756,0.0020704598639566672
812,44.0,0.00031608985845325794,0.0003157054062915515,0.00012414773547031222,0.00016081195202863162,0.00024095342792204163,0.00031782565524809893,0.0020821518482376134
815,44.0,0.00031234254383268024,0.00031740731225614295,0.00012056662714078441,0.00015609121598342366,0.00023455382710199977,0.00031684428275665825,0.002086477485052259
818,44.0,0.0003075621934143825,0.00031841898133684143,0.00011763686056534721,0.00014938633471062228,0.00023187503695100214,0.0003124489411785357,0.0020883582070204006
821,44.0,0.00029927079230685757,0.00031958391729077585,0.00011058202376229341,0.00014001578534505343,0.0002240387543300725,0.0002998519014814602,0.002089756974540424
824,44.0,0.00029317402660232163,0.0003226399997079824,0.0001008277887028219,0.00013718265681493796,0.00021483267976731834,0.00029188682599946516,0.0021021309778260066
827,44.0,0.000285536710118504,0.0003255569394906615,9.326767458049961e-05,0.00012877960525522857,0.00020450092442350523,0.0002859106685270568,0.00211204253891928
830,44.0,0.0002788645579766917,0.00032727076389648676,8.490470488227813e-05,0.00012297409407931154,0.00020180881768542056,0.00027909472036410183,0.002114236773311395
833,44.0,0.00027268619668543667,0.00032870437783841645,7.727729662591655e-05,0.00011345352371029713,0.0001964180181046132,0.00027351238622228924,0.002118259273348208
836,44.0,0.000270450961919438,0.00033113948626063797,7.157165837565287e-05,0.0001146427153793081,0.00018819418565082065,0.0002731721438379199,0.00213366226131215
839,44.0,0.0002701440916288123,0.0003351143735977681,7.420991921880331e-05,0.00011120524340597936,0.00018575104092512852,0.00027266761028205074,0.0021581364629074036
842,44.0,0.0002685279032818902,0.00033658020565028533,6.934075596286254e-05,0.00010700935742053133,0.00018356161650337325,0.0002732062661488571,0.0021634214731306536
845,44.0,0.00026799110634383465,0.00033765770905747636,6.74203672144994e-05,0.00010547478685964881,0.00018406929478145755,0.0002756091798331726,0.002169093536886291
848,44.0,0.0002672632089041294,0.00033886149224034574,6.779447844003146e-05,0.00010334078605125072,0.00018228489235097822,0.00027245607256604575,0.00217429559257591
851,44.0,0.000268220360971381,0.000341746018343483,7.013612735382675e-05,0.00010380615510264382,0.00018061915745610526,0.00026925335145479404,0.0021971438448149874
854,44.0,0.0002661421011664415,0.00034368676481721916,6.232743188981498e-05,0.00010046397794241049,0.00017958247401384807,0.0002684162722123864,0.0022066022105061934
857,44.0,0.0002638870186798293,0.00034531864793676,5.777271050286405e-05,9.469215876110136e-05,0.00018235500067649286,0.0002672236921428411,0.0022123156674667827
860,44.0,0.0002660529389588991,0.0003486266970687928,6.084034290692955e-05,9.961826413085808e-05,0.00018310865661969505,0.0002667394086551996,0.002236238267831931
863,44.0,0.0002628256427495674,0.0003505576643433286,5.696494076350223e-05,9.544588490090554e-05,0.0001738139445356617,0.00026323041560277185,0.0022464978402463322
866,44.0,0.00026137831080737803,0.00035203658866626814,5.182523770337013e-05,9.465748425988755e-05,0.00017192461811876857,0.0002646429043146459,0.002255221249956476
869,44.0,0.0002615373570136279,0.00035288673769105826,5.0378009128501135e-05,9.636422273326942e-05,0.00017933735792229402,0.0002621512135998602,0.002260675461513414
872,44.0,0.00026471222641160107,0.0003553491918410325,5.631586843604864e-05,9.549053156130154e-05,0.00017876779745267153,0.0002701496226644409,0.002266727951840995
875,44.0,0.00026354584590080146,0.0003580551875064942,5.191741221281052e-05,9.736289077987221e-05,0.00017259375569609123,0.00026298561829164876,0.0022910058446381316
878,44.0,0.0002611680030931206,0.00035966332074664433,4.910390075881293e-05,9.444839987017316e-05,0.00017398174569302927,0.0002629996480190954,0.0022974679965517683
881,44.0,0.0002589662954916847,0.0003597838905517663,4.381741105278289e-05,8.888011249962233e-05,0.00016991991974290557,0.00026599073399766193,0.0022945444054811013
884,44.0,0.0002588564083563562,0.00036154672120262206,4.452439135128094e-05,8.754584210388927e-05,0.00016730128899622603,0.000267530325180921,0.0023047758532725375
887,44.0,0.00025870510993656937,0.00036468064281827835,4.0239621253348914e-05,8.938244856800217e-05,0.00016471423892382427,0.0002590798864750392,0.0023249306611182793
890,44.0,0.0002588074766274756,0.00036638350107149703,3.93190665342487e-05,8.194938381014366e-05,0.00016396050702607596,0.0002583482678431032,0.00233339507532099
893,44.0,0.0002577866373790621,0.00036609187514193367,3.048462125876405e-05,8.59783695030096e-05,0.00016906423618328302,0.0002600769858381514,0.002326733173663478
896,44.0,0.00025065080213853685,0.00036437302782838665,3.258789151097865e-05,7.647431677054389e-05,0.00016942872532557044,0.0002508079500243706,0.002309325769951368
899,44.0,0.00024252348091716982,0.000360618229545191,2.5275292326826063e-05,7.193215584702661e-05,0.00014962077213943257,0.0002483730272918759,0.0022874101064551716
902,44.0,0.00024075812550267104,0.0003650996558287996,1.4271191765074983e-05,6.509795828739303e-05,0.00014372470064425493,0.0002454202586248108,0.0022994915374901135
905,44.0,0.00024368390465442455,0.00036857987176591635,9.432239647463089e-06,6.128370841780783e-05,0.00015692130615746914,0.00023789903107276697,0.0023228635366177672
908,44.0,0.00023750035507067986,0.00036718051340406963,1.935599801242437e-05,6.584638490904339e-05,0.0001525781272425978,0.0002337433517398536,0.002319015769697332
911,44.0,0.0002355218530510906,0.0003676611159792037,1.8214652478805986e-05,7.309755752293935e-05,0.0001480383841207827,0.0002294178390212984,0.002314062447323905
914,44.0,0.00023274506696059332,0.0003695566532492817,7.625248544254246e-06,6.194646413013971e-05,0.00013599330479403246,0.00021879448753657114,0.002331376686314012
917,44.0,0.00022980518880380118,0.00036846005597169015,3.611710880683133e-06,6.173963040405457e-05,0.00014256477842520632,0.00021867548038531181,0.002309274670920128
920,44.0,0.00022815668986946375,0.00036937631680671913,-7.65734523368126e-06,5.172292891798523e-05,0.00013993265433663718,0.0002196881680544213,0.0023048057095939765
923,44.0,0.0002267072889854349,0.00037280133732842043,-9.679578100192372e-06,4.4161913536475206e-05,0.00013373509472468345,0.00022128377102000304,0.0023262770850329324
926,44.0,0.00022286106262842865,0.00037440146935614657,-8.655602014959408e-06,4.60854862498112e-05,0.00012894708254501436,0.00021994131387570215,0.0023285248919756854
929,44.0,0.00021901697559667288,0.00036741776645760613,-1.1222157661405543e-05,5.464904999299802e-05,0.00012318240177889932,0.00022582908924146882,0.002283811435074845
932,44.0,0.00022348897331086285,0.0003470822577481269,-2.7496236478048154e-05,5.7794463930036175e-05,0.00013877135015374198,0.0002436889748838176,0.0021821656137652077
935,44.0,0.00020706093761315838,0.00033050456968099006,-5.212073943891432e-05,4.3075524775231574e-05,0.00012949328901583655,0.00023455209242338358,0.002045103425763617
938,44.0,0.00019422370542927003,0.0003452582173228475,-8.832344916884375e-05,3.710879884694506e-05,0.00011151073116388312,0.00022728554911997242,0.0021089301792086546
941,44.0,0.00016661450970693458,0.0003393585619666861,-0.00014210420206273625,1.068613318467681e-05,6.807456274119284e-05,0.00020415136122342527,0.001986823842689277
944,44.0,0.0001938481733745334,0.0003309040067866306,-6.200549836366426e-05,3.3907144144390135e-05,0.00012531466335633467,0.00019978832554865556,0.00199645345070853
947,44.0,0.00019165916627664586,0.0003392960223368115,-7.581018845197376e-05,4.212261800389266e-05,0.00010903529218851003,0.00019699826393773822,0.002077498164062764
950,44.0,0.00019184010570890455,0.000328313367157994,-6.9138059028104e-05,4.5891981809802985e-05,0.00010589945049722131,0.00018663621171748388,0.001973942536061817
...@@ -16,3 +16,8 @@ F0_file = os.path.join(root, '../aux/Thuillier_2003_0.3nm.dat') ...@@ -16,3 +16,8 @@ F0_file = os.path.join(root, '../aux/Thuillier_2003_0.3nm.dat')
wl_step = 3 wl_step = 3
wl_common = np.arange(320,950+wl_step,wl_step) wl_common = np.arange(320,950+wl_step,wl_step)
# wavelength indexes for iwr plotting
# for close red/IR
# idx_list_for_plot=(165,170,175,180,185,190,195,200,205)
# through visible/IR
idx_list_for_plot=(28, 37, 51, 71, 91, 105, 130, 140, 170)
\ No newline at end of file
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
Usage: Usage:
trios_processing <input_dir> <IDpr> <measurement_type> --lat <lat> --lon <lon> \ trios_processing <input_dir> <IDpr> <measurement_type> --lat <lat> --lon <lon> \
[--altitude=alt] [--ofile <ofile>] [--odir <odir>] [--plot] [--figdir <figdir>] \ [--altitude=alt] [--ofile <ofile>] [--odir <odir>] [--plot] [--figdir <figdir>] \
[--name <name>] [--method <method>] [--no_clobber] [--name <name>] [--method <method>] [--no_clobber] \
[--vza <vza>] [--azi <azi>] [--ws <ws>] [--aot <aot>]
trios_processing -h | --help trios_processing -h | --help
trios_processing -v | --version trios_processing -v | --version
...@@ -26,6 +27,14 @@ Options: ...@@ -26,6 +27,14 @@ Options:
--name name Keyword to append to file name and figures [default: ] --name name Keyword to append to file name and figures [default: ]
--method method Keyword for the method to apply for data processing. --method method Keyword for the method to apply for data processing.
For awr: M99, M15, osoaa, temp_opt [default: M99] For awr: M99, M15, osoaa, temp_opt [default: M99]
--vza vza Viewing zenith angle (in deg) of the awr radiometer (applicable for all awr methods)
[default: 40]
--azi azi Relative azimuth angle (in deg) of the awr radiometer (applicable for all awr methods)
[default: 135]
--ws ws Wind speed (in m/s) (applicable for awr methods: M99, M15, osoaa)
[default: 2]
--aot aot Aerosol optical thickness at 550 nm (applicable for awr methods: osoaa)
[default: 0.1]
--no_clobber Do not process <input_dir> <IDpr> files if <output_file> already exists. --no_clobber Do not process <input_dir> <IDpr> files if <output_file> already exists.
''' '''
...@@ -65,6 +74,10 @@ def main(): ...@@ -65,6 +74,10 @@ def main():
plot = args['--plot'] plot = args['--plot']
figdir = os.path.abspath(args['--figdir']) figdir = os.path.abspath(args['--figdir'])
noclobber = args['--no_clobber'] noclobber = args['--no_clobber']
azi = float(args['--azi'])
vza = float(args['--vza'])
ws = float(args['--ws'])
aot = float(args['--aot'])
try: try:
type_ = type_list[meas_type] type_ = type_list[meas_type]
...@@ -103,17 +116,15 @@ def main(): ...@@ -103,17 +116,15 @@ def main():
ax.set_ylabel(r'$R_{rs}\ (sr^{-1})$') ax.set_ylabel(r'$R_{rs}\ (sr^{-1})$')
ax.set_xlabel(r'Wavelength (nm)') ax.set_xlabel(r'Wavelength (nm)')
ax.set_title('ID: ' + idpr + ', ' + date + ', sza=' + str(round(df.sza.mean(), 2))) ax.set_title('ID: ' + idpr + ', ' + date + ', sza=' + str(round(df.sza.mean(), 2)))
fig.savefig(os.path.join(figdir, 'trios_swr_' + date + '_idpr' + idpr + name+'.png'), bbox_inches='tight') fig.savefig(os.path.join(figdir, 'trios_swr_' + date + '_idpr' + idpr + name + '.png'),
bbox_inches='tight')
plt.close() plt.close()
elif meas_type == 'awr': elif meas_type == 'awr':
# ----------------------------------------------- # -----------------------------------------------
# AWR processing # AWR processing
# ----------------------------------------------- # -----------------------------------------------
azi = 135
vza = 40
ws = 2
method = 'M99'
uawr = u.awr_data(idpr, files) uawr = u.awr_data(idpr, files)
if uawr.Edf: if uawr.Edf:
df, wl = uawr.reader(lat, lon, alt) df, wl = uawr.reader(lat, lon, alt)
...@@ -127,17 +138,39 @@ def main(): ...@@ -127,17 +138,39 @@ def main():
print('Skip processing: data already processed with "--no_clobber" set') print('Skip processing: data already processed with "--no_clobber" set')
return return
awr = awr_process(df, wl, name, idpr)
if plot: if plot:
figfile = os.path.join(figdir, 'trios_awr_' + date + '_idpr' + idpr + name +'.png') figfile = os.path.join(figdir, 'trios_awr_' + date + '_idpr' + idpr + name + '.png')
else: else:
figfile = "" figfile = ""
Rrs = awr.call_process(method, ofile, vza=vza, azi=azi, plot_file=figfile) awr = awr_process(df, wl, name, idpr)
Rrs = awr.call_process(method, ofile, vza=vza, azi=azi, ws=ws, aot=aot, plot_file=figfile)
elif meas_type == 'iwr': elif meas_type == 'iwr':
pass # -----------------------------------------------
# IWR processing
# -----------------------------------------------
uiwr = u.iwr_data(idpr, files)
if uiwr.file:
df, wl = uiwr.reader(lat, lon, alt)
date = df.index[0].date().__str__()
if ofile:
ofile = os.path.join(odir, ofile)
else:
ofile = os.path.join(odir, 'Rrs_iwr_' + date + '_idpr' + idpr + name + '.csv')
if noclobber and os.path.exists(ofile):
print('Skip processing: data already processed with "--no_clobber" set')
return
if plot:
figfile = os.path.join(figdir, 'trios_iwr_' + date + '_idpr' + idpr + name + '.pdf')
else:
figfile = ""
iwr = iwr_process(df, wl, name, idpr)
results = iwr.call_process(ofile, plot_file=figfile)
if __name__ == "__main__": if __name__ == "__main__":
......
# standard lib
import pandas as pd import pandas as pd
from scipy import interpolate, integrate from scipy import interpolate, integrate
import scipy.optimize as so import scipy.optimize as so
# for plotting pruposes
import cmocean
import plotly.graph_objs as go import plotly.graph_objs as go
from matplotlib.backends.backend_pdf import PdfPages
import matplotlib as mpl import matplotlib as mpl
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 18}) plt.rcParams.update({'font.size': 18})
# package
from trios.utils.utils import plot as up from trios.utils.utils import plot as up
import trios.utils.utils as uu import trios.utils.utils as uu
from trios.utils.utils import reshape as r from trios.utils.utils import reshape as r
...@@ -92,7 +96,7 @@ class awr_process: ...@@ -92,7 +96,7 @@ class awr_process:
def call_process(self, method='M99', ofile="", vza=40, azi=135, ws=2, aot=0.1, plot_file=""): def call_process(self, method='M99', ofile="", vza=40, azi=135, ws=2, aot=0.1, plot_file=""):
wl = self.wl wl = self.wl
vza, azi, ws = [vza], [azi], [ws] # formatting for interpolation functions vza, azi, ws, aot = [vza], [azi], [ws], [aot] # formatting for interpolation functions
# ------------------ # ------------------
# filtering # filtering
...@@ -111,7 +115,7 @@ class awr_process: ...@@ -111,7 +115,7 @@ class awr_process:
elif method == 'osoaa': elif method == 'osoaa':
Rrs, rho = self.process_wrapper(wl, clean, clean.sza, vza=vza, azi=azi, ws=ws, aot=aot, method=method) Rrs, rho = self.process_wrapper(wl, clean, clean.sza, vza=vza, azi=azi, ws=ws, aot=aot, method=method)
elif method == 'temp_opt': elif method == 'temp_opt':
Rrs, Rrs_opt_std = self.process_optimization(wl, Lt, Lsky, Ed, sza, vza=vza, azi=azi) Rrs, rho, Rrs_opt, Rrs_opt_std = self.process_optimization(wl, Lt, Lsky, Ed, sza, vza=vza, azi=azi)
self.Rrs = Rrs self.Rrs = Rrs
...@@ -121,7 +125,6 @@ class awr_process: ...@@ -121,7 +125,6 @@ class awr_process:
Rrs_stat = Rrs_stat.T Rrs_stat = Rrs_stat.T
Rrs_stat.to_csv(ofile) Rrs_stat.to_csv(ofile)
if plot_file: if plot_file:
# ------------------ # ------------------
# plotting # plotting
...@@ -155,21 +158,21 @@ class awr_process: ...@@ -155,21 +158,21 @@ class awr_process:
up.add_curve(ax, wl, Lt.mean(axis=0), Lt.std(axis=0), up.add_curve(ax, wl, Lt.mean(axis=0), Lt.std(axis=0),
label=r'$L_t$', c='black') label=r'$L_t$', c='black')
up.add_curve(ax, wl, Lsky.mean(axis=0) * rho, Lsky.std(axis=0) * rho, up.add_curve(ax, wl, Lsky.mean(axis=0) * rho, Lsky.std(axis=0) * rho,
label=method+' (' + str(round(rho, 4)) + ')', c='violet') label=method + ' (' + str(round(rho, 4)) + ')', c='violet')
ax.set_ylabel(r'$L_t\ or L_{surf}$') ax.set_ylabel(r'$L_t\ or L_{surf}$')
ax.set_xlabel(r'Wavelength (nm)') ax.set_xlabel(r'Wavelength (nm)')
# ---- Proportion o(Lt - Lsurf ) /Lt # ---- Proportion o(Lt - Lsurf ) /Lt
ax = axs[0, 2] ax = axs[0, 2]
up.add_curve(ax, wl, Lsky.mean(axis=0) * rho / Ltm, Lsky.std(axis=0) * rho, up.add_curve(ax, wl, Lsky.mean(axis=0) * rho / Ltm, Lsky.std(axis=0) * rho,
label=method+' (' + str(round(rho, 4)) + ')', c='violet') label=method + ' (' + str(round(rho, 4)) + ')', c='violet')
ax.set_ylabel(r'$L_{surf}/L_t$') ax.set_ylabel(r'$L_{surf}/L_t$')
ax.set_xlabel(r'Wavelength (nm)') ax.set_xlabel(r'Wavelength (nm)')
# ---- Lw # ---- Lw
ax = axs[1, 0] ax = axs[1, 0]
up.add_curve(ax, wl, Rrs.mean(axis=0) * Edm, Rrs.std(axis=0) * Edm, up.add_curve(ax, wl, Rrs.mean(axis=0) * Edm, Rrs.std(axis=0) * Edm,
label=method+' (' + str(round(rho, 4)) + ')', c='violet') label=method + ' (' + str(round(rho, 4)) + ')', c='violet')
ax.set_ylabel(r'$L_{w}\ (sr^{-1})$') ax.set_ylabel(r'$L_{w}\ (sr^{-1})$')
ax.set_xlabel(r'Wavelength (nm)') ax.set_xlabel(r'Wavelength (nm)')
...@@ -177,7 +180,7 @@ class awr_process: ...@@ -177,7 +180,7 @@ class awr_process:
# ---- Rrs # ---- Rrs
ax = axs[1, 1] ax = axs[1, 1]
up.add_curve(ax, wl, Rrs.transpose().mean(axis=1), Rrs.transpose().std(axis=1), up.add_curve(ax, wl, Rrs.transpose().mean(axis=1), Rrs.transpose().std(axis=1),
label=method+' (' + str(round(rho, 4)) + ')', c='violet') label=method + ' (' + str(round(rho, 4)) + ')', c='violet')
ax.set_ylabel(r'$R_{rs}\ (sr^{-1})$') ax.set_ylabel(r'$R_{rs}\ (sr^{-1})$')
ax.set_xlabel(r'Wavelength (nm)') ax.set_xlabel(r'Wavelength (nm)')
...@@ -263,7 +266,7 @@ class awr_process: ...@@ -263,7 +266,7 @@ class awr_process:
# initialization of mean/median values # initialization of mean/median values
# ------------------------------ # ------------------------------
Rrs, rho = self.process(wl, Lt, Lsky, Ed, sza, ws=ws, azi=azi) Rrs, rho = self.process(wl, Lt, Lsky, Ed, sza, ws=ws, azi=azi)
Rrs_bar = Rrs.mean(axis=0) Rrs_bar = np.nanmedian(Rrs, axis=0)
# ----------------------------- # -----------------------------
# non-linear optimization # non-linear optimization
...@@ -288,7 +291,9 @@ class awr_process: ...@@ -288,7 +291,9 @@ class awr_process:
print(res_lsq.x, res_lsq.cost) print(res_lsq.x, res_lsq.cost)
Rrs_bar = np.mean(Rrs_est, axis=0) Rrs_bar = np.mean(Rrs_est, axis=0)
Rrs_std = np.std(Rrs_est, axis=0) Rrs_std = np.std(Rrs_est, axis=0)
return Rrs_bar, Rrs_std Rrs_est = pd.DataFrame(Rrs_est)
Rrs_est.columns = pd.MultiIndex.from_product([['Rrs'], wl], names=['param', 'wl'])
return Rrs_est, np.mean(rho_est, axis=0), Rrs_bar, Rrs_std
@classmethod @classmethod
def filtering(cls, Lt, Lsky, Ed, **kargs): def filtering(cls, Lt, Lsky, Ed, **kargs):
...@@ -400,9 +405,256 @@ class swr_process: ...@@ -400,9 +405,256 @@ class swr_process:
class iwr_process: class iwr_process:
def __init__(self, df=None, wl=None, ): def __init__(self, df=None, wl=None, name="", idpr=""):
self.df = df self.df = df
self.wl = wl self.wl = wl
self.name = name
self.idpr = idpr
def call_process(self, ofile="", plot_file=""):
# ---------------------------
# Data formatting
# ---------------------------
df = self.df
wl = self.wl
# set pandas dataframes with data and parameters
df['rounded_depth', ''] = df.prof_Edz.round(1)
# data filtering
df[df.rounded_depth < -0.05] = np.nan
# df[df == 0] = np.nan
mean = df.groupby('rounded_depth').mean()
median = df.groupby('rounded_depth').median()
std = df.groupby('rounded_depth').std()
q25 = df.groupby('rounded_depth').quantile(0.25)
q75 = df.groupby('rounded_depth').quantile(0.75)
# ---------------------------
# Data processing
# ---------------------------
res = self.process(mean, std)
res_w = self.process(mean, std, mode='log')
res_med = self.process(median, std)
res_lsq = self.process(mean, std, mode='lsq')
Kd = res_lsq.popt[:, 0]
Edm = res_lsq.popt[:, 1]
Es = mean.Ed.mean()