-
Notifications
You must be signed in to change notification settings - Fork 43
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
[Dev Question] What's the purpose/use of Grid and co types? #31
Comments
They will eventually move here: The design had a lot of input from multiple people in JuliaGeo, not just me. The grid type is to deal with the many ways that dimension indices are stored. Ranges equal spaced. Vectors (youre not sure they are equal spaced but they actually can be). Matrices for all lat/lon combos. Vectors with coordinate transforms. Categorical indices. No index. On some of these grids the Some datasets come with some dimension reversed. Or both. Or the data reversed and the dimension forwards. If we want Then you want a bounding box for each dimension. So If you take the mean of the time dimension the bound should stay the same but the step size should now cover the whole span. It should do that for any reducing method. Then a plot of aggregated data will show the right time span. etc etc etc. Grids track all that stuff so that plots always plot correctly, we can always use But just use GeoData.jl. It already works for NCDatasets.jl lol |
Also ranges really map to Arrays can be You will also notice with julia> step((LinRange(1,11,6))[1:2])
2.0
julia> step((LinRange(1,11,6))[1:1])
0.0 But we want to know the step size of a single-value range. We may want to concatenate it with something or plot with the step as a label. So we need to track it somewhere else.
|
Thanks, this clarified a lot. I guess the only question that remains is that if you do |
It might be better to have the grid selection happen when you make the dim, it's just evolved that way. Because the dims are also checked to make sure they match the array. I'll think about moving it. (Also I think it is because I allow passing a tuple instead of a range and it makes the range. But I might remove that) We could also improve the grid selection logic and simplify the argument passing to set bounds etc, although most of the time a package will define the grid not users. I also want to polish the no-grid use cases where you just use it like NamedDims as an axis marker, and none of this stuff even happens. |
It is useful for the community to have a way to transform a loaded NetCDF variable into an array with Dimension data attached it, like what this package does. We will implement such an interface in NCDatasets.jl, cf Alexander-Barth/NCDatasets.jl#60 , but unfortunately there are numerous AxisArray-like packages. I've had a look in all of them, and at least from the surface, this one seems to be the strongest candidate.
But since it has been developed by a single person, and I would like to have at least some basic understanding before basing NCDatasets.jl on this one, there are some dev questions. The first one is regarding the
Grid
types/subtypes/supertypes, which at the moment is something I am not sure about.Range
should always be a "standard grid" (AlignedGrid as its called here), while aVector
should always be aBoundedGrid
?The text was updated successfully, but these errors were encountered: