-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
contiguous time axis #7525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Presumably there is some attribute that netcdf-Java is interpreting. It's not clear to me what that is. Perhaps @dopplershift has an idea. |
@ethanrd @haileyajohnson @tdrwenski any thoughts on the above question? |
If cell bounds/edges are not provided with a coordinate variable, the coordinate values are assumed to represent the center points of a set of contiguous cells. In this default case, the cell edges can be represented as an (n+1) sized array with all but the first and last values shared between neighboring cells. In the non-contiguous case, the bounds/edges must be represented as an (n,2) sized array. Looks like there's already an xarray issue (#1475 ) on handling cell bounds. |
So, I believe the results you are seeing above are the expected results with the edge value half way between neighboring coordinate values. |
Thanks @dopplershift and @ethanrd . It seems like it's interpreting the absence of an attribute (!). |
Hey! Thanks for the thoughts. Took me a wile to realize the edge array and the time coordinates aren't the same thing. The time coordinates are really labels and the edge array is calculated from it. Not sure I agree with the default calculation as the mid point of the time coordinate labels, but I think that is a battle I won't take up. +1 for supporting this kind of coordinate attribute in xarray. Based on the other issues linked here, it seems it still has not been implemented? |
What is your issue?
I have a dataset I created using
xarray
. When I am usingnetcdf-java
to read the time axis, I am getting edges that aren't the same values as the time axis coordinates.The xarray-developed dataset looks like:
From
netcdf-java
I see the CoordinateAxis1DTime axis with the following attributes:The edge array is offset by -0.5 days. After a little digging through the java docs, I found the
CoordinateAxis1DTime.edge
array will only be the same as theCoordinateAxis1DTime.coords
array when theContiniousAxis1DTime.isContiguous()
evaluates as True. But the java docs indicate:How can I write a netcdf file using xarray where the time axis would be considered contiguous?
The text was updated successfully, but these errors were encountered: