oggm.tasks.gdir_to_tar#
- oggm.tasks.gdir_to_tar(gdir: GlacierDirectory, base_dir: str = None, delete: bool = True, include: list = None, keep_fetched_from: bool = False) str[source]#
Writes the content of a glacier directory to a tar file.
The tar file is located at the same location of the original directory. The glacier directory objects are useless if deleted!
- Parameters:
- gdir
oggm.GlacierDirectory The glacier directory to write to a tar file.
- base_dirstr, optional
Path to the basedir where to write the directory (defaults to the same location of the original directory).
- deletebool, default True
Delete the original directory afterwards.
- includelist of str, optional
Only add these paths (relative to the glacier directory) to the tar file, e.g. the changed paths from
write_level_manifestwhen building a per-level delta, such as<group>.npz. Directories are added recursively. The default adds the whole directory.- keep_fetched_frombool, default False
Keep the
fetched_fromfield of the manifests, which is otherwise dropped. Only for tars which are never published, since the field may hold local paths: theL3adirectories of a chunked run use it to tell the next stage where L2 came from.
- gdir
- Returns:
- str
The path to the tar file.
Notes
Files written to the glacier directory: