openradar / xradar

A tool to work in weather radar data in xarray
https://docs.openradarscience.org/projects/xradar
MIT License
85 stars 17 forks source link

assign_root #148

Closed egouden closed 4 months ago

egouden commented 5 months ago

https://github.com/openradar/xradar/blob/19487ead4813cd57e3a39d9dfcfe049077b447f5/xradar/io/backends/common.py#L88

Why is the first sweep discarded from the computation?

kmuehlbauer commented 5 months ago

The first group here is the root group and does not contain any sweeps:

https://github.com/openradar/xradar/blob/19487ead4813cd57e3a39d9dfcfe049077b447f5/xradar/io/backends/odim.py#L841-L844

kmuehlbauer commented 5 months ago

We should clearly make this more explicit.

egouden commented 5 months ago

Thank you for the quick reply.

Here is my use case. I have a single cfradial1 file containing 3 volumes. I want to create 3 single volumes by selecting the sweeps and assigning a new root for each volume.

Would it be natural for the ODIM backend to provide only the sweeps to the assign_root function?

kmuehlbauer commented 5 months ago

Here is my use case. I have a single cfradial1 file containing 3 volumes. I want to create 3 single volumes by selecting the sweeps and assigning a new root for each volume.

You could just create everything from scratch (same as _assign_root does).

Would it be natural for the ODIM backend to provide only the sweeps to the assign_root function?

Would work, but as of now the Conventions attribute is forwarded to the root group to keep track of provenience.

egouden commented 5 months ago

I am now providing the root group from the cfradial1 file, as expected by the function.

kmuehlbauer commented 4 months ago

@egouden Is your issue resolved? Can we close?

egouden commented 4 months ago

Yes the issue is resolved.