oggm.cli.prepro_levels.run_prepro_levels#
- oggm.cli.prepro_levels.run_prepro_levels(rgi_version=None, rgi_reg=None, border=None, output_folder='', working_dir='', dem_source='', is_test=False, test_ids=None, rgi_file=None, intersects_file=None, test_topofile=None, disable_mp=False, params_file=None, elev_bands=False, centerlines=False, override_params=None, skip_inversion=False, inversion_volume_dataset='iceboost', mb_model_class='MonthlyTIModel', mb_calibration_strategy='informed_threestep', geodetic_mb_file_path=None, temp_bias_file_path=None, select_source_from_dir=None, keep_dem_folders=False, add_consensus_thickness=False, add_itslive_velocity=False, add_millan_thickness=False, add_millan_velocity=False, add_hugonnet_dhdt=False, add_bedmachine=False, add_glathida=False, add_distributed_thickness=False, add_export_thickness_geotiff=False, compute_hypsometry=False, custom_climate_task=None, custom_climate_task_kwargs=None, start_level=None, start_base_url=None, max_level=5, logging_level='WORKFLOW', dynamic_spinup=False, ref_mb_err_scaling_factor=0.2, dynamic_spinup_start_year=1979, dynamic_spinup_periods_to_try=None, continue_on_error=True, store_fl_diagnostics=False)[source]#
Generate the preprocessed OGGM glacier directories for this OGGM version
- Parameters:
- rgi_versionstr
the RGI version to use (defaults to cfg.PARAMS)
- rgi_regstr
the RGI region to process
- borderint
the number of pixels at the maps border
- output_folderstr
path to the output folder (where to put the preprocessed tar files)
- dem_sourcestr
which DEM source to use: default, SOURCE_NAME, STANDARD or ALL ALL is to generate RGITOPO “STANDARD” is doina small RGITOPO using COPDEM + NASADEM default is the current default lookup tables found at https://cluster.klima.uni-bremen.de/~oggm/gdirs/oggm_v1.6/rgitopo/2025.4/
- working_dirstr
path to the OGGM working directory
- params_filestr
path to the OGGM parameter file (to override defaults)
- is_testbool
to test on a couple of glaciers only!
- test_idslist
if is_test: list of ids to process
- rgi_filestr or geopandas.GeoDataFrame, optional
path to an RGI shapefile or a GeoDataFrame to use instead of the default RGI region file. Useful to override the default RGI files for custom runs as well as for testing.
- intersects_filestr or geopandas.GeoDataFrame, optional
path to an intersects shapefile or a GeoDataFrame to use instead of the default RGI intersects file. Can also be None to skip setting the intersects database.
- test_topofilestr
for testing purposes only
- test_crudirstr
for testing purposes only
- disable_mpbool
disable multiprocessing
- elev_bandsbool
compute all flowlines based on the Huss & Farinotti 2012 method.
- centerlinesbool
compute all flowlines based on the OGGM centerline(s) method.
- mb_model_classstr
The mb_model_class to use. Options are ‘MonthlyTIModel’ (default) and ‘SfcTypeTIModel’.
- mb_calibration_strategystr
how to calibrate the massbalance. Currently one of: - ‘informed_threestep’ (default) - ‘melt_temp’ - ‘temp_melt’ Add the _regional suffix to use regional values instead, for example informed_threestep_regional
- geodetic_mb_file_pathstr
optional path or URL to a custom geodetic MB file, passed to utils.get_geodetic_mb_dataframe and tasks.mb_calibration_from_geodetic_mb.
- temp_bias_file_pathstr
optional path or URL to a custom temperature-bias file, passed to tasks.mb_calibration_from_geodetic_mb (only used with the ‘informed_threestep’ calibration strategy). Use this together with a custom_climate_task to calibrate on an arbitrary climate dataset. The file must follow the same format as the default temp-bias files.
- select_source_from_dirstr
if starting from a level 1 “ALL” or “STANDARD” DEM sources directory, select the chosen DEM source here. If you set it to “BY_RES” here, COPDEM will be used and its resolution chosen based on the gdir’s map resolution (COPDEM30 for dx < 60 m, COPDEM90 elsewhere).
- keep_dem_foldersbool
if select_source_from_dir is used, wether to keep the original DEM folders in or not.
- add_consensus_thicknessbool
adds (reprojects) the consensus estimates thickness to the glacier directories. With elev_bands=True, the data will also be binned.
- add_itslive_velocitybool
adds (reprojects) the ITS_LIVE velocity to the glacier directories. With elev_bands=True, the data will also be binned.
- add_millan_thicknessbool
adds (reprojects) the millan thickness to the glacier directories. With elev_bands=True, the data will also be binned.
- add_millan_velocitybool
adds (reprojects) the millan velocity to the glacier directories. With elev_bands=True, the data will also be binned.
- add_hugonnet_dhdtbool
adds (reprojects) the hugonnet dhdt maps to the glacier directories. With elev_bands=True, the data will also be binned.
- add_bedmachinebool
adds (reprojects) the bedmachine ice thickness maps to the glacier directories. With elev_bands=True, the data will also be binned.
- add_glathidabool
adds (reprojects) the glathida thickness data to the glacier directories. Data points are stored as csv files.
- add_distributed_thicknessbool
adds a thickness field to gridded_data using distribute_thickness_per_altitude.
- add_export_thickness_geotiffbool
exports the distributed thickness field to GeoTIFF files in a subfolder of the L3 summary directory.
- compute_hypsometrybool
Compute the hypsometry tables for all glaciers, added to the glacier directory and compiled in the summary folder.
- custom_climate_taskstr
optional import path to a custom climate task in the form “module_path:function_name”. If provided, it will be called instead of the default process_climate_data.
- custom_climate_task_kwargsdict
optional kwargs passed to the custom climate task when it is executed.
- start_levelint
the pre-processed level to start from (default is to start from scratch). If set, you’ll need to indicate start_base_url as well.
- start_base_urlstr
the pre-processed base-url to fetch the data from.
- max_levelint
the maximum pre-processing level before stopping
- skip_inversionbool
do not run the inversion (level 3 files). This is a temporary workaround for workflows that wont run that far into level 3.
- inversion_volume_datasetstr
which reference volume dataset to calibrate the ice thickness inversion (Glen A) against. One of: - ‘iceboost’ (default): the IceBoost v2 product, auto-selected by RGI
version. Supported for RGI62, RGI70G and RGI70C.
‘consensus’: the Farinotti et al. (2019) consensus (ITMIX) estimate. Only supported for RGI62.
- logging_levelstr
the logging level to use (DEBUG, INFO, WARNING, WORKFLOW)
- override_paramsdict
a dict of parameters to override.
- dynamic_spinupstr
include a dynamic spinup matching ‘area/dmdtda’ OR ‘volume/dmdtda’ at the RGI-date
- ref_mb_err_scaling_factorfloat
scaling factor to reduce individual geodetic mass balance uncertainty
- dynamic_spinup_start_yearint
if dynamic_spinup is set, define the starting year for the simulation. The default is 1979, unless the climate data starts later.
- dynamic_spinup_periods_to_trylist or None
If the spinup_period defined by rgi_date - dynamic_spinup_start_yr was not successful, you can provide here a list of spinup periods which should be tried in order. Default is None
- continue_on_errorbool
if True the workflow continues if a task raises an error. For operational runs it should be set to True (the default).
- store_fl_diagnosticsbool
if True, also compute and store flowline diagnostics during preprocessing. This can increase data usage quite a bit.