unzip#
- geobricks.unzip(data, to_file=False)[source]#
Uncompress gzipped netCDF. Only applies to gzip compression (non-lossy compression). Even if gzip compression is not destructive, in some GIS softwares uncompressed netCDF are quicker to manipulate than gzipped netCDF.
Parameters#
- datapath (str or pathlib.Path), or variable (xarray.Dataset, xarray.DataArray)
Dataset (netCDF or xarray variable) that will be unzipped.
Note that
data
will be loaded into a xarray.Dataset or xarray.DataArray.- to_filebool or path (str or pathlib.Path), default False
If True and if
data
is a path (str or pathlib.Path), the resulting dataset will be exported to a file with the same pathname and the suffix ‘_unzip’. Ifto_file
is a path, the resulting dataset will be exported to this specified filepath.
Returns#
- data_dsxarray.Dataset
Standard GEOP4TH variable (xarray.Dataset) with gzip compression removed.
If
to_file
argument is used, the resulting dataset can also be exported to a file.