oggm.workflow.get_rgi_chunk

On this page

oggm.workflow.get_rgi_chunk#

oggm.workflow.get_rgi_chunk(rgidf, chunk_idx, chunk_size=1000)[source]#

Select the glaciers belonging to one chunk.

A chunk is a block of the RGI id space: with chunk_size=1000, chunk 3 is made of the glaciers whose id ends in 03000 to 03999. This is what makes chunks line up with the tar bundles written by oggm.utils.base_dir_to_tar(), so that several chunk jobs writing into the same output folder produce disjoint, complete bundle files.

Because the RGI ids have gaps, chunks are not all the same size, and a chunk can even be empty - callers should handle that gracefully rather than error out.

Parameters:
rgidfgeopandas.GeoDataFrame or list of str

the glaciers to partition (an RGI dataframe or a list of RGI ids)

chunk_idxint

which chunk to select, from 0 to count_rgi_chunks() - 1

chunk_sizeint

100 or 1000 (default). Only these two are allowed: they are the bundle sizes that the glacier directory tars are written and read with.

Returns:
the same type as rgidf, with only the glaciers of this chunk