Skip to content
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

xcube dataset convention needed #488

Open
2 tasks
forman opened this issue Jul 13, 2021 · 0 comments
Open
2 tasks

xcube dataset convention needed #488

forman opened this issue Jul 13, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@forman
Copy link
Member

forman commented Jul 13, 2021

Is your feature request related to a problem? Please describe.

xcube dataset specification is too strict as it limits the capabilities of xcube in general. For example, in order to support datasets using some other spatial CRS than EPSG:4326 (#112) we must encode the CRS in non-cube variables if we want to adhere to CF conventions.

Describe the solution you'd like

  • To be CF-conformant, we need to use a grid mapping variable for any CRS that is not WGS-84. Therefore a data cube may allow for any other variables than variables with dimensions (time, ..., y, x).
  • We define an xcube data cube as set of ND-images: image stacks, e.g. datasets with variables with dimensions ([time], …, y, x) where x, y are the dimensions of spatial coordinate variables according to the grid mapping used.
  • Spatial coordinate variable and dimension names may be any. However, when xcube generates WGS-84 cubes, we should stick to “lon” and “lat” without a grid mapping variable.

IMPORTANT: The term data cube for a dataset as used throughout xcube CLI help, docstrings, documentation, notebooks is still fine, given that a subset of the dataset variables are cube-like, namely ND images.

xcube Code that used assert_cube() so far to ensure the specifcation is met, will need to be replaced by code that is less struct. Here is a general pattern:

Before:

def some_cube_func(cube: xr.Dataset, ...):
    assert_cube(cube, "cube")
    return <impl using cube>

After:

def some_cube_func(cube: xr.Dataset, ...):
    cube, other_vars_ds = split_cube(cube, "cube")
    return merge_cube(<impl using cube>, other_vars_ds )

Note: <impl using cube> may than want to assert an ND-images-only dataset by utilizing assert_cube().

  • Turn the xcube dataset specifcation
    - rename cubespec.md into a convention cubeconv.md
    - rewrite cubeconv.md according to requirements given above and content of draft doc "AVL Dataset Conventions"
  • Find occurences of assert_cube() and refactor the code to accept any dataset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants