Skip to content

Commit 7110617

Browse files
committed
Update: documentation
1 parent c0d8085 commit 7110617

File tree

1 file changed

+41
-81
lines changed

1 file changed

+41
-81
lines changed

doc/doc.ipynb

Lines changed: 41 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
" data=data.mean(dims),\n",
144144
" title=title,\n",
145145
" fn=f\"map-mean-{title}\",\n",
146-
" plot_size=(7.2, 3.6),\n",
146+
" plot_size=(9.6, 3.6),\n",
147147
" cbar_label=\"mean normalized error\",\n",
148148
" vmin=vmin,\n",
149149
" vmax=vmax,\n",
@@ -173,7 +173,7 @@
173173
" data=data.std(dims),\n",
174174
" title=title,\n",
175175
" fn=f\"map-std-{title}\",\n",
176-
" plot_size=(7.2, 3.6),\n",
176+
" plot_size=(9.6, 3.6),\n",
177177
" cbar_label=\"std. dev. normalized errors\",\n",
178178
" vmin=vmin,\n",
179179
" vmax=vmax,\n",
@@ -203,7 +203,7 @@
203203
" data=(data.max(dim=dims) - data.min(dim=dims)),\n",
204204
" title=title,\n",
205205
" fn=f\"map-range-{title}\",\n",
206-
" plot_size=(7.2, 3.6),\n",
206+
" plot_size=(9.6, 3.6),\n",
207207
" cbar_label=\"range of normalized errors\",\n",
208208
" vmin=vmin,\n",
209209
" vmax=vmax,\n",
@@ -234,7 +234,7 @@
234234
" chunks={\"time\": 12},\n",
235235
" combine=\"nested\",\n",
236236
" concat_dim=\"i\",\n",
237-
").transpose(\"time\", \"i\", \"latitude\", \"longitude\")"
237+
").transpose(\"i\", \"time\", \"latitude\", \"longitude\")"
238238
]
239239
},
240240
{
@@ -297,8 +297,8 @@
297297
"outputs": [],
298298
"source": [
299299
"def xu(ds, v, a):\n",
300-
" x = ds[v][:, 0]\n",
301-
" u = ds[a[\"uncertainty\"]][:, 0] / a.get(\"coverage\", 1.0)\n",
300+
" x = ds[v][0]\n",
301+
" u = ds[a[\"uncertainty\"]][0] / a.get(\"coverage\", 1.0)\n",
302302
" if a.get(\"relative\", False):\n",
303303
" u = u * x\n",
304304
" return x, u"
@@ -313,7 +313,7 @@
313313
"source": [
314314
"for v, a in config.items():\n",
315315
" x, u = xu(ds, v, a)\n",
316-
" res = (ds[v][:, 1:] - x) / u\n",
316+
" res = (ds[v][1:] - x) / u\n",
317317
" plot_histogram(\n",
318318
" res,\n",
319319
" title=a[\"name\"],\n",
@@ -366,7 +366,7 @@
366366
" chunks={\"lat\": 1080, \"lon\": 1080},\n",
367367
" combine=\"nested\",\n",
368368
" concat_dim=\"i\",\n",
369-
").transpose(\"time\", \"i\", \"lat\", \"lon\")"
369+
")"
370370
]
371371
},
372372
{
@@ -477,36 +477,6 @@
477477
" \"bias\": \"aph_665_bias\",\n",
478478
" \"rmsd\": \"aph_665_rmsd\",\n",
479479
" },\n",
480-
" \"atot_412\": {\n",
481-
" \"name\": \"Total absorption coefficient (412 nm)\",\n",
482-
" \"bias\": \"aph_412_bias\",\n",
483-
" \"rmsd\": \"aph_412_rmsd\",\n",
484-
" },\n",
485-
" \"atot_443\": {\n",
486-
" \"name\": \"Total absorption coefficient (443 nm)\",\n",
487-
" \"bias\": \"aph_443_bias\",\n",
488-
" \"rmsd\": \"aph_443_rmsd\",\n",
489-
" },\n",
490-
" \"atot_490\": {\n",
491-
" \"name\": \"Total absorption coefficient (490 nm)\",\n",
492-
" \"bias\": \"aph_490_bias\",\n",
493-
" \"rmsd\": \"aph_490_rmsd\",\n",
494-
" },\n",
495-
" \"atot_510\": {\n",
496-
" \"name\": \"Total absorption coefficient (510 nm)\",\n",
497-
" \"bias\": \"aph_510_bias\",\n",
498-
" \"rmsd\": \"aph_510_rmsd\",\n",
499-
" },\n",
500-
" \"atot_560\": {\n",
501-
" \"name\": \"Total absorption coefficient (560 nm)\",\n",
502-
" \"bias\": \"aph_560_bias\",\n",
503-
" \"rmsd\": \"aph_560_rmsd\",\n",
504-
" },\n",
505-
" \"atot_665\": {\n",
506-
" \"name\": \"Total absorption coefficient (665 nm)\",\n",
507-
" \"bias\": \"aph_665_bias\",\n",
508-
" \"rmsd\": \"aph_665_rmsd\",\n",
509-
" },\n",
510480
" \"kd_490\": {\n",
511481
" \"name\": \"Attenuation coefficent (490 nm)\",\n",
512482
" \"bias\": \"kd_490_bias\",\n",
@@ -546,7 +516,7 @@
546516
"source": [
547517
"for v, a in config.items():\n",
548518
" x, u = xu(ds, v, a)\n",
549-
" res = (ds[v][0, 1:] - x) / u\n",
519+
" res = (ds[v][1:, 0] - x) / u\n",
550520
" plot_histogram(\n",
551521
" res,\n",
552522
" title=a[\"name\"],\n",
@@ -614,7 +584,7 @@
614584
" chunks={\"lat\": 1800, \"lon\": 3600},\n",
615585
" combine=\"nested\",\n",
616586
" concat_dim=\"i\",\n",
617-
").transpose(\"time\", \"i\", \"lat\", \"lon\")"
587+
")"
618588
]
619589
},
620590
{
@@ -633,18 +603,6 @@
633603
"id": "27",
634604
"metadata": {},
635605
"outputs": [],
636-
"source": [
637-
"ds_mean = ds.isel(i=0)\n",
638-
"ds_std = (ds - ds_mean).std(dim=\"i\")\n",
639-
"ds_target = "
640-
]
641-
},
642-
{
643-
"cell_type": "code",
644-
"execution_count": null,
645-
"id": "28",
646-
"metadata": {},
647-
"outputs": [],
648606
"source": [
649607
"config = {\n",
650608
" \"analysed_sst\": {\n",
@@ -658,7 +616,7 @@
658616
{
659617
"cell_type": "code",
660618
"execution_count": null,
661-
"id": "29",
619+
"id": "28",
662620
"metadata": {},
663621
"outputs": [],
664622
"source": [
@@ -671,13 +629,13 @@
671629
{
672630
"cell_type": "code",
673631
"execution_count": null,
674-
"id": "30",
632+
"id": "29",
675633
"metadata": {},
676634
"outputs": [],
677635
"source": [
678636
"for v, a in config.items():\n",
679637
" x, u = xu(ds, v, a)\n",
680-
" res = (ds[v][0, 1:] - x) / u\n",
638+
" res = (ds[v][1:, 0] - x) / u\n",
681639
" plot_histogram(\n",
682640
" res,\n",
683641
" title=a[\"name\"],\n",
@@ -717,7 +675,7 @@
717675
{
718676
"cell_type": "code",
719677
"execution_count": null,
720-
"id": "31",
678+
"id": "30",
721679
"metadata": {},
722680
"outputs": [],
723681
"source": [
@@ -726,35 +684,33 @@
726684
},
727685
{
728686
"cell_type": "markdown",
729-
"id": "32",
730-
"metadata": {
731-
"jp-MarkdownHeadingCollapsed": true
732-
},
687+
"id": "31",
688+
"metadata": {},
733689
"source": [
734690
"# GLORYS"
735691
]
736692
},
737693
{
738694
"cell_type": "code",
739695
"execution_count": null,
740-
"id": "33",
696+
"id": "32",
741697
"metadata": {},
742698
"outputs": [],
743699
"source": [
744700
"ds = xr.open_mfdataset(\n",
745701
" \"./mercatorglorys12v1_gl12_mean_200001.*.nc\",\n",
746702
" engine=\"h5netcdf\",\n",
747703
" mask_and_scale=True,\n",
748-
" chunks={\"depth\": 10, \"latitude\": 511, \"lon\": 1080},\n",
704+
" chunks={\"latitude\": 2041, \"lon\": 2160, \"depth\": 1},\n",
749705
" combine=\"nested\",\n",
750706
" concat_dim=\"i\",\n",
751-
").transpose(\"time\", \"i\", \"depth\", \"latitude\", \"longitude\")"
707+
")"
752708
]
753709
},
754710
{
755711
"cell_type": "code",
756712
"execution_count": null,
757-
"id": "34",
713+
"id": "33",
758714
"metadata": {},
759715
"outputs": [],
760716
"source": [
@@ -764,7 +720,7 @@
764720
{
765721
"cell_type": "code",
766722
"execution_count": null,
767-
"id": "35",
723+
"id": "34",
768724
"metadata": {},
769725
"outputs": [],
770726
"source": [
@@ -779,7 +735,7 @@
779735
{
780736
"cell_type": "code",
781737
"execution_count": null,
782-
"id": "36",
738+
"id": "35",
783739
"metadata": {},
784740
"outputs": [],
785741
"source": [
@@ -792,13 +748,13 @@
792748
{
793749
"cell_type": "code",
794750
"execution_count": null,
795-
"id": "37",
751+
"id": "36",
796752
"metadata": {},
797753
"outputs": [],
798754
"source": [
799755
"for v, a in config.items():\n",
800756
" x, u = xu(ds, v, a)\n",
801-
" res = (ds[v][0, 1:, 0] - x) / u\n",
757+
" res = (ds[v][1:, 0, 0] - x) / u\n",
802758
" plot_histogram(\n",
803759
" res,\n",
804760
" title=a[\"name\"],\n",
@@ -838,7 +794,7 @@
838794
{
839795
"cell_type": "code",
840796
"execution_count": null,
841-
"id": "38",
797+
"id": "37",
842798
"metadata": {},
843799
"outputs": [],
844800
"source": [
@@ -847,7 +803,7 @@
847803
},
848804
{
849805
"cell_type": "markdown",
850-
"id": "39",
806+
"id": "38",
851807
"metadata": {},
852808
"source": [
853809
"# ESA SCOPE PP parameters"
@@ -856,23 +812,23 @@
856812
{
857813
"cell_type": "code",
858814
"execution_count": null,
859-
"id": "40",
815+
"id": "39",
860816
"metadata": {},
861817
"outputs": [],
862818
"source": [
863819
"ds = xr.open_mfdataset(\n",
864820
" \"./PE_mro_mean_error_prv_4km_120p_spring_cor.*.nc\",\n",
865821
" engine=\"h5netcdf\",\n",
866-
" chunks={\"latitude\": 2160, \"lon\": 2160},\n",
822+
" chunks={\"lat\": 1440, \"lon\": 1440},\n",
867823
" combine=\"nested\",\n",
868824
" concat_dim=\"i\",\n",
869-
").transpose(\"i\", \"lat\", \"lon\")"
825+
")"
870826
]
871827
},
872828
{
873829
"cell_type": "code",
874830
"execution_count": null,
875-
"id": "41",
831+
"id": "40",
876832
"metadata": {},
877833
"outputs": [],
878834
"source": [
@@ -882,19 +838,17 @@
882838
{
883839
"cell_type": "code",
884840
"execution_count": null,
885-
"id": "42",
841+
"id": "41",
886842
"metadata": {},
887843
"outputs": [],
888844
"source": [
889845
"config = {\n",
890846
" \"alphaB\": {\n",
891847
" \"uncertainty\": \"alphaB_unc\",\n",
892-
" \"distribution\": \"lognormal\",\n",
893848
" \"name\": \"Initial slope of photosynthesis-irradiance curve\",\n",
894849
" },\n",
895850
" \"PmB\": {\n",
896851
" \"uncertainty\": \"PmB_unc\",\n",
897-
" \"distribution\": \"normal\",\n",
898852
" \"name\": \"Assimilation number of photosynthesis-irradiance curve\",\n",
899853
" }\n",
900854
"}"
@@ -903,7 +857,7 @@
903857
{
904858
"cell_type": "code",
905859
"execution_count": null,
906-
"id": "43",
860+
"id": "42",
907861
"metadata": {},
908862
"outputs": [],
909863
"source": [
@@ -916,7 +870,7 @@
916870
{
917871
"cell_type": "code",
918872
"execution_count": null,
919-
"id": "44",
873+
"id": "43",
920874
"metadata": {},
921875
"outputs": [],
922876
"source": [
@@ -946,23 +900,29 @@
946900
" res,\n",
947901
" dims=[\"i\"],\n",
948902
" title=a[\"name\"],\n",
903+
" x=\"lon\",\n",
904+
" y=\"lat\",\n",
949905
" )\n",
950906
" plot_std(\n",
951907
" res,\n",
952908
" dims=[\"i\"],\n",
953909
" title=a[\"name\"],\n",
910+
" x=\"lon\",\n",
911+
" y=\"lat\",\n",
954912
" )\n",
955913
" plot_range(\n",
956914
" res,\n",
957915
" dims=[\"i\"],\n",
958916
" title=a[\"name\"],\n",
917+
" x=\"lon\",\n",
918+
" y=\"lat\",\n",
959919
" )"
960920
]
961921
},
962922
{
963923
"cell_type": "code",
964924
"execution_count": null,
965-
"id": "45",
925+
"id": "44",
966926
"metadata": {},
967927
"outputs": [],
968928
"source": [
@@ -972,7 +932,7 @@
972932
{
973933
"cell_type": "code",
974934
"execution_count": null,
975-
"id": "46",
935+
"id": "45",
976936
"metadata": {},
977937
"outputs": [],
978938
"source": []

0 commit comments

Comments
 (0)