diff --git a/book/tutorials/SlideRule_applications/Fenris_Gletscher_PS_v1.4.2.geojson b/book/tutorials/SlideRule_applications/Fenris_Gletscher_PS_v1.4.2.geojson new file mode 100644 index 0000000..ccc4608 --- /dev/null +++ b/book/tutorials/SlideRule_applications/Fenris_Gletscher_PS_v1.4.2.geojson @@ -0,0 +1,8 @@ +{ +"type": "FeatureCollection", +"name": "Fenris_Gletscher_PS_v1", +"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::3413" } }, +"features": [ +{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 420418.189146014337894, -2525875.277578017674387 ], [ 420361.339319153048564, -2526488.917637047357857 ], [ 420082.513631503737997, -2527003.672752704937011 ], [ 419953.824852589517832, -2527539.875998184550554 ], [ 419396.173477292235475, -2527668.56477709999308 ], [ 418774.177712537464686, -2528505.041840047109872 ], [ 418109.285688144445885, -2528976.900696066673845 ], [ 417931.720389603229705, -2529065.68334533739835 ], [ 417251.360495378728956, -2529405.863292449619621 ], [ 417036.879197187547106, -2529255.72638371353969 ], [ 416414.883432432718109, -2528633.730618961155415 ], [ 416071.713355326966848, -2528397.801190950907767 ], [ 415342.476941476401407, -2528912.556306608486921 ], [ 414806.273695997719187, -2529791.929629191290587 ], [ 414763.377436359936837, -2530220.892225576099008 ], [ 414548.896138168114703, -2530478.269783403258771 ], [ 414055.589152328320779, -2530692.751081597525626 ], [ 413926.900373413809575, -2531636.468793638981879 ], [ 413733.867205041751731, -2532237.016428574919701 ], [ 413412.145257754891645, -2532751.771544233430177 ], [ 413369.248998116701841, -2533202.182270436082035 ], [ 413068.975180648616515, -2533545.352347541600466 ], [ 412146.70559842599323, -2533695.489256275817752 ], [ 411181.539756565180141, -2534060.107463200110942 ], [ 410323.614563800336327, -2534960.928915604948997 ], [ 408993.830515013774857, -2535818.854108368977904 ], [ 408178.80158188729547, -2536183.47231529513374 ], [ 407428.117038217373192, -2536226.368574931751937 ], [ 407127.84322074969532, -2535861.750368007458746 ], [ 406505.847455994400661, -2535947.542887283023447 ], [ 405991.092340335599147, -2536269.264834571164101 ], [ 405454.889094857033342, -2536590.986781856976449 ], [ 405218.959666847076733, -2536848.36433968693018 ], [ 404832.893330102553591, -2537341.671325527597219 ], [ 404747.100810826465022, -2536977.053118602372706 ], [ 404554.06764245411614, -2536655.331171315629035 ], [ 403867.727488242089748, -2536719.675560772418976 ], [ 403009.802295476722065, -2536869.812469506636262 ], [ 402495.04717981768772, -2537727.737662271596491 ], [ 402130.428972892579623, -2538070.907739378046244 ], [ 401594.225727414304856, -2538714.351633951999247 ], [ 400500.371106637932826, -2539357.795528525020927 ], [ 400457.474847000092268, -2539550.828696898184717 ], [ 400071.408510255743749, -2540151.376331833191216 ], [ 399620.997784053906798, -2540944.957135139964521 ], [ 399084.79453857592307, -2541931.571106821298599 ], [ 398805.968850927019957, -2541995.915496278554201 ], [ 398162.52495635318337, -2542210.396794470027089 ], [ 397561.977321417361964, -2542339.085573384538293 ], [ 396832.740907566912938, -2542360.533703203778714 ], [ 396146.40075335506117, -2543175.562636332120746 ], [ 395824.678806068084668, -2543325.69954506540671 ], [ 395224.131171132437885, -2543625.973362532444298 ], [ 394559.239146739419084, -2543261.355155608151108 ], [ 394216.069069633202162, -2542810.944429406430572 ], [ 393636.969564516970422, -2543347.147674885112792 ], [ 392993.525669942377135, -2543604.525232712738216 ], [ 392285.737385911750607, -2543668.86962217092514 ], [ 391535.052842241944745, -2543947.695309818722308 ], [ 390317.760754886257928, -2543884.486173377837986 ], [ 388689.22805374849122, -2544773.438679636456072 ], [ 387740.347318670013919, -2545466.773835385218263 ], [ 387227.612862455600407, -2546842.529959651175886 ], [ 387584.174096537870355, -2548481.795195976272225 ], [ 388725.347835936001502, -2548301.665663103107363 ], [ 388682.451576297695283, -2549052.350206773728132 ], [ 389240.102951594628394, -2549331.175894421990961 ], [ 389390.239860328962095, -2549567.105322431772947 ], [ 389733.409937435062602, -2549738.690360986161977 ], [ 389904.994975988171063, -2549996.067918815184385 ], [ 390333.957572370709386, -2550339.237995922099799 ], [ 390655.679519657511264, -2550618.063683569896966 ], [ 390720.023909115116112, -2550896.889371219091117 ], [ 390827.264558210561518, -2551175.715058866422623 ], [ 391106.090245859057177, -2551368.748227238189429 ], [ 391084.642116040166002, -2551626.12578506860882 ], [ 390548.438870562298689, -2552312.465939282439649 ], [ 389561.824898882012349, -2552719.980405845213681 ], [ 389025.621653403679375, -2552998.806093493942171 ], [ 388489.418407925753854, -2553320.528040780685842 ], [ 388039.007681723975111, -2553963.971935354638845 ], [ 387481.356306425994262, -2554628.863959745038301 ], [ 386859.360541671630926, -2555207.963464864529669 ], [ 386537.638594384596217, -2555679.822320884559304 ], [ 386430.397945289092604, -2556022.992397991009057 ], [ 385915.642829629243352, -2556216.025566362310201 ], [ 385400.887713970500045, -2556366.162475094664842 ], [ 385207.854545598675031, -2556902.365720574744046 ], [ 385250.750805236457381, -2557288.432057318277657 ], [ 385851.298440172278788, -2557803.187172979582101 ], [ 386151.572257640189491, -2558468.07919737091288 ], [ 386258.81290673580952, -2558982.834313030354679 ], [ 387052.39371004368877, -2559776.415116338059306 ], [ 387459.908176607394125, -2560162.481453083455563 ], [ 387567.148825702781323, -2560462.755270550493151 ], [ 387374.115657330607064, -2560891.717866933438927 ], [ 386837.912411852332298, -2561556.609891326632351 ], [ 386623.431113661383279, -2562907.842069931793958 ], [ 387266.875008235219866, -2563229.56401721900329 ], [ 387953.215162447479088, -2563980.248560889624059 ], [ 388489.418407925521024, -2564473.555546728894114 ], [ 388596.659057020908222, -2565310.032609674148262 ], [ 388339.281499191769399, -2565889.132114791776985 ], [ 388317.833369372645393, -2566232.302191898226738 ], [ 387288.323138054227456, -2566661.264788279309869 ], [ 386880.808671490987763, -2567347.604942492675036 ], [ 386366.053555831254926, -2567712.223149415571243 ], [ 386451.846075108158402, -2568291.322654534131289 ], [ 386258.812906736216974, -2569084.903457841835916 ], [ 385486.680233247636352, -2569792.691741873975843 ], [ 384714.547559758648276, -2570543.376285542268306 ], [ 383963.863016089075245, -2570607.72067500045523 ], [ 383441.033152284857351, -2570438.15423268545419 ], [ 383170.282212781487033, -2570350.3431171705015 ], [ 382741.319616398774087, -2570350.3431171705015 ], [ 382119.323851644061506, -2570114.413689160253853 ], [ 381926.290683271654416, -2569685.451092776376754 ], [ 380060.303389007400256, -2568999.110938565339893 ], [ 379095.13754714676179, -2568913.318419290240854 ], [ 378735.324526988260914, -2568517.582899312023073 ], [ 378934.061366897425614, -2568186.371590543538332 ], [ 379383.989709840796422, -2568095.568348610773683 ], [ 379563.935767263814341, -2566475.821411421988159 ], [ 379113.945350939698983, -2566295.969558011740446 ], [ 379294.079134736035485, -2566566.208677936811 ], [ 378484.011907096661162, -2567465.774858733639121 ], [ 378214.027388752321713, -2567375.854317252524197 ], [ 378484.044784079538658, -2566745.852285768836737 ], [ 377763.998438042937778, -2567375.953351041302085 ], [ 378393.942710223898757, -2565845.985810512211174 ], [ 376864.081035258073825, -2565306.048727064859122 ], [ 376774.027025291346945, -2565756.21562498062849 ], [ 376953.958547694724984, -2566116.25019825482741 ], [ 377584.056217600416858, -2566206.406452734954655 ], [ 376413.983778927184176, -2566475.779161371290684 ], [ 376234.065774855553173, -2566026.061579362489283 ], [ 376503.92736749019241, -2565305.839320143684745 ], [ 375244.053367116837762, -2564766.336156426928937 ], [ 375334.033936359803192, -2565935.929934036917984 ], [ 376774.126564391888678, -2566836.381111937109381 ], [ 376594.084419115330093, -2567376.348700577393174 ], [ 377043.990878950571641, -2567196.285992163233459 ], [ 376414.070439632225316, -2567736.117266910150647 ], [ 378034.044407232780941, -2567735.76460127858445 ], [ 376593.972739649529103, -2569266.093422503210604 ], [ 375424.043790008116048, -2567826.220679597463459 ], [ 375063.947368870605715, -2568905.869881903287023 ], [ 374253.942803241836373, -2568635.834639712702483 ], [ 374793.978246054553892, -2567376.041363024618477 ], [ 374343.883023161499295, -2566925.618982660584152 ], [ 374524.077144722687081, -2566476.368090460076928 ], [ 373894.009931591514032, -2566206.205509975086898 ], [ 374614.044931136944797, -2566115.988869464490563 ], [ 374074.068350585410371, -2565756.146715250331908 ], [ 374434.037883050215896, -2565305.924680699128658 ], [ 374434.109358531655744, -2564766.351022918242961 ], [ 374163.979296181234531, -2564315.828218676615506 ], [ 371014.034036950266454, -2563596.265021522063762 ], [ 369213.898944452346768, -2566025.896933618467301 ], [ 368133.999762848427054, -2564945.723006068263203 ], [ 366244.009245361841749, -2564585.642347602639347 ], [ 368133.99248128925683, -2561255.619863771833479 ], [ 370833.986771870986558, -2558645.926206196658313 ], [ 370653.973464511160273, -2557475.858311371877789 ], [ 370204.016216346644796, -2556756.392317262012511 ], [ 368403.970710559922736, -2555585.600032392889261 ], [ 367413.997408276307397, -2556485.642363717313856 ], [ 367144.043595347437076, -2557566.356595791876316 ], [ 368313.88539628701983, -2557655.609832296613604 ], [ 368224.028256350080483, -2558106.056613253429532 ], [ 366783.903034093498718, -2557925.911093097180128 ], [ 367684.092611407919321, -2558286.352670262567699 ], [ 367233.990249145252164, -2558556.265204857569188 ], [ 367413.911163515178487, -2558915.743830022402108 ], [ 367053.995414875738788, -2559996.332698715850711 ], [ 365434.109350050741341, -2560266.336917660199106 ], [ 365344.054245426843408, -2562156.036585513502359 ], [ 365074.083571938215755, -2562516.316122760996222 ], [ 364084.015997051843442, -2561976.218498445115983 ], [ 364714.100767074269243, -2562516.263092927169055 ], [ 364713.992748676042538, -2562876.339840663596988 ], [ 362734.03189117036527, -2562785.994063894730061 ], [ 360754.010524519835599, -2564586.280427500605583 ], [ 360573.968880350526888, -2565035.938369903713465 ], [ 360754.039565376471728, -2567646.332175109069794 ], [ 360573.969691747159231, -2567466.39960351632908 ], [ 360394.039817628508899, -2566026.427018209826201 ], [ 360034.008286662923638, -2565305.688506404403597 ], [ 360123.992616013914812, -2564406.143695973791182 ], [ 362823.965767543413676, -2560715.794627326540649 ], [ 362734.086042495968286, -2560356.352317559532821 ], [ 362104.048101125285029, -2560626.396487083751708 ], [ 361383.916282804158982, -2559725.601878214627504 ], [ 361023.996501473826356, -2559905.940564912743866 ], [ 361113.994140734721441, -2559006.392389656975865 ], [ 360844.044088082038797, -2558915.794471718836576 ], [ 361743.905819343053736, -2558375.736859117634594 ], [ 362103.992588675173465, -2559185.602470475248992 ], [ 361833.992144460789859, -2559546.375376448966563 ], [ 362194.093987176311202, -2559456.31480401288718 ], [ 362734.060054360190406, -2558016.418396986089647 ], [ 363004.06739172921516, -2558285.931327998172492 ], [ 363184.022913909750059, -2559545.599026488140225 ], [ 363723.980345770425629, -2559815.895312452688813 ], [ 363723.911380530742463, -2559275.883656436577439 ], [ 363273.935921214288101, -2558645.880313824862242 ], [ 363633.933172403078061, -2558106.043387813493609 ], [ 362554.027625159185845, -2557566.321726269088686 ], [ 364713.976924386399332, -2557926.194351317360997 ], [ 366423.931302540178876, -2557475.683883518446237 ], [ 368494.017619039106648, -2554415.843305213842541 ], [ 368223.994544999208301, -2553156.293272180948406 ], [ 367233.904265805205796, -2552345.758288006298244 ], [ 366514.082285660842899, -2552256.172104879748076 ], [ 366603.991539762879256, -2553245.922502889297903 ], [ 366334.122788699867669, -2553066.385246352758259 ], [ 366243.990716683503706, -2552435.816746265627444 ], [ 365704.046730327128898, -2552615.842338411137462 ], [ 365704.048611434875056, -2553066.278289128560573 ], [ 366513.99558473698562, -2554056.28988197632134 ], [ 365433.982410133525264, -2553605.81730436719954 ], [ 365073.928893642383628, -2552886.031337562482804 ], [ 364714.018771961447783, -2552975.733025321271271 ], [ 364804.064037764212117, -2553426.326424737460911 ], [ 364443.929101275920402, -2554055.984183533582836 ], [ 365433.964913202973548, -2553965.822943916078657 ], [ 366693.995217518007848, -2554595.724378780927509 ], [ 366333.924442261399236, -2555045.679319143760949 ], [ 363544.033282688993495, -2554865.910969245247543 ], [ 364353.948427269875538, -2555135.739617840386927 ], [ 364084.050146139750723, -2555855.929265301208943 ], [ 364173.969113060913514, -2556576.154479802586138 ], [ 363634.084973070945125, -2556486.049786448013037 ], [ 363993.982954861072358, -2556306.13869605679065 ], [ 363543.968853379425127, -2556216.270039679948241 ], [ 363724.041722469381057, -2555406.34220358915627 ], [ 363003.962562588858418, -2555226.150424476247281 ], [ 363183.958926615829114, -2555405.772092680446804 ], [ 363093.997345781652257, -2556035.894934178330004 ], [ 362464.103808336774819, -2555946.184546168427914 ], [ 362734.017468289588578, -2555766.168556275311857 ], [ 362553.917237428424414, -2555585.660599688533694 ], [ 362194.016681804903783, -2556035.769215524196625 ], [ 362373.95214914571261, -2556485.862901242915541 ], [ 363094.076535907341167, -2556486.285667547956109 ], [ 362913.96745683986228, -2556936.176774046849459 ], [ 361744.067543172102887, -2556666.359156745485961 ], [ 362104.065493192349095, -2557476.169363108463585 ], [ 361654.086325601616409, -2557836.324781405739486 ], [ 361744.116046959592495, -2557026.302395465318114 ], [ 360934.087477525055874, -2556666.071861442178488 ], [ 360753.994348928565159, -2557026.206719879526645 ], [ 361294.019350602466147, -2557386.412955882959068 ], [ 361203.9628280561883, -2557746.037318762857467 ], [ 359943.931172009732109, -2557655.895366711076349 ], [ 360844.138616835174616, -2557746.399535262491554 ], [ 360844.025102426006924, -2558106.355665391776711 ], [ 360213.929287437465973, -2557925.645932807121426 ], [ 360484.096120642032474, -2558376.192180086858571 ], [ 360394.102151066472288, -2558646.216275973711163 ], [ 359763.966112952388357, -2558555.801633121911436 ], [ 360574.057036050711758, -2559006.01769756199792 ], [ 360394.083288756606635, -2559906.015577855054289 ], [ 360034.019468745042104, -2560266.195770005695522 ], [ 359853.910876603156794, -2559815.947825791314244 ], [ 360303.950274809962139, -2559636.13837618008256 ], [ 359674.014652808080427, -2559365.671763032209128 ], [ 358683.975999986520037, -2559995.790710219647735 ], [ 358324.051082188612781, -2559726.280011508148164 ], [ 358233.910047304350883, -2560445.663913747761399 ], [ 357973.404687291593291, -2560594.625256908126175 ], [ 356789.082535250927322, -2559379.624714683741331 ], [ 356102.742381038726307, -2558393.010743004269898 ], [ 356102.742381038493477, -2557749.566848428919911 ], [ 355931.157342485617846, -2556419.782799644395709 ], [ 355845.364823209121823, -2555433.168827963527292 ], [ 355244.817188273533247, -2554189.17729845456779 ], [ 354858.750851529126521, -2553030.97828822163865 ], [ 354730.062072614207864, -2552258.845614731777459 ], [ 355330.609707549912855, -2551958.571797264739871 ], [ 355845.364823209063616, -2551701.194239433854818 ], [ 356403.01619850640418, -2551529.609200882259756 ], [ 357475.422689462837297, -2551100.646604497916996 ], [ 357432.52642982499674, -2550285.617671373300254 ], [ 356960.66757380386116, -2549899.551334627903998 ], [ 356274.32741959154373, -2549084.522401500027627 ], [ 355502.194746103079524, -2548784.248584032990038 ], [ 354772.958332252281252, -2548655.559805118478835 ], [ 354000.825658763875253, -2547840.530871991068125 ], [ 353443.174283466651104, -2547197.086977418512106 ], [ 353486.070543104840908, -2546467.850563566666096 ], [ 353528.966802742914297, -2545824.406668993178755 ], [ 352928.41916780709289, -2545052.273995503317565 ], [ 352242.079013595182914, -2543722.489946718327701 ], [ 351169.672522638458759, -2543508.008648526389152 ], [ 350311.747329873382114, -2543121.942311781924218 ], [ 349539.614656384510454, -2543722.489946715999395 ], [ 349024.859540725767147, -2544323.037581653799862 ], [ 348510.104425066499971, -2545009.377735865768045 ], [ 347652.179232301306911, -2544709.103918397799134 ], [ 346751.357779897691216, -2544237.245062376838177 ], [ 346365.291443153459113, -2543851.178725632373244 ], [ 346451.083962429896928, -2543121.942311781458557 ], [ 347051.631597365485504, -2542221.120859378017485 ], [ 347652.179232301248703, -2541663.469484081957489 ], [ 347695.075491939438507, -2541320.299406973645091 ], [ 346622.669000983121805, -2540290.789175657555461 ], [ 346493.980222067970317, -2538574.938790126238018 ], [ 347309.009155195148196, -2537416.739779892843217 ], [ 347566.386713024461642, -2536258.540769659914076 ], [ 347394.801674471411388, -2535271.926797979511321 ], [ 347137.42411664215615, -2534070.831528108101338 ], [ 347394.801674471644219, -2532569.462440769653767 ], [ 348038.245569045539014, -2531968.914805834647268 ], [ 348553.00068470480619, -2530896.508314878214151 ], [ 348553.000684704515152, -2530295.960679941345006 ], [ 348124.03808832220966, -2529738.309304644819349 ], [ 347480.594193748023827, -2529652.516785365063697 ], [ 346794.254039535822812, -2529995.686862473841757 ], [ 346065.017625685723033, -2530295.960679941810668 ], [ 345807.640067855711095, -2530724.923276322893798 ], [ 345550.262510026223026, -2531282.574651620816439 ], [ 344821.026096175832208, -2531711.537248004227877 ], [ 344220.478461240418255, -2531840.22602691873908 ], [ 342719.109373901388608, -2531668.640988366678357 ], [ 341603.806623306474648, -2531411.263430537190288 ], [ 340745.881430541339796, -2530767.819535962305963 ], [ 340702.985170902800746, -2530253.064420303795487 ], [ 340960.362728732521646, -2528451.421515495982021 ], [ 342504.628075709799305, -2526177.919754668138921 ], [ 341732.495402221218683, -2525791.853417923673987 ], [ 340831.673949817370158, -2525448.683340816758573 ], [ 340316.918834158452228, -2525191.305782989133149 ], [ 339501.889901031274348, -2524161.79555166978389 ], [ 339244.51234320178628, -2523775.729214923921973 ], [ 337185.491880565474275, -2522917.804022160358727 ], [ 333968.272407695825677, -2522317.256387224420905 ], [ 333496.413551675039344, -2521116.161117353476584 ], [ 334096.961186610686127, -2519228.725693269167095 ], [ 336113.08538960875012, -2517598.667827015276998 ], [ 338686.860967904387508, -2515453.854845101945102 ], [ 338386.587150436884258, -2513695.108199934940785 ], [ 337914.728294415341225, -2512708.494228252675384 ], [ 338558.172188989876304, -2511335.813919829204679 ], [ 340188.230055243591778, -2510434.992467426229268 ], [ 342461.731816071609501, -2509491.274755383841693 ], [ 344392.063499793061055, -2509062.312159000895917 ], [ 347008.735337726655416, -2509791.548572851810604 ], [ 348081.141828683495987, -2508719.142081894911826 ], [ 349196.444579278526362, -2508676.245822258293629 ], [ 350569.124887702404521, -2508719.142081893980503 ], [ 351255.465041914838366, -2508633.349562618881464 ], [ 351727.323897935566492, -2508676.245822257827967 ], [ 352242.079013594950084, -2509834.444832491222769 ], [ 355073.23214972007554, -2509963.133611405733973 ], [ 356831.978794888767879, -2510520.784986703190953 ], [ 358462.036661142774392, -2509276.793457193765789 ], [ 359834.716969566827174, -2508890.727120447903872 ], [ 359277.065594269603025, -2507775.424369854852557 ], [ 359791.820709928811993, -2506488.536580706480891 ], [ 361207.397277991229203, -2505834.368621222209185 ], [ 362236.907509309705347, -2505426.85415465850383 ], [ 364746.33869814791251, -2505072.96001264359802 ], [ 365754.400799647031818, -2504257.93107951618731 ], [ 366526.533473135612439, -2503828.968483132775873 ], [ 367791.97313246462727, -2503357.109627113677561 ], [ 368842.931493601703551, -2502627.873213262297213 ], [ 369636.512296909582801, -2501405.329813573043793 ], [ 370730.366917685372755, -2499088.931793107185513 ], [ 372725.042990864487365, -2498509.832287990488112 ], [ 374011.930780011985917, -2498166.662210883107036 ], [ 374239.982093739090487, -2498058.080416915006936 ], [ 374336.834590945451055, -2498251.639156226534396 ], [ 375783.629561081645079, -2500945.671169582754374 ], [ 377180.535049489000812, -2502991.139920464716852 ], [ 377779.208830235118512, -2503789.371628126595169 ], [ 379625.119654202426318, -2504288.266445416491479 ], [ 381520.919959897990339, -2504437.934890603180975 ], [ 382917.825448305695318, -2505236.16659826412797 ], [ 384115.173009797581472, -2505984.508824197109789 ], [ 384065.28352806851035, -2507331.524830874986947 ], [ 384813.62575400120113, -2508753.375060146208853 ], [ 385636.802202527236659, -2510100.391066825948656 ], [ 386684.481318832491525, -2511397.517591775860637 ], [ 387258.210358714219183, -2511597.075518691446632 ], [ 387657.326212545100134, -2512719.588857591152191 ], [ 389453.347554783220403, -2513393.096860930323601 ], [ 390126.855558122741058, -2512669.699375862255692 ], [ 390476.081930224318057, -2512295.528262896928936 ], [ 391997.711122954264283, -2511671.909741285722703 ], [ 392247.158531598513946, -2510798.843811032362282 ], [ 391947.821641225309577, -2510075.446325963363051 ], [ 392222.213790733891074, -2509751.164694725070149 ], [ 393444.5060930904001, -2509327.104100030846894 ], [ 394442.295727667049505, -2509327.10410002944991 ], [ 395215.582694463664666, -2508753.375060148071498 ], [ 395589.753807430155575, -2508279.42498372355476 ], [ 396537.653960278083105, -2507655.806462112348527 ], [ 397834.780485227878671, -2506932.408977046143264 ], [ 398570.966795131738763, -2507101.664669007062912 ], [ 399792.924053842260037, -2507942.661746895872056 ], [ 399901.200612368062139, -2508269.314060967415571 ], [ 399705.636050059110858, -2508578.761874097399414 ], [ 399605.857086601841729, -2509626.440990404225886 ], [ 399755.525531788531225, -2511572.130777828861028 ], [ 399306.520196228986606, -2513368.152120066806674 ], [ 398383.564784245099872, -2514340.997013777028769 ], [ 396886.880332380125765, -2515912.515688236802816 ], [ 396787.101368922158144, -2517334.365917508956045 ], [ 397784.891003499273211, -2518556.658219865523279 ], [ 398408.509525109722745, -2518406.989774678833783 ], [ 399481.133382280066144, -2518431.934515545144677 ], [ 400728.370425500441343, -2518955.774073694832623 ], [ 401376.933687975164503, -2518831.05036937398836 ], [ 403222.84451194270514, -2518282.266070357523859 ], [ 404295.468369112059008, -2517933.039698254317045 ], [ 404819.307927265414037, -2517833.26073479745537 ], [ 406116.434220982948318, -2517982.928764825221151 ], [ 408012.234757911064662, -2519130.387259748298675 ], [ 407214.003050249593798, -2520103.232153459917754 ], [ 406615.329269503476098, -2520701.905934204813093 ], [ 406315.992379130679183, -2521699.695568783208728 ], [ 406615.329269503767136, -2522073.866681748535484 ], [ 407912.455794453562703, -2522273.42460866458714 ], [ 409883.090322742296848, -2521774.529791377484798 ], [ 410107.59299052215647, -2521550.027123595587909 ], [ 410731.211512132489588, -2521475.192901003174484 ], [ 411404.719515472010244, -2521624.86134618986398 ], [ 411803.835369302425534, -2521225.74549235869199 ], [ 412502.288113506336231, -2520826.62963852705434 ], [ 413200.740857710130513, -2520726.850675070192665 ], [ 413974.027824507211335, -2520502.348007292021066 ], [ 414423.033160066814162, -2520327.734821239951998 ], [ 414996.762199948250782, -2520128.176894325297326 ], [ 415844.883389338618144, -2520976.29808371514082 ], [ 416119.275538847141434, -2521649.80608705477789 ], [ 416219.054502304759808, -2522273.424608663655818 ], [ 416717.949319593433756, -2523196.380020649172366 ], [ 417316.623100339260418, -2523720.219578801188618 ], [ 418464.081180102191865, -2523894.832764851395041 ], [ 419611.539259865996428, -2524144.280173496343195 ], [ 419960.765631967864465, -2524418.672323006205261 ], [ 420210.213040611939505, -2524792.843435971066356 ], [ 419985.710372832196299, -2525491.296180174686015 ], [ 420359.881485798163339, -2525915.356774869840592 ], [ 420418.189146014337894, -2525875.277578017674387 ] ] ] } } +] +} diff --git a/book/tutorials/SlideRule_applications/SlideRule_applications.ipynb b/book/tutorials/SlideRule_applications/SlideRule_applications.ipynb new file mode 100644 index 0000000..acc4f69 --- /dev/null +++ b/book/tutorials/SlideRule_applications/SlideRule_applications.ipynb @@ -0,0 +1,1243 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# CryoCloud Tutorials: SlideRule\n", + "\n", + "Tutorial Leads: [Scott Henderson](mailto:scottyh@uw.edu) and [Tyler Sutterley](mailto:tsutterl@uw.edu)\n", + "\n", + "```{admonition}Learning Objectives\n", + "- How to use Sliderule software for scalable ICESat-2 data access & on-demand processing\n", + "- Integrating ICESat-2 data with other datasets (such as raster DEMs)\n", + "- Visualizing ICESat-2 elevations with interactive maps and matplotlib figures\n", + "```\n", + "\n", + "### SlideRule Introduction\n", + "\n", + "SlideRule is a collaborative effort between NASA Goddard Space Flight Center (GSFC) and the University of Washington. It is an on-demand science data processing service that runs on Amazon Web Services (AWS) and responds to REST API calls to process and return science results. This _science data as a service_ model is a new way for researchers to work and analyze data. SlideRule was designed to enable researchers to have low-latency access to custom-generated, high-level data products.\n", + "\n", + "SlideRule users provide specific parameters at the time of the request to compute products that fit their science needs. SlideRule then uses cloud-optimized versions of computational algorithms and dynamic scaling of the cluster to process data efficiently. All data is then returned to the user as a `geopandas` `GeoDataFrame`.\n", + "\n", + "SlideRule has access to ICESat-2, GEDI, Landsat, ArcticDEM, REMA, and other datasets stored in s3. The SlideRule Python client is organized into the following submodules, each with a specific functionality:\n", + "\n", + "* `sliderule`: the core module\n", + "* `earthdata` :functions that access CMR (NASA's Common Metadata Repository), CMR-STAC, and TNM (The National Map, for the 3DEP data hosted by USGS)\n", + "* `h5`: APIs for directly reading HDF5 and NetCDF4 data using `h5coro`\n", + "* `raster`: APIs for sampling supported raster datasets\n", + "* `icesat2`: APIs for processing ICESat-2 data\n", + "* `gedi`: APIs for processing GEDI data\n", + "* `io`: functions for reading and writing local files with SlideRule results\n", + "* `ipysliderule`: functions for building interactive Jupyter notebooks that interface to SlideRule\n", + "\n", + "[Documentation for using SlideRule](https://slideruleearth.io/web/rtd/) is available from the [project website](https://slideruleearth.io/web/) \n", + "\n", + "\n", + "```{admonition}Quick links\n", + "* Website: https://slideruleearth.io\n", + "* Documentation: https://slideruleearth.io/web/rtd\n", + "* Web Demo: https://demo.slideruleearth.io\n", + "* GitHub Repository: https://github.com/ICESat2-SlideRule/sliderule\n", + "* Python Examples GitHub Repository: https://github.com/ICESat2-SlideRule/sliderule-python\n", + "```\n", + "\n", + "\n", + "#### **Q: What is ICESat-2?**\n", + "ICESat-2 is a spaceborne _laser altimeter_ that measures the surface topography of the Earth. ICESat-2 emits six 532nm laser beams which reflect off the Earth's surface approximately every 70cm _along-track_. \n", + "\n", + "#### **Q: Where is ICESat-2 Data Located**\n", + "All ICESat-2 data is hosted by the NASA Snow and Ice Distributed Active Archive Centers (DAAC) at the National Snow and Ice Data Center (NSIDC). Most of the ICESat-2 data is additionally hosted on AWS s3 buckets in `us-west-2`, which are accessible through NASA Earthdata cloud.\n", + "\n", + "#### **Q: What does the SlideRule ICESat-2 API actually do?**\n", + "Along with data access and subsetting, SlideRule can create a simplified version of the [ICESat-2 land ice height (ATL06)](https://nsidc.org/data/atl06) product that can be adjusted to suit different needs. SlideRule processes the [ICESat-2 geolocated photon height (ATL03)](https://nsidc.org/data/atl03) data products into _along-track_ segments of surface elevation. SlideRule let's you create customized ICESat-2 segment heights _directly_ from the photon height data anywhere on the globe, _on-demand_ and quickly.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# install the latest version of sliderule\n", + "%pip install sliderule==4.0.5" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import io\n", + "import logging, warnings\n", + "import geopandas as gpd\n", + "import sliderule.h5\n", + "import sliderule.icesat2\n", + "import sliderule.io\n", + "import sliderule.ipysliderule\n", + "import matplotlib.pyplot as plt\n", + "import shapely.geometry\n", + "import owslib.wms" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Start by initiating SlideRule\n", + "- Sets the URL for accessing the SlideRule service\n", + "- Builds a table of servers available for processing data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# set the url for the sliderule service\n", + "# set the logging level\n", + "sliderule.icesat2.init(\"slideruleearth.io\", loglevel=logging.WARNING)\n", + "# turn off warnings for tutorial\n", + "warnings.filterwarnings('ignore')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Set options for making science data processing requests to SlideRule\n", + "\n", + "We'll start with a basic example where we can vary the length of each segment for a SlideRule ICESat-2 `atl06` request. We will get the average height of the surface by fitting a sloping segment to photons _along-track_. We will use all photons that lie within a _window_ of the fit surface. This process can capture the effects of small-scale surface topography when appropriate segment length scales are chosen. \n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
ParameterDefinition
\n", + " Surface Type\n", + " \n", + " Sets the parameters for ATL03 photon confidence classification\n", + "
    \n", + "
  1. land
  2. \n", + "
  3. ocean
  4. \n", + "
  5. sea ice
  6. \n", + "
  7. land ice
  8. \n", + "
  9. inland water
  10. \n", + "
\n", + "
\n", + " Length\n", + " \n", + " How long each segment should be in meters\n", + "
" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# display widgets for setting SlideRule parameters\n", + "SRwidgets = sliderule.ipysliderule.widgets()\n", + "SRwidgets.set_atl06_defaults()\n", + "SRwidgets.VBox(SRwidgets.atl06(display='basic'))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Select regions of interest for submitting to SlideRule\n", + "\n", + "Create polygons or bounding boxes for our regions of interest. This map is also our viewer for inspecting our SlideRule ICESat-2 data returns.\n", + "\n", + "Interactive maps within the SlideRule python API are build upon [ipyleaflet](https://ipyleaflet.readthedocs.io), which are Jupyter and python bindings for the fantastic [Leaflet](https://leafletjs.com/) javascript library." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# create ipyleaflet map in specified projection\n", + "m1 = sliderule.ipysliderule.leaflet('Global', zoom=10,\n", + " full_screen_control=True)\n", + "# read and add region of interest\n", + "reg = gpd.read_file('grandmesa.geojson')\n", + "m1.add_region(sliderule.io.from_geodataframe(reg))\n", + "m1.map" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Build and transmit requests to SlideRule\n", + "\n", + "- SlideRule will query the [NASA Common Metadata Repository (CMR)](https://cmr.earthdata.nasa.gov/) for ATL03 data within our region of interest\n", + "- When using the `icesat2` asset, the ICESat-2 ATL03 data are then accessed from the NSIDC AWS s3 bucket in `us-west-2`\n", + "- The ATL03 granules is spatially subset within SlideRule to our exact region of interest\n", + "- SlideRule then uses our specified parameters to calculate average height segments from the ATL03 data in parallel\n", + "- The completed data is streamed concurrently back and combined into a `geopandas` `GeoDataFrame` within the Python client" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%time\n", + "# build sliderule parameters using latest values from widget\n", + "parms = SRwidgets.build_atl06()\n", + "\n", + "# clear existing geodataframe results\n", + "elevations = [sliderule.emptyframe()]\n", + "\n", + "# for each region of interest\n", + "for poly in m1.regions:\n", + " # add polygon from map to sliderule parameters\n", + " parms[\"poly\"] = poly\n", + " # make the request to the SlideRule (ATL06-SR) endpoint\n", + " # and pass it the request parameters to request ATL06 Data\n", + " elevations.append(sliderule.icesat2.atl06p(parms))\n", + "# concatenate the results into a single geodataframe\n", + "gdf1 = gpd.pd.concat(elevations)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Review GeoDataFrame output\n", + "Here, we will inspect the columns, number of returns and returns at the top of the GeoDataFrame using `head()`. \n", + "\n", + "See the [SlideRule ICESat-2 Elevations documentation](https://slideruleearth.io/web/rtd/user_guide/ICESat-2.html#elevations-atl06) for more descriptions of each column." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "print(f'Returned {gdf1.shape[0]} records')\n", + "gdf1.head()" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "tags": [] + }, + "source": [ + "#### Add GeoDataFrame to map\n", + "\n", + "Choose a variable for visualization on the interactive leaflet map. The data can be plotted in any available [matplotlib colormap](https://matplotlib.org/stable/tutorials/colors/colormaps.html). SlideRule as a default limits the number of points in the plot to ensure the stability of the leaflet map.\n", + "\n", + "Here, we're going to visualize the surface elevation field `h_mean`. This is the average elevation of the ICESat-2 geolocated photons that are located within a vertical window (`w_surface_window_final`) around the surface.\n", + "\n", + "You can _hover_ over individual data points to display a _tooltip_ containing the data values at that location.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "SRwidgets.VBox([\n", + " SRwidgets.variable,\n", + " SRwidgets.cmap,\n", + " SRwidgets.reverse,\n", + "])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%matplotlib inline\n", + "# ATL06-SR fields for hover tooltip\n", + "fields = m1.default_atl06_fields()\n", + "gdf1.leaflet.GeoData(m1.map, column_name=SRwidgets.column_name, cmap=SRwidgets.colormap,\n", + " max_plot_points=10000, tooltip=True, colorbar=True, fields=fields)\n", + "# install handlers and callbacks\n", + "gdf1.leaflet.add_selected_callback(SRwidgets.atl06_click_handler)\n", + "m1.add_region_callback(gdf1.leaflet.handle_region)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Create plots for a single track\n", + "SlideRule ICESat-2 transect plot types:\n", + "- `cycles`: Will plot all available cycles of data returned by SlideRule for a single RGT and ground track\n", + "- `scatter`: Will plot data returned by SlideRule for a single RGT, ground track and cycle\n", + "\n", + "Note: the cycles plots should only be used in regions with [repeat Reference Ground Track (RGT) pointing](https://icesat-2.gsfc.nasa.gov/science/specs)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# set defaults for along-track plot\n", + "SRwidgets.rgt.value = '737'\n", + "SRwidgets.ground_track.value = 'gt3r'\n", + "SRwidgets.cycle.value = '20'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To select an alternative track to plot, you can _click_ on one of the data points in the leaflet map. This will auto-populate the RGT, Ground Track, and Cycle fields below.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# along-track plot parameters\n", + "SRwidgets.VBox([\n", + " SRwidgets.plot_kind,\n", + " SRwidgets.rgt,\n", + " SRwidgets.ground_track,\n", + " SRwidgets.cycle,\n", + "])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%matplotlib inline\n", + "# default is to skip cycles with significant off-pointing\n", + "gdf1.icesat2.plot(kind=SRwidgets.plot_kind.value, cycle_start=3,\n", + " legend=True, legend_frameon=False, **SRwidgets.plot_kwargs)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "```{tip}\n", + "Can you identify the plateau at Grand Mesa?\n", + "```" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Advanced ICESat-2 SlideRule Example: Polar Altimetry and Raster Sampling\n", + "\n", + "SlideRule also can use different sources for photon classification before calculating the average segment height. \n", + "This is useful for example, in cases where there may be a vegetated canopy affecting the spread of the photon returns.\n", + "- ATL03 photon confidence values, based on algorithm-specific classification types for land, ocean, sea-ice, land-ice, or inland water\n", + "- [ATL08 Land and Vegetation Height product](https://nsidc.org/data/atl08) photon classification\n", + "- Experimental [YAPC (Yet Another Photon Classification)](https://github.com/tsutterley/yapc) photon-density-based classification\n", + "\n", + "For this example, we will also use SlideRule to sample a digital elevation model (DEM) at the locations of our ICESat-2 elevations. For a detailed discussion of the raster sampling capability see the [GeoRaster page](https://slideruleearth.io/web/rtd/user_guide/GeoRaster.html) and the [sampling parameters](https://slideruleearth.io/web/rtd/user_guide/SlideRule.html#raster-sampling) in the SlideRule documentation.\n", + "\n", + "```attention\n", + "SlideRule does not currently include first-photon bias or transmit-pulse shape bias corrections in the fit heights.\n", + "```" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Leaflet Basemaps and Layers\n", + "\n", + "There are 3 projections available within SlideRule for mapping ([Global](https://epsg.io/3857), [North](https://epsg.io/5936) and [South](https://epsg.io/3031)). There are also contextual layers available for each projection. Most [xyzservice providers](https://xyzservices.readthedocs.io/en/stable/introduction.html) can be added as contextual layers to the global Web Mercator maps.\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Global (Web Mercator, EPSG:3857)North (Alaska Polar Stereographic, EPSG:5936)South (Antarctic Polar Stereographic, EPSG:3031)
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
\n", + "\n", + "Here, we will use the visualize data at Fenris Glacier in Greenland using the Northern Hemisphere polar stereographic projection.\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# create ipyleaflet map in specified projection\n", + "m2 = sliderule.ipysliderule.leaflet('North',\n", + " center=(66.55, -36.75), zoom=8)\n", + "# add ArcticDEM Hillshade layer\n", + "m2.add_layer(\n", + " layers='ArcticDEM',\n", + " rendering_rule={'rasterFunction': 'Hillshade Gray'}\n", + ")\n", + "# read and add region of interest\n", + "reg = gpd.read_file('Fenris_Gletscher_PS_v1.4.2.geojson')\n", + "m2.add_region(sliderule.io.from_geodataframe(reg))\n", + "m2.map" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Update options for making science data processing requests to SlideRule\n", + "\n", + "Here we'll be able to adjust all the potential parameters for making a SlideRule ICESat-2 `atl06` request.\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
ParameterDefinition
\n", + " Classification\n", + " \n", + " Photon classification types to use in signal selection\n", + "
    \n", + "
  • atl03: signal confidence
  • \n", + "
  • quality: signal quality flag
  • \n", + "
  • atl08: classification from the land and vegetation algorithm
  • \n", + "
  • yapc: confidence determined using a clustering algorithm
  • \n", + "
\n", + "
\n", + " Surface Type\n", + " \n", + " Sets the parameters for ATL03 photon confidence classification\n", + "
    \n", + "
  1. land
  2. \n", + "
  3. ocean
  4. \n", + "
  5. sea ice
  6. \n", + "
  7. land ice
  8. \n", + "
  9. inland water
  10. \n", + "
\n", + "
\n", + " Confidence\n", + " \n", + " Numerical assessment of the signal likelihood of each photon\n", + "
    \n", + "
  1. photon is background
  2. \n", + "
  3. photon is background within buffer of known surface
  4. \n", + "
  5. low confidence of photon being signal
  6. \n", + "
  7. medium confidence of photon being signal
  8. \n", + "
  9. high confidence of photon being signal
  10. \n", + "
\n", + "
\n", + " Quality\n", + " \n", + " ATL03 instrumental photon quality \n", + "
    \n", + "
  1. photon is nominal
  2. \n", + "
  3. photon is possible afterpulse
  4. \n", + "
  5. photon is possible impulse response
  6. \n", + "
  7. photon is possible transmit echo path (TEP)
  8. \n", + "
\n", + "
\n", + " Land class\n", + " \n", + " ATL08 land and vegetation classification\n", + "
    \n", + "
  1. photon is noise or background
  2. \n", + "
  3. photon is ground
  4. \n", + "
  5. photon is canopy
  6. \n", + "
  7. photon is top of canopy
  8. \n", + "
  9. photon is not classified
  10. \n", + "
\n", + "
\n", + " YAPC kNN\n", + " \n", + " Number of nearest neighbors to use in classification algorithm\n", + "
    \n", + "
  1. Automatic selection
  2. \n", + "
\n", + "
\n", + " YAPC h window\n", + " \n", + " Window height for filtering neighbors in classification algorithm\n", + "
\n", + " YAPC x window\n", + " \n", + " Window width for filtering neighbors in classification algorithm\n", + "
\n", + " YAPC minimum PE\n", + " \n", + " Minimum number of photon events needed to create a YAPC score in classification algorithm\n", + "
\n", + " YAPC score\n", + " \n", + " Minimum YAPC score for photons to be valid\n", + "
\n", + " Length\n", + " \n", + " How long each segment should be in meters\n", + "
\n", + " Step\n", + " \n", + " Distance between successive segments in meters\n", + "
\n", + " PE Count\n", + " \n", + " Minimum number of photon events needed within a segment to be valid\n", + "
\n", + " Window\n", + " \n", + " Minimum height of the final surface window used for selecting photons\n", + "
\n", + " Sigma\n", + " \n", + " Maximum allowed dispersion around the median height in meters\n", + "
" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# display widgets for setting SlideRule parameters\n", + "SRwidgets.set_atl06_defaults()\n", + "SRwidgets.classification.value = ['atl03']\n", + "SRwidgets.surface_type.value = 'Land ice'\n", + "SRwidgets.VBox(SRwidgets.atl06())" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%time\n", + "# build sliderule parameters using latest values from widget\n", + "parms = SRwidgets.build_atl06()\n", + "# reduce data to a single cycle\n", + "parms[\"cycle\"] = 19\n", + "# additionally sample ArcticDEM mosaic at ATL06-SR points\n", + "parms[\"samples\"] = dict(mosaic= {\n", + " \"asset\": \"arcticdem-mosaic\",\n", + " \"radius\": 10.0,\n", + " \"zonal_stats\": True\n", + "})\n", + "\n", + "# clear existing geodataframe results\n", + "elevations = [sliderule.emptyframe()]\n", + "\n", + "# for each region of interest\n", + "for poly in m2.regions:\n", + " # add polygon from map to sliderule parameters\n", + " parms[\"poly\"] = poly\n", + " # make the request to the SlideRule (ATL06-SR) endpoint\n", + " # and pass it the request parameters to request ATL06 Data\n", + " elevations.append(sliderule.icesat2.atl06p(parms))\n", + "# concatenate the results into a single geodataframe\n", + "gdf2 = gpd.pd.concat(elevations)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Add GeoDataFrame to polar stereographic map" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%matplotlib inline\n", + "# ATL06-SR fields for hover tooltip\n", + "fields = m2.default_atl06_fields()\n", + "gdf2.leaflet.GeoData(m2.map, column_name=SRwidgets.column_name, cmap=SRwidgets.colormap,\n", + " max_plot_points=10000, tooltip=True, colorbar=True, fields=fields)\n", + "# install handlers and callbacks\n", + "gdf2.leaflet.add_selected_callback(SRwidgets.atl06_click_handler)\n", + "m2.add_region_callback(gdf2.leaflet.handle_region)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Create a static map with SlideRule returns\n", + "\n", + "Here, we're going to create a static map of Fenris Glacier in Greenland with our SlideRule returns from ICESat-2 and ArcticDEM. We're going to plot the data in a different Polar Stereographic projection (NSIDC Sea Ice Polar Stereographic North). `geopandas` `GeoDataFrames` can be transformed to different [Coordinate Reference Systems (CRS)](http://geopandas.org/projections.html) using the `to_crs()` function. \n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "def plot_arcticdem(ax=None, **kwargs):\n", + " \"\"\"Plot ArcticDEM layer as a basemap\n", + "\n", + " Parameters\n", + " ----------\n", + " ax: obj, default None\n", + " Figure axis\n", + " kwargs: dict, default {}\n", + " Additional keyword arguments for ``wms.getmap``\n", + " \"\"\"\n", + " # set default keyword arguments\n", + " kwargs.setdefault('layers', '0')\n", + " kwargs.setdefault('format', 'image/png')\n", + " kwargs.setdefault('srs', 'EPSG:3413')\n", + " # create figure axis if non-existent\n", + " if (ax is None):\n", + " _, ax = plt.subplots()\n", + " # get the pixel bounds and resolution of the map\n", + " width = int(ax.get_window_extent().width)\n", + " height = int(ax.get_window_extent().height)\n", + " # calculate the size of the map in pixels\n", + " kwargs.setdefault('size', [width, height])\n", + " # calculate the bounding box of the map in projected coordinates\n", + " bbox = [None]*4\n", + " bbox[0], bbox[2] = ax.get_xbound()\n", + " bbox[1], bbox[3] = ax.get_ybound()\n", + " kwargs.setdefault('bbox', bbox)\n", + " # url of ArcticDEM WMS\n", + " url = ('http://elevation2.arcgis.com/arcgis/services/Polar/'\n", + " 'ArcticDEM/ImageServer/WMSserver')\n", + " wms = owslib.wms.WebMapService(url=url, version='1.1.1')\n", + " basemap = wms.getmap(**kwargs)\n", + " # read WMS layer and plot\n", + " img = plt.imread(io.BytesIO(basemap.read()))\n", + " ax.imshow(img, extent=[bbox[0],bbox[2],bbox[1],bbox[3]])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%matplotlib inline\n", + "# create polar stereographic plot of ATL06-SR data\n", + "# EPSG codes are a simple way to define many coordinate reference systems\n", + "crs = 'EPSG:3413'\n", + "# create figure axis\n", + "fig,ax1 = plt.subplots(num=1, ncols=3, sharex=True, sharey=True, figsize=(13,3.5))\n", + "ax1[0].set_aspect('equal', adjustable='box')\n", + "\n", + "# calculate normalization for height plots\n", + "vmin, vmax = gdf2['h_mean'].quantile((0.02, 0.98)).values\n", + "\n", + "# calculate difference between sliderule and ArcticDEM mosaic heights\n", + "gdf2['difference'] = gdf2['h_mean'] - gdf2['mosaic.mean']\n", + "filtered = gdf2[gdf2['difference'].abs() < 100].to_crs(crs)\n", + "\n", + "# plot ATL06-SR elevation\n", + "ax1[0].set_title('ATL06-SR')\n", + "label = f'Elevation [m]'\n", + "sc = filtered.plot(ax=ax1[0], zorder=1, markersize=0.5,\n", + " column='h_mean', cmap='plasma_r', vmin=vmin, vmax=vmax,\n", + " legend=True, legend_kwds=dict(label=label, shrink=0.90, extend='both'))\n", + "sc.set_rasterized(True)\n", + "\n", + "# plot ArcticDEM mosaic elevation\n", + "ax1[1].set_title('ArcticDEM Mosaic')\n", + "label = f'Elevation [m]'\n", + "sc = filtered.plot(ax=ax1[1], zorder=1, markersize=0.5,\n", + " column='mosaic.mean', cmap='plasma_r', vmin=vmin, vmax=vmax,\n", + " legend=True, legend_kwds=dict(label=label, shrink=0.90, extend='both'))\n", + "sc.set_rasterized(True)\n", + "\n", + "# plot difference between heights\n", + "ax1[2].set_title('ATL06-SR - ArcticDEM')\n", + "label = f'Elevation Difference [m]'\n", + "sc = filtered.plot(ax=ax1[2], zorder=1, markersize=0.5,\n", + " column='difference', cmap='coolwarm', vmin=-30, vmax=30,\n", + " legend=True, legend_kwds=dict(label=label, shrink=0.90, extend='both'))\n", + "sc.set_rasterized(True)\n", + "\n", + "# convert regions into a geoseries object\n", + "regions = []\n", + "for poly in m2.regions:\n", + " lon,lat = sliderule.io.from_region(poly)\n", + " regions.append(shapely.geometry.Polygon(zip(lon,lat)))\n", + "gs = gpd.GeoSeries(regions, crs='EPSG:4326').to_crs(crs)\n", + "\n", + "# add background and labels\n", + "for ax in ax1:\n", + " # plot each region of interest\n", + " gs.plot(ax=ax, facecolor='none', edgecolor='black', lw=3)\n", + " # plot ArcticDEM as basemap\n", + " plot_arcticdem(ax, srs=crs)\n", + " # add x label\n", + " ax.set_xlabel('{0} [{1}]'.format('Easting','m'))\n", + "# add y label\n", + "ax1[0].set_ylabel('{0} [{1}]'.format('Northing','m'))\n", + "\n", + "# adjust subplot and show\n", + "fig.subplots_adjust(left=0.06, right=0.98, bottom=0.08, top=0.98, wspace=0.1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "```{tip}\n", + "Compared with the ArcticDEM mosaic, ICESat-2 is showing much lower elevations for large parts of this glacier. Any ideas on why?\n", + "```" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Advanced ICESat-2 SlideRule Example: PhoREAL Vegetation Metrics\n", + "\n", + "For this example, we will also use SlideRule to produce canopy metrics using the ATL08 PhoREAL API. The name comes from the University of Texas team that developed PhoREAL and collaborated with us to get their algorithms into SlideRule. The PhoREAL functionality within SlideRule uses the land surface classifications for each photon provided by the [ICESat-2 Land and Vegetation Height Product (ATL08)](https://nsidc.org/data/atl08). Similar to the SlideRule elevation functionality, these metrics can be calculated at different lengths scales and with different options for classification. The set of parameters specific to the ATL08 processing are provided under the `phoreal` key.\n", + "\n", + "Documentation for this functionality can be found in the [API reference](https://slideruleearth.io/web/rtd/api_reference/icesat2.html#atl08p). " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# create ipyleaflet map in specified projection\n", + "m3 = sliderule.ipysliderule.leaflet('Global', zoom=10,\n", + " full_screen_control=True)\n", + "# add ESRI imagery layer\n", + "m3.add_layer(layers=['ESRI imagery'])\n", + "# read and add region of interest\n", + "reg = gpd.read_file('grandmesa.geojson')\n", + "m3.add_region(sliderule.io.from_geodataframe(reg))\n", + "m3.map" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Set options for making PhoREAL science data processing requests to SlideRule\n", + "\n", + "Here, we'll be able to adjust all the potential parameters for making a SlideRule ICESat-2 `atl08` request.\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
ParameterDefinition
\n", + " Classification\n", + " \n", + " Photon classification types to use in signal selection\n", + "
    \n", + "
  • atl03: signal confidence
  • \n", + "
  • quality: signal quality flag
  • \n", + "
  • atl08: classification from the land and vegetation algorithm
  • \n", + "
  • yapc: confidence determined using a clustering algorithm
  • \n", + "
\n", + "
\n", + " Land class\n", + " \n", + " ATL08 land and vegetation classification\n", + "
    \n", + "
  1. photon is noise or background
  2. \n", + "
  3. photon is ground
  4. \n", + "
  5. photon is canopy
  6. \n", + "
  7. photon is top of canopy
  8. \n", + "
  9. photon is not classified
  10. \n", + "
\n", + "
\n", + " PhoREAL Bin Size\n", + " \n", + " Size of the vertical histogram bin in meters\n", + "
\n", + " PhoREAL Geolocation\n", + " \n", + " Method for calculating segment geolocation variables\n", + "
    \n", + "
  • mean: average value across all photons in the segment
  • \n", + "
  • median: median value across all photons in the segment
  • \n", + "
  • center: center of first and last photons in the segment
  • \n", + "
\n", + "
\n", + " PhoREAL Use abs h\n", + " \n", + " Use absolute photon event elevations rather than normalized heights\n", + "
\n", + " PhoREAL ABoVE\n", + " \n", + " Use the ABoVE photon classifier\n", + "
\n", + " PhoREAL Waveform\n", + " \n", + " Return the photon height histograms\n", + "
\n", + " Length\n", + " \n", + " How long each segment should be in meters\n", + "
\n", + " Step\n", + " \n", + " Distance between successive segments in meters\n", + "
" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# display widgets for setting SlideRule parameters\n", + "SRwidgets.set_atl08_defaults()\n", + "SRwidgets.VBox(SRwidgets.atl08())" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%time\n", + "# build sliderule parameters using latest values from widget\n", + "parms = SRwidgets.build_atl08()\n", + "# reduce data to a single cycle\n", + "parms[\"cycle\"] = 16\n", + "\n", + "# clear existing geodataframe results\n", + "elevations = [sliderule.emptyframe()]\n", + "\n", + "# for each region of interest\n", + "for poly in m3.regions:\n", + " # add polygon from map to sliderule parameters\n", + " parms[\"poly\"] = poly\n", + " # make the request to the SlideRule (ATL08-SR) endpoint\n", + " # and pass it the request parameters to request ATL08 vegetation metrics\n", + " elevations.append(sliderule.icesat2.atl08p(parms, keep_id=True))\n", + "# concatenate the results into a single geodataframe\n", + "gdf3 = gpd.pd.concat(elevations)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Review GeoDataFrame output\n", + "There are different columns for the `atl08` request, which add the vegetation metrics. Here, we will inspect the top of the ATL08 GeoDataFrame using `head()`.\n", + "\n", + "See the [SlideRule ICESat-2 Vegetation Metrics documentation](https://slideruleearth.io/web/rtd/user_guide/ICESat-2.html#vegetation-metrics-atl08) for descriptions of each column" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "print(f'Returned {gdf3.shape[0]} records')\n", + "gdf3.head()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Add Vegetation Metrics GeoDataFrame to map\n", + "\n", + "Here, we're going to visualize the canopy height `h_canopy`. This is the 98th percentile of the histogram of canopy photons that are located above the Earth's surface." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "SRwidgets.VBox([\n", + " SRwidgets.variable,\n", + " SRwidgets.cmap,\n", + " SRwidgets.reverse,\n", + "])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%matplotlib inline\n", + "# ATL06-SR fields for hover tooltip\n", + "fields = m3.default_atl08_fields()\n", + "gdf3.leaflet.GeoData(m3.map, column_name=SRwidgets.column_name, cmap=SRwidgets.colormap,\n", + " max_plot_points=10000, tooltip=True, tooltip_width='280px', colorbar=True,\n", + " fields=fields)\n", + "# install handlers and callbacks\n", + "gdf3.leaflet.add_selected_callback(SRwidgets.atl06_click_handler)\n", + "m3.add_region_callback(gdf3.leaflet.handle_region)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "```{tip}\n", + "How does the canopy height compare with the visual imagery at Grand Mesa? \n", + "```" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Advanced ICESat-2 SlideRule Example: Subsetting ATL03 photon cloud data\n", + "\n", + "SlideRule can also be used to subset ATL03 geolocated photon height products, which are returned as a geopandas GeoDataFrame at the photon rate. Documentation for this function can be found in the [API reference](https://slideruleearth.io/web/rtd/api_reference/icesat2.html#atl03sp).\n", + "\n", + "Because each granule contains so many photons, it is good practice to subset the data as much as possible by limiting the subsetting area and the number of granules to be processed. Here, we supply a GeoJSON file of Fenris Glacier for trimming the photon data. We also supply a reference ground track and cycle number to reduce the number of granules to be processed to a single file. Finally, we specify that only tracks `GT1L` and `GT1R` within the granule should be subset. This will still return hundreds of thousands of photons for the region!\n", + "\n", + "The other parameters in the request are used to specify different aspects of the ATL03 subsetting request. The surface type for photon classification (`srt`) in this case is _land ice_. This surface type parameter is used in conjunction the photon confidence level `cnf` parameter. Here, we are requesting that all classified photons for the surface type are returned." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# read Region of Interest\n", + "reg = gpd.read_file('Fenris_Gletscher_PS_v1.4.2.geojson')\n", + "region = sliderule.io.from_geodataframe(reg)\n", + "RGT = 71\n", + "cycle = 19\n", + "# only process data for GT1L and GT1R\n", + "PT = 1\n", + "\n", + "# Build ATL03 Subsetting Request Parameters\n", + "parms = {\n", + " \"poly\": region[0],\n", + " \"rgt\": RGT,\n", + " \"cycle\": cycle,\n", + " \"track\": PT,\n", + " \"srt\": sliderule.icesat2.SRT_LAND_ICE,\n", + " \"cnf\": sliderule.icesat2.CNF_BACKGROUND,\n", + " \"len\": 20.0,\n", + " \"pass_invalid\": True\n", + "}\n", + "\n", + "# Make ATL03 Subsetting Request\n", + "atl03 = sliderule.icesat2.atl03sp(parms)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Review GeoDataFrame output\n", + "The ATL03 GeoDataFrame will have variables at the photon rate. Here, we will inspect the columns and variables at the top of the ATL03 GeoDataFrame using `head()`. See the [SlideRule ICESat-2 Geolocated Photon documentation](https://slideruleearth.io/web/rtd/user_guide/ICESat-2.html#segmented-photon-data-atl03) for descriptions of each column" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "print(f'Returned {atl03.shape[0]} records')\n", + "atl03.head()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Create plot for a single track of photon heights\n", + "Here, we're going to use the same SlideRule ICESat-2 transect plot functionality as prior, but for visualizing the geolocated photons.\n", + "\n", + "- `scatter`: Will plot ATL03 data returned by SlideRule for a single RGT, ground track and cycle" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "atl03.icesat2.plot(atl03='dataframe', kind='scatter', title='ATL03 Photon Cloud',\n", + " legend=True, legend_frameon=True,\n", + " classification='atl03', segments=False,\n", + " RGT=RGT, cycle=cycle, GT=sliderule.icesat2.GT1R)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "```{tip}\n", + "A lot of these photon events are \"background\" photons, meaning that they are likely emitted from the sun and not from ICESat-2.\n", + "```" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Direct File Read Example\n", + "\n", + "SlideRule also can directly read data from HDF5 files stored in s3 using `h5coro`, a cloud-optimized HDF5 reader built by the SlideRule team. In the example below, data from the first 25 segments are read from an ATL06 granule. The results are returned in a dictionary of arrays, where each key is the name of the dataset. The entirety of a dataset can be read by setting the number of rows to `h5.ALL_ROWS`. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "resource = 'ATL06_20181017222812_02950102_006_02.h5'\n", + "beams = ['gt1l', 'gt1r', 'gt2l', 'gt2r', 'gt3l', 'gt3r']\n", + "variables = ['latitude', 'longitude']\n", + "startrow, numrows = (0, 25)\n", + "datasets = [dict(dataset=f'/{b}/land_ice_segments/{v}', startrow=startrow, numrows=numrows)\n", + " for b in beams for v in variables]\n", + "atl06 = sliderule.h5.h5p(datasets, resource, 'icesat2')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%matplotlib inline\n", + "fig, ax2 = plt.subplots(num=2, figsize=(6,6))\n", + "for b in beams:\n", + " ax2.plot(atl06[f'/{b}/land_ice_segments/longitude'],\n", + " atl06[f'/{b}/land_ice_segments/latitude'],\n", + " '.-', ms=5, lw=0, label=b)\n", + "ax2.set_title(resource)\n", + "ax2.set_xlabel('Longitude [\\u00B0]')\n", + "ax2.set_ylabel('Latitude [\\u00B0]')\n", + "lgd = ax2.legend(frameon=False)\n", + "lgd.get_frame().set_alpha(1.0)\n", + "for line in lgd.get_lines():\n", + " line.set_linewidth(6)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Private Clusters\n", + "\n", + "The SlideRule project supports the deployment of private clusters. A private cluster is a separate deployment of the public SlideRule service with the only difference being it requires authenticated access. These clusters are managed through the [**SlideRule Provisioning System**](https://ps.slideruleearth.io) and require both an account on that system along with an association with a funding organization. For more information on private clusters, please see the [users guide](https://slideruleearth.io/web/rtd/user_guide/Private-Clusters.html).\n", + "\n", + "The public SlideRule service is provisioned the exact same way as a private cluster and is managed by the SlideRule Provisioning System. Each cluster has its own subdomain and configuration. For the public cluster, the configuration specifies that no authentication is needed, and the subdomain is \"sliderule\", so access to the public cluster is at https://sliderule.slideruleearth.io. For the other clusters, access requires authentication and the subdomain is the set to the name of the organization funding the cluster. For example, the University of Washington private cluster is at https://uw.slideruleearth.io." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Summary \n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
\n", + " \n", + " \n", + " SlideRule is a cost-effective science data as a service solution that provides responsive results to users. SlideRule can enable large scale access to the NASA and other Earth science data and provide science-quality algorithms in an open and documented way. The SlideRule team strives to provide simple, well-documented APIs that are easy to install and use, as well as a web client for online demonstration. Improvements and fixes can be made quickly to limit downtime and enable new functionality. The SlideRule system is highly scalable to meet the processing demand at any given time. In addition, private clusters can be made available to users for large-scale requests. See more at slideruleearth.io.\n", + "
" + ] + } + ], + "metadata": { + "interpreter": { + "hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.12" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/book/tutorials/SlideRule_applications/grandmesa.geojson b/book/tutorials/SlideRule_applications/grandmesa.geojson new file mode 100644 index 0000000..3040374 --- /dev/null +++ b/book/tutorials/SlideRule_applications/grandmesa.geojson @@ -0,0 +1,8 @@ +{ +"type": "FeatureCollection", +"name": "grand_mesa_poly", +"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, +"features": [ +{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -108.311682565537666, 39.137576462129438 ], [ -108.341156683252237, 39.037589876133246 ], [ -108.287868638779599, 38.89051431295789 ], [ -108.207729687800509, 38.823205529198098 ], [ -108.074601643110313, 38.847513782586297 ], [ -107.985605104949812, 38.943991201101703 ], [ -107.728398587557521, 39.015109302306328 ], [ -107.787241424909936, 39.195630349659986 ], [ -108.049394800987542, 39.139504663354245 ], [ -108.172870009708575, 39.159200663961158 ], [ -108.311682565537666, 39.137576462129438 ] ] ] } } +] +}