create_empty_dataset
Functions:
| Name | Description |
|---|---|
empty_dataset_like |
Creates a new xr.Dataset containing the same variables and metadata as the input |
Functions#
empty_dataset_like #
empty_dataset_like(
input_dataset: Dataset,
coord_name: str,
coord_values: ndarray,
coord_bounds: ndarray,
add_transform_qc: bool = True,
add_metric_vars: bool = False,
) -> xr.Dataset
Creates a new xr.Dataset containing the same variables and metadata as the input dataset, but with new coordinate values and bounds for the provided coordinate variable.
Other coordinate variables and coordinate bounds variables will remain untouched. All data variables that are at least partially dimensioned by the provided coordinate will have their metadata copied but their values will be set to NaN. Variables that are dimensioned solely by other coordinate variables will be copied directly over.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_dataset
|
Dataset
|
The input xarray Dataset. |
required |
coord_name
|
str
|
The name of the coordinate variable to modify. |
required |
coord_values
|
ndarray
|
The new values for the coordinate variable. |
required |
coord_bounds
|
ndarray
|
The new bounds for the coordinate variable. |
required |
Returns:
| Type | Description |
|---|---|
Dataset
|
xr.Dataset: The new xarray Dataset with modified coordinate values and bounds. |