1.5.1.1.11.1.5. polar2grid.writers.hdf5 module

The HDF5 writer creates HDF5 files with groups for each gridded area.

All selected products are in one file. Products are subgrouped together under a parent HDF5 data group based on the data product projection/remapping (parent projection group). Each parent projection group contains attributes describing the projection. Product subgroups contain attributes of the data including timestamps, sensor and platform information. See the command line arguments for HDF5 compression options, the flag to include longitude and latitude data in the file, instructions for output-filename patterns, and product selection.

class polar2grid.writers.hdf5.FakeHDF5(output_filename: str, var_name: str)[source]

Bases: object

Use fake hdf class to create targets for da.store and delayed sources.

class polar2grid.writers.hdf5.HDF5Writer(**kwargs)[source]

Bases: Writer

Writer for HDF5 files.

_output_file_kwargs(dataset, dtype)[source]

Get file keywords from data for output_pattern.

_save_data_array(HDF5_fh, filename, data_arr, parent_group, dtype, compression)[source]
_save_data_arrays_and_area(area, data_arrs, filename, HDF5_fh, dtype, append, compression, add_geolocation)[source]
static create_proj_group(filename: str, parent: TextIO, area_def)[source]

Create the top level group from projection information.

static create_variable(hdf_fh, hdf_subgroup: str, data_arr: DataArray, dtype: dtype, compression: bool)[source]

Create a HDF5 data variable and attributes for the variable.

iter_by_area(datasets: list[DataArray])[source]

Generate datasets grouped by Area.

Parameters:

datasets (list[xr.DataArray]) – A list of dataArray objects stored in Scene.

Returns:

a dictionary of {AreaDef: list[xr.DataArray]}

Return type:

dictionary

static open_HDF5_filehandle(output_filename: str, append: bool = True)[source]

Open a HDF5 file handle.

save_datasets(dataset: list[DataArray], filename=None, dtype=None, append=True, compute=True, **kwargs)[source]

Save HDF5 datasets.

write_geolocation(fh, fname: str, parent: str, area_def, dtype: dtype, append: bool, compression, chunks: tuple[int, int]) tuple[list, list[FakeHDF5]][source]

Delayed Geolocation Data write.

polar2grid.writers.hdf5.add_writer_argument_groups(parser, group=None)[source]

Create writer argument groups.

polar2grid.writers.hdf5.all_equal(iterable: list[str]) bool[source]

Return True if all the elements are equal to each other.