You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.
I want to share with you an idea I am working on. I have a collection of tasks/sweeps of weather radar data that are not homogenous in size/shape. Radar data structure depends on radar parameters such as maximum range, angle elevation of the antenna, and bin size, among others. Unstructured data is complex to archive, especially when we want to concatenate measurements over time, as matrices are different in shape data that cannot be stacked. Therefore, a tree-like hierarchical structure is a reliable/possible way to handle this unstructured data.
I've created a xarray datatree object where the parent is the radar name, and every node corresponds to a volume coverage pattern (VCP). A VCP is shaped of multiple tasks/sweeps, and each sweep has different radar data, such as radar reflectivity, Kdp, and Zdr, among other variables. The xarray datatree object looks like this
Usually, a radar scan strategy or VCP doesn't take longer than 5 minutes; however, it might change depending on the institution/radar operator. The idea under this xarray datatree object is to efficiently access radar data by naming each node with a timestamp that represents the 5-min VCP. Then, each node contains multiple tasks, sweeps, and variables. More detailed information can be found here
As we can see, the datatree object has time coordinates. However, when I try dt.isel(time=0) I got the following error
ValueErrorTraceback (mostrecentcalllast)
CellIn[64], line1---->1dt.isel(time=0)
File~/miniconda3/envs/xradar/lib/python3.9/site-packages/datatree/mapping.py:208, inmap_over_subtree.<locals>._map_over_subtree(*args, **kwargs)
196node_kwargs_as_datasets=dict(
197zip(
198 [kforkinkwargs_as_tree_length_iterables.keys()],
(...)
203 )
204 )
206# Now we can call func on the data in this particular set of corresponding nodes207results= (
-->208func(*node_args_as_datasets, **node_kwargs_as_datasets)
209ifnotnode_of_first_tree.is_empty210elseNone211 )
213# TODO implement mapping over multiple trees in-place using if conditions from here on?214out_data_objects[node_of_first_tree.path] =resultsFile~/miniconda3/envs/xradar/lib/python3.9/site-packages/xarray/core/dataset.py:2431, inDataset.isel(self, indexers, drop, missing_dims, **indexers_kwargs)
2427returnself._isel_fancy(indexers, drop=drop, missing_dims=missing_dims)
2429# Much faster algorithm for when all indexers are ints, slices, one-dimensional2430# lists, or zero or one-dimensional np.ndarray's->2431indexers=drop_dims_from_indexers(indexers, self.dims, missing_dims)
2433variables= {}
2434dims: dict[Hashable, int] = {}
File~/miniconda3/envs/xradar/lib/python3.9/site-packages/xarray/core/utils.py:859, indrop_dims_from_indexers(indexers, dims, missing_dims)
857invalid=indexers.keys() -set(dims)
858ifinvalid:
-->859raiseValueError(
860f"Dimensions {invalid} do not exist. Expected one or more of {dims}"861 )
863returnindexers865elifmissing_dims=="warn":
866# don't modify inputValueError: Dimensions {'time'} donotexist. ExpectedoneormoreofFrozen({})
I wonder if xarray datatree objects can be sliced by using similar methods as in Xarray dataset, e.g., dt.sel(time=slice('202304070300', '202304070400'), such as it will return the nodes/subtrees I am interested in.
Please let me know your thoughts and comments.
Cheers,
Alfonso
The text was updated successfully, but these errors were encountered:
Hi everyone,
I want to share with you an idea I am working on. I have a collection of tasks/sweeps of weather radar data that are not homogenous in size/shape. Radar data structure depends on radar parameters such as maximum range, angle elevation of the antenna, and bin size, among others. Unstructured data is complex to archive, especially when we want to concatenate measurements over time, as matrices are different in shape data that cannot be stacked. Therefore, a tree-like hierarchical structure is a reliable/possible way to handle this unstructured data.
I've created a xarray datatree object where the parent is the radar name, and every node corresponds to a volume coverage pattern (VCP). A VCP is shaped of multiple tasks/sweeps, and each sweep has different radar data, such as radar reflectivity, Kdp, and Zdr, among other variables. The xarray datatree object looks like this
If we look in a more condensed way, the groups within the xarray datratree object look like this,
Usually, a radar scan strategy or VCP doesn't take longer than 5 minutes; however, it might change depending on the institution/radar operator. The idea under this xarray datatree object is to efficiently access radar data by naming each node with a timestamp that represents the 5-min VCP. Then, each node contains multiple tasks, sweeps, and variables. More detailed information can be found here
As we can see, the datatree object has time coordinates. However, when I try
dt.isel(time=0)
I got the following errorI wonder if xarray datatree objects can be sliced by using similar methods as in Xarray dataset, e.g.,
dt.sel(time=slice('202304070300', '202304070400')
, such as it will return the nodes/subtrees I am interested in.Please let me know your thoughts and comments.
Cheers,
Alfonso
The text was updated successfully, but these errors were encountered: