igm-model 2.2.2__tar.gz → 2.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {igm_model-2.2.2 → igm_model-2.2.3}/PKG-INFO +13 -3
- {igm_model-2.2.2 → igm_model-2.2.3}/README.md +1 -1
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/anim_plotly/anim_plotly.py +33 -63
- igm_model-2.2.3/igm/modules/postproc/print_info/print_info.py +65 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/write_ncdf/write_ncdf.py +3 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/preproc/load_ncdf/load_ncdf.py +1 -1
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/preproc/load_tif/load_tif.py +1 -1
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/preproc/oggm_shop/oggm_shop.py +95 -40
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/avalanche/avalanche.py +36 -15
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/clim_oggm/clim_oggm.py +4 -4
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/enthalpy/enthalpy.py +17 -16
- igm_model-2.2.3/igm/modules/process/iceflow/diagnostic.py +60 -0
- igm_model-2.2.3/igm/modules/process/iceflow/emulate.py +325 -0
- igm_model-2.2.3/igm/modules/process/iceflow/energy_iceflow.py +416 -0
- igm_model-2.2.3/igm/modules/process/iceflow/iceflow.py +132 -0
- igm_model-2.2.3/igm/modules/process/iceflow/neural_network.py +70 -0
- igm_model-2.2.3/igm/modules/process/iceflow/optimize.py +691 -0
- igm_model-2.2.3/igm/modules/process/iceflow/optimize_outputs.py +461 -0
- igm_model-2.2.3/igm/modules/process/iceflow/optimize_params_cook.py +358 -0
- igm_model-2.2.3/igm/modules/process/iceflow/params_iceflow.py +332 -0
- igm_model-2.2.3/igm/modules/process/iceflow/params_optimize.py +267 -0
- igm_model-2.2.3/igm/modules/process/iceflow/params_pretraining.py +80 -0
- {igm_model-2.2.2/igm/modules/preproc/pretraining → igm_model-2.2.3/igm/modules/process/iceflow}/pretraining.py +28 -104
- igm_model-2.2.3/igm/modules/process/iceflow/solve.py +151 -0
- igm_model-2.2.3/igm/modules/process/iceflow/utils.py +67 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/particles/particles.py +31 -21
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/smb_oggm/smb_oggm.py +7 -2
- igm_model-2.2.3/igm/modules/process/vert_flow/vert_flow.py +231 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/utils.py +4 -4
- {igm_model-2.2.2 → igm_model-2.2.3}/igm_model.egg-info/PKG-INFO +13 -3
- {igm_model-2.2.2 → igm_model-2.2.3}/igm_model.egg-info/SOURCES.txt +13 -4
- {igm_model-2.2.2 → igm_model-2.2.3}/setup.py +1 -1
- igm_model-2.2.2/igm/modules/postproc/print_info/print_info.py +0 -40
- igm_model-2.2.2/igm/modules/preproc/optimize/__init__.py +0 -8
- igm_model-2.2.2/igm/modules/preproc/optimize/optimize.py +0 -1759
- igm_model-2.2.2/igm/modules/preproc/pretraining/__init__.py +0 -6
- igm_model-2.2.2/igm/modules/process/iceflow/iceflow.py +0 -1493
- igm_model-2.2.2/igm/modules/process/vert_flow/vert_flow.py +0 -127
- {igm_model-2.2.2 → igm_model-2.2.3}/LICENSE +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/common.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/f15_cfsflow_GJ_22_a/100/fieldin.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/f15_cfsflow_GJ_22_a/100/fieldout.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/f15_cfsflow_GJ_22_a/100/model.h5 +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/f15_cfsflow_GJ_22_a/200/fieldin.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/f15_cfsflow_GJ_22_a/200/fieldout.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/f15_cfsflow_GJ_22_a/200/model.h5 +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/f15_cfsflow_GJ_22_a/50/fieldin.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/f15_cfsflow_GJ_22_a/50/fieldout.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/f15_cfsflow_GJ_22_a/50/model.h5 +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/f15_cfsflow_GJ_22_a/README.md +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_16_16_3_1/fieldin.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_16_16_3_1/fieldout.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_16_16_3_1/model.h5 +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_16_32_2_0/fieldin.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_16_32_2_0/fieldout.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_16_32_2_0/model.h5 +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_16_32_2_1/fieldin.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_16_32_2_1/fieldout.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_16_32_2_1/model.h5 +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_16_32_3_0/fieldin.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_16_32_3_0/fieldout.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_16_32_3_0/model.h5 +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_16_32_3_1/fieldin.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_16_32_3_1/fieldout.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_16_32_3_1/model.h5 +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_8_16_2_1/fieldin.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_8_16_2_1/fieldout.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_8_16_2_1/model.h5 +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_8_16_3_1/fieldin.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_8_16_3_1/fieldout.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_8_16_3_1/model.h5 +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_8_32_2_0/fieldin.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_8_32_2_0/fieldout.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_8_32_2_0/model.h5 +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_8_32_2_1/fieldin.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_8_32_2_1/fieldout.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_cnn_8_32_2_1/model.h5 +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_unet_16_32_2_1/fieldin.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_unet_16_32_2_1/fieldout.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_10_4_unet_16_32_2_1/model.h5 +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_30_4_cnn_12_32_3_1/fieldin.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_30_4_cnn_12_32_3_1/fieldout.dat +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/emulators/pinnbp_30_4_cnn_12_32_3_1/model.h5 +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/igm_help.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/igm_run.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/instructed_oggm.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/anim_mayavi/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/anim_mayavi/anim_mayavi.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/anim_plotly/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/anim_video/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/anim_video/anim_video.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/plot2d/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/plot2d/plot2d.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/print_comp/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/print_comp/print_comp.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/print_info/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/texture/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/texture/constants.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/texture/emulator.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/texture/exporter.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/texture/image_data.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/texture/normalizer.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/texture/pix2pixhd.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/texture/preparer.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/texture/texture.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/texture/utils.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/write_ncdf/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/write_particles/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/write_particles/write_particles.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/write_tif/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/write_tif/write_tif.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/write_ts/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/postproc/write_ts/write_ts.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/preproc/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/preproc/include_icemask/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/preproc/include_icemask/include_icemask.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/preproc/infersmb/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/preproc/infersmb/infersmb.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/preproc/load_ncdf/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/preproc/load_tif/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/preproc/oggm_shop/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/preproc/optimize_v1/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/preproc/optimize_v1/optimize_v1.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/avalanche/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/clim_oggm/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/enthalpy/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/flow_dt_thk/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/flow_dt_thk/flow_dt_thk.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/gflex/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/gflex/gflex.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/glerosion/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/glerosion/glerosion.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/iceflow/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/iceflow_v1/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/iceflow_v1/iceflow_v1.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/particles/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/particles_v1/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/particles_v1/particles_v1.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/read_output/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/read_output/read_output.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/rockflow/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/rockflow/rockflow.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/smb_oggm/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/smb_simple/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/smb_simple/smb_simple.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/thk/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/thk/thk.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/time/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/time/time.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm/modules/process/vert_flow/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm_model.egg-info/dependency_links.txt +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm_model.egg-info/entry_points.txt +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm_model.egg-info/requires.txt +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/igm_model.egg-info/top_level.txt +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/setup.cfg +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/tests/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/tests/test_full_glacier_evolution_oggm_shop/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/tests/test_full_glacier_evolution_oggm_shop/test_full_glacier_evolution_oggm_shop.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/tests/test_full_glacier_evolution_synthetic/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/tests/test_full_glacier_evolution_synthetic/make_synthetic.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/tests/test_full_glacier_evolution_synthetic/test_full_glacier_evolution_synthetic.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/tests/test_iceflow/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/tests/test_iceflow/test_iceflow.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/tests/test_load_ncdf/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/tests/test_load_ncdf/make_fake_ncdf.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/tests/test_load_ncdf/test_load_ncdf.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/tests/test_modules/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/tests/test_modules/invalid_custom_module_folder/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/tests/test_modules/invalid_custom_module_folder/invalid_custom_module.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/tests/test_modules/missing_function_custom_module.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/tests/test_modules/test_loading_modules.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/tests/test_modules/valid_custom_module.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/tests/test_modules/valid_custom_module_folder/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/tests/test_modules/valid_custom_module_folder/valid_custom_module.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/tests/test_optimize/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/tests/test_optimize/test_optimize.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/tests/test_params/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/tests/test_params/test_params.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/tests/test_vert_flow/__init__.py +0 -0
- {igm_model-2.2.2 → igm_model-2.2.3}/tests/test_vert_flow/test_vert_flow.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: igm-model
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.3
|
|
4
4
|
Summary: IGM - a glacier evolution model
|
|
5
5
|
Home-page: https://github.com/jouvetg/igm
|
|
6
6
|
Author: Guillaume Jouvet
|
|
@@ -21,6 +21,16 @@ Requires-Dist: oggm
|
|
|
21
21
|
Requires-Dist: salem
|
|
22
22
|
Requires-Dist: pyyaml
|
|
23
23
|
Requires-Dist: importlib_resources
|
|
24
|
+
Dynamic: author
|
|
25
|
+
Dynamic: author-email
|
|
26
|
+
Dynamic: description
|
|
27
|
+
Dynamic: description-content-type
|
|
28
|
+
Dynamic: home-page
|
|
29
|
+
Dynamic: license
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
Dynamic: requires-dist
|
|
32
|
+
Dynamic: requires-python
|
|
33
|
+
Dynamic: summary
|
|
24
34
|
|
|
25
35
|
[](https://www.gnu.org/licenses/gpl-3.0)
|
|
26
36
|
### <h1 align="center" id="title">The Instructed Glacier Model (IGM) </h1>
|
|
@@ -44,7 +54,7 @@ The Instructed Glacier Model (IGM) is an **open-source Python package**, which p
|
|
|
44
54
|
|
|
45
55
|
# Documentation
|
|
46
56
|
|
|
47
|
-
Start with the 10-min [video tutorial](https://vimeo.com/884003820). Then, all the documentation can be found on the dedicated [wiki](https://github.com/jouvetg/igm/wiki) and the the in-progress and open-to-contributions [technical paper](https://github.com/jouvetg/igm-paper/paper.pdf).
|
|
57
|
+
Start with the 10-min [video tutorial](https://vimeo.com/884003820). Then, all the documentation can be found on the dedicated [wiki](https://github.com/jouvetg/igm/wiki) and the the in-progress and open-to-contributions [technical paper](https://github.com/jouvetg/igm-paper/blob/main/paper.pdf).
|
|
48
58
|
|
|
49
59
|
# Discord channel
|
|
50
60
|
|
|
@@ -20,7 +20,7 @@ The Instructed Glacier Model (IGM) is an **open-source Python package**, which p
|
|
|
20
20
|
|
|
21
21
|
# Documentation
|
|
22
22
|
|
|
23
|
-
Start with the 10-min [video tutorial](https://vimeo.com/884003820). Then, all the documentation can be found on the dedicated [wiki](https://github.com/jouvetg/igm/wiki) and the the in-progress and open-to-contributions [technical paper](https://github.com/jouvetg/igm-paper/paper.pdf).
|
|
23
|
+
Start with the 10-min [video tutorial](https://vimeo.com/884003820). Then, all the documentation can be found on the dedicated [wiki](https://github.com/jouvetg/igm/wiki) and the the in-progress and open-to-contributions [technical paper](https://github.com/jouvetg/igm-paper/blob/main/paper.pdf).
|
|
24
24
|
|
|
25
25
|
# Discord channel
|
|
26
26
|
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
import copy
|
|
3
|
-
|
|
4
3
|
import numpy as np
|
|
5
|
-
import os
|
|
6
4
|
import json
|
|
7
|
-
from types import SimpleNamespace
|
|
8
5
|
import xarray as xr
|
|
9
6
|
|
|
10
7
|
|
|
@@ -45,45 +42,11 @@ def finalize(params, state):
|
|
|
45
42
|
],
|
|
46
43
|
style={"margin-bottom": "10px"},
|
|
47
44
|
),
|
|
48
|
-
|
|
49
|
-
html.Div(
|
|
50
|
-
dcc.Slider(
|
|
51
|
-
id="camera_angle",
|
|
52
|
-
step=9,
|
|
53
|
-
value=45,
|
|
54
|
-
min=0,
|
|
55
|
-
max=180,
|
|
56
|
-
marks=None,
|
|
57
|
-
drag_value=45,
|
|
58
|
-
included=False,
|
|
59
|
-
)
|
|
60
|
-
),
|
|
45
|
+
|
|
61
46
|
# 3D surface plot
|
|
62
47
|
dcc.Graph(id="mnt_surface", figure=fig),
|
|
63
48
|
],
|
|
64
|
-
style={"width": "
|
|
65
|
-
),
|
|
66
|
-
# slider for camera-position on z-axis
|
|
67
|
-
html.Div(
|
|
68
|
-
children=[
|
|
69
|
-
dcc.Slider(
|
|
70
|
-
id="camera_height",
|
|
71
|
-
step=0.2,
|
|
72
|
-
value=1.5,
|
|
73
|
-
min=0,
|
|
74
|
-
max=2,
|
|
75
|
-
vertical=True,
|
|
76
|
-
drag_value=1.5,
|
|
77
|
-
marks=None,
|
|
78
|
-
verticalHeight=600,
|
|
79
|
-
included=False,
|
|
80
|
-
)
|
|
81
|
-
],
|
|
82
|
-
style={
|
|
83
|
-
"width": "5%",
|
|
84
|
-
"display": "inline-block",
|
|
85
|
-
"text_align": "center",
|
|
86
|
-
},
|
|
49
|
+
style={"width": "100%", "height": "800px", "display": "inline-block"},
|
|
87
50
|
),
|
|
88
51
|
],
|
|
89
52
|
style={
|
|
@@ -96,18 +59,11 @@ def finalize(params, state):
|
|
|
96
59
|
@app.callback(
|
|
97
60
|
Output("mnt_surface", "figure"),
|
|
98
61
|
Input("property", "value"),
|
|
99
|
-
Input("camera_angle", "drag_value"),
|
|
100
|
-
Input("camera_height", "drag_value"),
|
|
101
62
|
)
|
|
102
|
-
def updata_graph(property
|
|
103
|
-
# load params
|
|
104
|
-
path_to_json_saved = "params_saved.json"
|
|
105
|
-
with open(path_to_json_saved, "r") as json_file:
|
|
106
|
-
json_text = json_file.read()
|
|
107
|
-
params = json.loads(json_text, object_hook=lambda d: SimpleNamespace(**d))
|
|
108
|
-
|
|
63
|
+
def updata_graph(property):
|
|
109
64
|
# read output.nc
|
|
110
|
-
|
|
65
|
+
output_file = params.wncd_output_file
|
|
66
|
+
ds = xr.open_dataset(output_file, engine="netcdf4")
|
|
111
67
|
|
|
112
68
|
# get attributes from ds
|
|
113
69
|
bedrock = np.array(ds.topg[0])
|
|
@@ -204,7 +160,7 @@ def finalize(params, state):
|
|
|
204
160
|
z=bedrock_border,
|
|
205
161
|
x=lat_range,
|
|
206
162
|
y=lon_range,
|
|
207
|
-
colorscale='
|
|
163
|
+
colorscale='gray',
|
|
208
164
|
opacity=1,
|
|
209
165
|
showlegend=True,
|
|
210
166
|
name="bedrock",
|
|
@@ -261,40 +217,35 @@ def finalize(params, state):
|
|
|
261
217
|
ratio_z = (max_bedrock - min_bedrock) / (bedrock.shape[0] * resolution)
|
|
262
218
|
ratio_z *= 2 # emphasize z-axis to make mountians look twice as steep
|
|
263
219
|
|
|
264
|
-
# transform angle[0-180] into values between [0, 1] for camera postion
|
|
265
|
-
radians = math.radians(camera_angle - 180)
|
|
266
|
-
camera_x = math.sin(-radians)
|
|
267
|
-
camera_y = math.cos(-radians)
|
|
268
|
-
|
|
269
220
|
fig_dict = dict(
|
|
270
221
|
data=frames[0]["data"],
|
|
271
222
|
frames=frames,
|
|
272
223
|
layout=dict( # width=1800,
|
|
273
|
-
height=
|
|
224
|
+
height=900,
|
|
274
225
|
margin=dict(l=0, r=0, t=30, b=0),
|
|
275
226
|
sliders=[sliders_dict],
|
|
276
227
|
title=title,
|
|
277
228
|
font=dict(family="monospace"),
|
|
278
229
|
legend={"orientation": "h", "yanchor": "bottom", "xanchor": "left"},
|
|
279
230
|
scene=dict(
|
|
280
|
-
zaxis=dict(showbackground=
|
|
231
|
+
zaxis=dict(showbackground=False, showticklabels=False, title=""),
|
|
281
232
|
xaxis=dict(
|
|
282
233
|
showbackground=False,
|
|
283
|
-
showticklabels=
|
|
234
|
+
showticklabels=False,
|
|
284
235
|
visible=True,
|
|
285
236
|
range=[lat_range[0], lat_range[-1]],
|
|
286
|
-
title="Longitude",
|
|
237
|
+
title=""#"Longitude",
|
|
287
238
|
),
|
|
288
239
|
yaxis=dict(
|
|
289
240
|
showbackground=False,
|
|
290
|
-
showticklabels=
|
|
241
|
+
showticklabels=False,
|
|
291
242
|
visible=True,
|
|
292
243
|
range=[lon_range[0], lon_range[-1]],
|
|
293
|
-
title="Latitude",
|
|
244
|
+
title=""#"Latitude",
|
|
245
|
+
|
|
294
246
|
),
|
|
295
247
|
),
|
|
296
248
|
scene_aspectratio=dict(x=1, y=ratio_y, z=ratio_z),
|
|
297
|
-
scene_camera_eye=dict(x=camera_x, y=camera_y, z=camera_height),
|
|
298
249
|
updatemenus=[
|
|
299
250
|
dict(
|
|
300
251
|
buttons=[
|
|
@@ -347,4 +298,23 @@ def finalize(params, state):
|
|
|
347
298
|
|
|
348
299
|
|
|
349
300
|
if __name__ == "__main__":
|
|
350
|
-
|
|
301
|
+
import argparse
|
|
302
|
+
# Set up argument parser
|
|
303
|
+
parser = argparse.ArgumentParser(description="Load a JSON file and pass its content to finalize.")
|
|
304
|
+
parser.add_argument('--param_file',
|
|
305
|
+
type=str,
|
|
306
|
+
default='params_saved.json',
|
|
307
|
+
help='Path to the JSON parameter file')
|
|
308
|
+
|
|
309
|
+
# Parse the command-line arguments
|
|
310
|
+
args = parser.parse_args()
|
|
311
|
+
|
|
312
|
+
# Load the JSON file
|
|
313
|
+
with open(args.param_file, 'r') as f:
|
|
314
|
+
param_dict = json.load(f)
|
|
315
|
+
|
|
316
|
+
# Convert the loaded JSON dictionary into a Namespace
|
|
317
|
+
param_data = argparse.Namespace(**param_dict)
|
|
318
|
+
|
|
319
|
+
# Call finalize with the loaded JSON data as the first argument
|
|
320
|
+
finalize(param_data, None)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
# Copyright (C) 2021-2023 Guillaume Jouvet <guillaume.jouvet@unil.ch>
|
|
4
|
+
# Published under the GNU GPL (Version 3), check at the LICENSE file
|
|
5
|
+
|
|
6
|
+
import numpy as np
|
|
7
|
+
import os
|
|
8
|
+
import datetime
|
|
9
|
+
import matplotlib.pyplot as plt
|
|
10
|
+
import tensorflow as tf
|
|
11
|
+
|
|
12
|
+
from igm.modules.utils import *
|
|
13
|
+
|
|
14
|
+
def params(parser):
|
|
15
|
+
parser.add_argument(
|
|
16
|
+
"--print_mem_info",
|
|
17
|
+
type=str2bool,
|
|
18
|
+
default=False,
|
|
19
|
+
help="Additional info on memory usage",
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
def initialize(params, state):
|
|
23
|
+
if params.print_mem_info:
|
|
24
|
+
print(
|
|
25
|
+
"IGM %s : Iterations | Time (y) | Time Step (y) | Ice Volume (km^3) | GPU memory (MB) "
|
|
26
|
+
)
|
|
27
|
+
else:
|
|
28
|
+
print(
|
|
29
|
+
"IGM %s : Iterations | Time (y) | Time Step (y) | Ice Volume (km^3) "
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def update(params, state):
|
|
34
|
+
"""
|
|
35
|
+
This serves to print key info on the fly during computation
|
|
36
|
+
"""
|
|
37
|
+
if state.saveresult:
|
|
38
|
+
|
|
39
|
+
if params.print_mem_info:
|
|
40
|
+
gpu_info = tf.config.experimental.get_memory_info("GPU:0")
|
|
41
|
+
print(
|
|
42
|
+
"IGM %s : %6.0f | %8.0f | %7.2f | %10.2f | %10.2f "
|
|
43
|
+
% (
|
|
44
|
+
datetime.datetime.now().strftime("%H:%M:%S"),
|
|
45
|
+
state.it,
|
|
46
|
+
state.t,
|
|
47
|
+
state.dt_target,
|
|
48
|
+
np.sum(state.thk) * (state.dx**2) / 10**9,
|
|
49
|
+
gpu_info['current'] / 1024**2
|
|
50
|
+
)
|
|
51
|
+
)
|
|
52
|
+
else:
|
|
53
|
+
print(
|
|
54
|
+
"IGM %s : %6.0f | %8.0f | %7.2f | %10.2f "
|
|
55
|
+
% (
|
|
56
|
+
datetime.datetime.now().strftime("%H:%M:%S"),
|
|
57
|
+
state.it,
|
|
58
|
+
state.t,
|
|
59
|
+
state.dt_target,
|
|
60
|
+
np.sum(state.thk) * (state.dx**2) / 10**9
|
|
61
|
+
)
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
def finalize(params, state):
|
|
65
|
+
pass
|
|
@@ -131,6 +131,9 @@ def update(params, state):
|
|
|
131
131
|
E.axis = "X"
|
|
132
132
|
E[:] = state.x.numpy()
|
|
133
133
|
|
|
134
|
+
if hasattr(state, 'pyproj_srs'):
|
|
135
|
+
nc.pyproj_srs = state.pyproj_srs
|
|
136
|
+
|
|
134
137
|
if hasattr(params, "iflo_Nz"):
|
|
135
138
|
nc.createDimension("z", params.iflo_Nz)
|
|
136
139
|
E = nc.createVariable("z", np.dtype("float32").char, ("z",))
|
|
@@ -139,7 +139,7 @@ def initialize(params, state):
|
|
|
139
139
|
if var in ["x", "y"]:
|
|
140
140
|
vars(state)[var] = tf.constant(vars()[var].astype("float32"))
|
|
141
141
|
else:
|
|
142
|
-
vars(state)[var] = tf.Variable(vars()[var].astype("float32"))
|
|
142
|
+
vars(state)[var] = tf.Variable(vars()[var].astype("float32"), trainable=False)
|
|
143
143
|
|
|
144
144
|
nc.close()
|
|
145
145
|
|
|
@@ -109,7 +109,7 @@ def initialize(params, state):
|
|
|
109
109
|
# transform from numpy to tensorflow
|
|
110
110
|
for file in files:
|
|
111
111
|
var = os.path.split(file)[-1].split(".")[0]
|
|
112
|
-
vars(state)[var] = tf.Variable(vars()[var].astype("float32"))
|
|
112
|
+
vars(state)[var] = tf.Variable(vars()[var].astype("float32"), trainable=False)
|
|
113
113
|
|
|
114
114
|
state.x = tf.constant(x.astype("float32"))
|
|
115
115
|
state.y = tf.constant(y.astype("float32"))
|
|
@@ -82,13 +82,20 @@ def params(parser):
|
|
|
82
82
|
"--oggm_sub_entity_mask",
|
|
83
83
|
type=str2bool,
|
|
84
84
|
default=False,
|
|
85
|
-
help="Ice mask shows individual RGI 7.0G entities within each larger RGI 7.0C complex"
|
|
85
|
+
help=("Ice mask shows individual RGI 7.0G entities within each larger RGI 7.0C complex "
|
|
86
|
+
"(this is now unnecessary for igm_v4, but needs confirming since some tidwater stuff is computed as well)"),
|
|
86
87
|
)
|
|
87
88
|
parser.add_argument(
|
|
88
89
|
"--oggm_RGI_product",
|
|
89
90
|
type=str,
|
|
90
91
|
default="G",
|
|
91
|
-
help="Glacier complexes (C) or individual basins (G) (default is G, individual basins)",
|
|
92
|
+
help="RGI7 Glacier complexes (C) or individual basins (G) (default is G, individual basins)",
|
|
93
|
+
)
|
|
94
|
+
parser.add_argument(
|
|
95
|
+
"--oggm_highres",
|
|
96
|
+
type=str2bool,
|
|
97
|
+
default=False,
|
|
98
|
+
help="OGGM offers high resolution data glacier directories, this will use it if available",
|
|
92
99
|
)
|
|
93
100
|
parser.add_argument(
|
|
94
101
|
"--oggm_run_batch",
|
|
@@ -96,24 +103,44 @@ def params(parser):
|
|
|
96
103
|
default=False,
|
|
97
104
|
help="Run all the glaciers in the world",
|
|
98
105
|
)
|
|
106
|
+
parser.add_argument(
|
|
107
|
+
"--smooth_obs_vel",
|
|
108
|
+
type=str2bool,
|
|
109
|
+
default=True,
|
|
110
|
+
help="Smooth the observed velocities",
|
|
111
|
+
)
|
|
99
112
|
|
|
100
113
|
def initialize(params, state):
|
|
114
|
+
|
|
101
115
|
import json
|
|
116
|
+
import rasterio
|
|
102
117
|
|
|
103
|
-
|
|
118
|
+
# Fetch the data from OGGM
|
|
119
|
+
if not os.path.exists(params.oggm_RGI_ID):
|
|
104
120
|
_oggm_util([params.oggm_RGI_ID], params)
|
|
105
|
-
|
|
106
|
-
|
|
121
|
+
|
|
122
|
+
ncpath = os.path.join(params.oggm_RGI_ID, "gridded_data.nc")
|
|
123
|
+
if not os.path.exists(ncpath):
|
|
124
|
+
msg = f'OGGM data issue with glacier {params.oggm_RGI_ID}'
|
|
125
|
+
if hasattr(state, "logger"):
|
|
126
|
+
state.logger.info(msg)
|
|
127
|
+
else:
|
|
128
|
+
print(msg)
|
|
107
129
|
return
|
|
108
130
|
|
|
109
131
|
if hasattr(state, "logger"):
|
|
110
132
|
state.logger.info("Prepare data using oggm and glathida")
|
|
111
133
|
|
|
112
|
-
nc = Dataset(
|
|
134
|
+
nc = Dataset(ncpath, "r+")
|
|
113
135
|
|
|
114
136
|
x = np.squeeze(nc.variables["x"]).astype("float32")
|
|
115
137
|
y = np.flip(np.squeeze(nc.variables["y"]).astype("float32"))
|
|
116
|
-
|
|
138
|
+
|
|
139
|
+
if hasattr(nc, 'pyproj_srs'):
|
|
140
|
+
pyproj_srs = nc.pyproj_srs
|
|
141
|
+
else:
|
|
142
|
+
pyproj_srs = None
|
|
143
|
+
|
|
117
144
|
#If you know that grids above a certain size are going to make your GPU memory explode,
|
|
118
145
|
#activating this commented block and setting the number in the if statement to your
|
|
119
146
|
#maximum threshold will cause IGM to skip execution and move on to the next one
|
|
@@ -161,15 +188,12 @@ def initialize(params, state):
|
|
|
161
188
|
uvelsurfobs = np.flipud(
|
|
162
189
|
np.squeeze(nc.variables["millan_vx"]).astype("float32")
|
|
163
190
|
)
|
|
164
|
-
uvelsurfobs = np.where(np.isnan(uvelsurfobs), 0, uvelsurfobs)
|
|
165
|
-
|
|
166
191
|
uvelsurfobs = np.where(icemaskobs, uvelsurfobs, 0)
|
|
167
192
|
vars_to_save += ["uvelsurfobs"]
|
|
168
193
|
if "millan_vy" in nc.variables:
|
|
169
194
|
vvelsurfobs = np.flipud(
|
|
170
195
|
np.squeeze(nc.variables["millan_vy"]).astype("float32")
|
|
171
196
|
)
|
|
172
|
-
vvelsurfobs = np.where(np.isnan(vvelsurfobs), 0, vvelsurfobs)
|
|
173
197
|
vvelsurfobs = np.where(icemaskobs, vvelsurfobs, 0)
|
|
174
198
|
vars_to_save += ["vvelsurfobs"]
|
|
175
199
|
else:
|
|
@@ -182,28 +206,27 @@ def initialize(params, state):
|
|
|
182
206
|
uvelsurfobs = np.flipud(
|
|
183
207
|
np.squeeze(nc.variables["itslive_vx"]).astype("float32")
|
|
184
208
|
)
|
|
185
|
-
uvelsurfobs = np.where(np.isnan(uvelsurfobs), 0, uvelsurfobs)
|
|
186
209
|
uvelsurfobs = np.where(icemaskobs, uvelsurfobs, 0)
|
|
187
210
|
vars_to_save += ["uvelsurfobs"]
|
|
188
211
|
if "itslive_vy" in nc.variables:
|
|
189
212
|
vvelsurfobs = np.flipud(
|
|
190
213
|
np.squeeze(nc.variables["itslive_vy"]).astype("float32")
|
|
191
214
|
)
|
|
192
|
-
vvelsurfobs = np.where(np.isnan(vvelsurfobs), 0, vvelsurfobs)
|
|
193
215
|
vvelsurfobs = np.where(icemaskobs, vvelsurfobs, 0)
|
|
194
216
|
vars_to_save += ["vvelsurfobs"]
|
|
195
217
|
|
|
196
|
-
|
|
197
|
-
|
|
218
|
+
if params.smooth_obs_vel:
|
|
219
|
+
uvelsurfobs = scipy.signal.medfilt2d(uvelsurfobs, kernel_size=3) # remove outliers
|
|
220
|
+
vvelsurfobs = scipy.signal.medfilt2d(vvelsurfobs, kernel_size=3) # remove outliers
|
|
198
221
|
|
|
199
|
-
if
|
|
222
|
+
if params.oggm_thk_source in nc.variables: # either "millan_ice_thickness" or "consensus_ice_thickness"
|
|
200
223
|
thkinit = np.flipud(
|
|
201
|
-
np.squeeze(nc.variables[
|
|
224
|
+
np.squeeze(nc.variables[params.oggm_thk_source]).astype("float32")
|
|
202
225
|
)
|
|
203
226
|
thkinit = np.where(np.isnan(thkinit), 0, thkinit)
|
|
204
227
|
thkinit = np.where(icemaskobs, thkinit, 0)
|
|
205
228
|
vars_to_save += ["thkinit"]
|
|
206
|
-
|
|
229
|
+
|
|
207
230
|
if "hugonnet_dhdt" in nc.variables:
|
|
208
231
|
dhdt = np.flipud(
|
|
209
232
|
np.squeeze(nc.variables["hugonnet_dhdt"]).astype("float32")
|
|
@@ -219,7 +242,7 @@ def initialize(params, state):
|
|
|
219
242
|
with open(os.path.join(params.oggm_RGI_ID, "glacier_grid.json"), "r") as f:
|
|
220
243
|
data = json.load(f)
|
|
221
244
|
proj = data["proj"]
|
|
222
|
-
|
|
245
|
+
|
|
223
246
|
try:
|
|
224
247
|
thkobs = _read_glathida(
|
|
225
248
|
x, y, usurfobs, proj, params.oggm_path_glathida, state
|
|
@@ -229,7 +252,7 @@ def initialize(params, state):
|
|
|
229
252
|
thkobs = np.zeros_like(thk) * np.nan
|
|
230
253
|
elif params.oggm_RGI_version==7:
|
|
231
254
|
path_glathida = os.path.join(params.oggm_RGI_ID, "glathida_data.csv")
|
|
232
|
-
|
|
255
|
+
|
|
233
256
|
try:
|
|
234
257
|
thkobs = _read_glathida_v7(
|
|
235
258
|
x, y, path_glathida
|
|
@@ -247,8 +270,11 @@ def initialize(params, state):
|
|
|
247
270
|
for var in ["x", "y"]:
|
|
248
271
|
vars(state)[var] = tf.constant(vars()[var].astype("float32"))
|
|
249
272
|
|
|
273
|
+
if pyproj_srs is not None:
|
|
274
|
+
vars(state)["pyproj_srs"] = pyproj_srs
|
|
275
|
+
|
|
250
276
|
for var in vars_to_save:
|
|
251
|
-
vars(state)[var] = tf.Variable(vars()[var].astype("float32"))
|
|
277
|
+
vars(state)[var] = tf.Variable(vars()[var].astype("float32"), trainable=False)
|
|
252
278
|
|
|
253
279
|
complete_data(state)
|
|
254
280
|
|
|
@@ -270,6 +296,16 @@ def initialize(params, state):
|
|
|
270
296
|
var_info["tidewatermask"] = ["Tidewater glacier mask", "no unit"]
|
|
271
297
|
var_info["slopes"] = ["Average glacier surface slope", "deg"]
|
|
272
298
|
|
|
299
|
+
# Extract standardized OGGM projection information
|
|
300
|
+
with open(os.path.join(params.oggm_RGI_ID, "glacier_grid.json"), "r") as f:
|
|
301
|
+
proj = json.load(f)
|
|
302
|
+
|
|
303
|
+
# Access central dem.tif to extract actual EPSG number
|
|
304
|
+
# (failsafe to always check dem.tif)
|
|
305
|
+
# (can optionally also be inferred from 'proj' assuming always northern hemisphere UTM coordinates; not sure)
|
|
306
|
+
with rasterio.open(os.path.join(params.oggm_RGI_ID,'dem.tif')) as dem_ds:
|
|
307
|
+
dst_crs = dem_ds.crs
|
|
308
|
+
|
|
273
309
|
nc = Dataset(
|
|
274
310
|
os.path.join("input_saved.nc"), "w", format="NETCDF4"
|
|
275
311
|
)
|
|
@@ -290,6 +326,18 @@ def initialize(params, state):
|
|
|
290
326
|
xn.axis = "X"
|
|
291
327
|
xn[:] = x
|
|
292
328
|
|
|
329
|
+
if pyproj_srs is not None:
|
|
330
|
+
# Write globale attribute in netCDF output file
|
|
331
|
+
nc.pyproj_srs = pyproj_srs
|
|
332
|
+
nc.setncattr('pyproj_crs',str(proj))
|
|
333
|
+
nc.setncattr('epsg',str(dst_crs))
|
|
334
|
+
nc.pyproj_crs = str(proj)
|
|
335
|
+
nc.epsg = str(dst_crs)
|
|
336
|
+
else:
|
|
337
|
+
# Write globale attribute in netCDF output file
|
|
338
|
+
nc.pyproj_crs = str(proj)
|
|
339
|
+
nc.epsg = str(dst_crs)
|
|
340
|
+
|
|
293
341
|
for v in vars_to_save:
|
|
294
342
|
E = nc.createVariable(v, np.dtype("float32").char, ("y", "x"))
|
|
295
343
|
E.long_name = var_info[v][0]
|
|
@@ -312,7 +360,7 @@ def finalize(params, state):
|
|
|
312
360
|
|
|
313
361
|
if params.oggm_remove_RGI_folder:
|
|
314
362
|
try:
|
|
315
|
-
shutil.rmtree(params.oggm_RGI_ID)
|
|
363
|
+
shutil.rmtree(params.oggm_RGI_ID)
|
|
316
364
|
except Exception as error:
|
|
317
365
|
print("Error: ", error)
|
|
318
366
|
|
|
@@ -345,7 +393,7 @@ def _oggm_util(RGIs, params):
|
|
|
345
393
|
# Initialize OGGM and set up the default run parameters
|
|
346
394
|
cfg.initialize_minimal()
|
|
347
395
|
|
|
348
|
-
cfg.PARAMS["continue_on_error"] =
|
|
396
|
+
cfg.PARAMS["continue_on_error"] = True
|
|
349
397
|
cfg.PARAMS["use_multiprocessing"] = False
|
|
350
398
|
|
|
351
399
|
WD = "OGGM-prepro"
|
|
@@ -366,7 +414,11 @@ def _oggm_util(RGIs, params):
|
|
|
366
414
|
)
|
|
367
415
|
else:
|
|
368
416
|
rgi_ids = RGIs
|
|
369
|
-
|
|
417
|
+
if params.oggm_highres:
|
|
418
|
+
base_url = ( "https://cluster.klima.uni-bremen.de/~oggm/gdirs/oggm_v1.6/exps/igm_v4_hr" )
|
|
419
|
+
else:
|
|
420
|
+
base_url = ( "https://cluster.klima.uni-bremen.de/~oggm/gdirs/oggm_v1.6/exps/igm_v4" )
|
|
421
|
+
|
|
370
422
|
gdirs = workflow.init_glacier_directories(
|
|
371
423
|
# Start from level 3 if you want some climate data in them
|
|
372
424
|
rgi_ids,
|
|
@@ -447,15 +499,15 @@ def _oggm_util(RGIs, params):
|
|
|
447
499
|
from oggm.shop import bedtopo
|
|
448
500
|
|
|
449
501
|
workflow.execute_entity_task(bedtopo.add_consensus_thickness, gdirs)
|
|
450
|
-
|
|
502
|
+
|
|
451
503
|
from oggm.shop import glathida
|
|
452
504
|
|
|
453
505
|
workflow.execute_entity_task(glathida.glathida_to_gdir, gdirs)
|
|
454
|
-
|
|
506
|
+
|
|
455
507
|
from oggm.shop.w5e5 import process_w5e5_data
|
|
456
508
|
|
|
457
509
|
workflow.execute_entity_task(process_w5e5_data, gdirs)
|
|
458
|
-
|
|
510
|
+
|
|
459
511
|
workflow.execute_entity_task(tasks.elevation_band_flowline, gdirs)
|
|
460
512
|
workflow.execute_entity_task(tasks.fixed_dx_elevation_band_flowline, gdirs)
|
|
461
513
|
workflow.execute_entity_task(tasks.mb_calibration_from_geodetic_mb,
|
|
@@ -491,7 +543,7 @@ def _read_glathida(x, y, usurf, proj, path_glathida, state):
|
|
|
491
543
|
|
|
492
544
|
files = glob.glob(os.path.join(path_glathida, "glathida", "data", "*", "point.csv"))
|
|
493
545
|
files += glob.glob(os.path.join(path_glathida, "glathida", "data", "point.csv"))
|
|
494
|
-
|
|
546
|
+
|
|
495
547
|
os.path.expanduser
|
|
496
548
|
|
|
497
549
|
transformer = Transformer.from_crs(proj, "epsg:4326", always_xy=True)
|
|
@@ -508,8 +560,8 @@ def _read_glathida(x, y, usurf, proj, path_glathida, state):
|
|
|
508
560
|
df = pd.concat(
|
|
509
561
|
[pd.read_csv(file, low_memory=False) for file in files], ignore_index=True
|
|
510
562
|
)
|
|
511
|
-
|
|
512
|
-
|
|
563
|
+
|
|
564
|
+
|
|
513
565
|
mask = (
|
|
514
566
|
(lonmin <= df["longitude"])
|
|
515
567
|
& (df["longitude"] <= lonmax)
|
|
@@ -546,12 +598,15 @@ def _read_glathida(x, y, usurf, proj, path_glathida, state):
|
|
|
546
598
|
elevation_normalized = fsurf(xx, yy, grid=False)
|
|
547
599
|
thickness_normalized = np.maximum(elevation_normalized - bedrock, 0)
|
|
548
600
|
|
|
601
|
+
dx = x[1]-x[0]
|
|
602
|
+
dy = y[1]-y[0]
|
|
603
|
+
|
|
549
604
|
# Rasterize thickness
|
|
550
605
|
thickness_gridded = (
|
|
551
606
|
pd.DataFrame(
|
|
552
607
|
{
|
|
553
|
-
"col": np.floor((xx - np.min(x)) /
|
|
554
|
-
"row": np.floor((yy - np.min(y)) /
|
|
608
|
+
"col": np.floor((xx - np.min(x) + dx/2) / dx).astype(int),
|
|
609
|
+
"row": np.floor((yy - np.min(y) + dy/2) / dy).astype(int),
|
|
555
610
|
"thickness": thickness_normalized,
|
|
556
611
|
}
|
|
557
612
|
)
|
|
@@ -566,33 +621,33 @@ def _read_glathida(x, y, usurf, proj, path_glathida, state):
|
|
|
566
621
|
|
|
567
622
|
def _read_glathida_v7(x, y, path_glathida):
|
|
568
623
|
#Function written by Samuel Cook
|
|
569
|
-
|
|
624
|
+
|
|
570
625
|
#Read GlaThiDa file
|
|
571
626
|
gdf = pd.read_csv(path_glathida)
|
|
572
|
-
|
|
627
|
+
|
|
573
628
|
gdf_sel = gdf.loc[gdf.thickness > 0] # you may not want to do that, but be aware of: https://gitlab.com/wgms/glathida/-/issues/25
|
|
574
629
|
gdf_per_grid = gdf_sel.groupby(by='ij_grid')[['i_grid', 'j_grid', 'elevation', 'thickness', 'thickness_uncertainty']].mean() # just average per grid point
|
|
575
630
|
# Average does not preserve ints
|
|
576
631
|
gdf_per_grid['i_grid'] = gdf_per_grid['i_grid'].astype(int)
|
|
577
632
|
gdf_per_grid['j_grid'] = gdf_per_grid['j_grid'].astype(int)
|
|
578
|
-
|
|
579
|
-
#Get GlaThiDa data onto model grid
|
|
633
|
+
|
|
634
|
+
#Get GlaThiDa data onto model grid
|
|
580
635
|
thkobs = np.full((y.shape[0], x.shape[0]), np.nan)
|
|
581
636
|
thkobs[gdf_per_grid['j_grid'],gdf_per_grid['i_grid']] = gdf_per_grid['thickness']
|
|
582
637
|
thkobs = np.flipud(thkobs)
|
|
583
|
-
|
|
638
|
+
|
|
584
639
|
return thkobs
|
|
585
640
|
|
|
586
641
|
def _get_tidewater_termini_and_slopes(tidewatermask, slopes, RGIs, params):
|
|
587
642
|
#Function written by Samuel Cook
|
|
588
643
|
#Identify which glaciers in a complex are tidewater and also return average slope (both needed for infer_params in optimize)
|
|
589
|
-
|
|
644
|
+
|
|
590
645
|
from oggm import utils, workflow, tasks, graphics
|
|
591
646
|
import xarray as xr
|
|
592
647
|
import matplotlib.pyplot as plt
|
|
593
|
-
|
|
648
|
+
|
|
594
649
|
rgi_ids = RGIs
|
|
595
|
-
base_url = ( "https://cluster.klima.uni-bremen.de/~oggm/gdirs/oggm_v1.6/exps/
|
|
650
|
+
base_url = ( "https://cluster.klima.uni-bremen.de/~oggm/gdirs/oggm_v1.6/exps/igm_v4" )
|
|
596
651
|
gdirs = workflow.init_glacier_directories(
|
|
597
652
|
# Start from level 3 if you want some climate data in them
|
|
598
653
|
rgi_ids,
|
|
@@ -619,4 +674,4 @@ def _get_tidewater_termini_and_slopes(tidewatermask, slopes, RGIs, params):
|
|
|
619
674
|
if gdf.loc[0].term_type == '1':
|
|
620
675
|
tidewatermask[tidewatermask==1] = 1
|
|
621
676
|
else:
|
|
622
|
-
tidewatermask[tidewatermask==1] = 0
|
|
677
|
+
tidewatermask[tidewatermask==1] = 0
|