-
Notifications
You must be signed in to change notification settings - Fork 20
Specification for xcube Multi-Resolution Datasets #635
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| xcube Multi-Resolution Datasets | ||
| =============================== | ||
|
|
||
| Definition | ||
| ---------- | ||
|
|
||
| A xcube _multi-resolution dataset_ refers to an N-D [image | ||
| pyramid](https://en.wikipedia.org/wiki/Pyramid_(image_processing)) | ||
| where an _image_ refers to a 2-D dataset with two spatial dimensions | ||
| in some horizontal coordinate system. | ||
|
|
||
| A multi-resolution dataset comprises a fixed number of | ||
| _levels_, which are regular datasets covering the same spatial area at different resolutions. | ||
| Level zero represents the original resolution `res(L=0)`, higher level | ||
| resolutions decrease by a factor of two: `res(L) = res(0) / 2^L`. | ||
|
|
||
|
|
||
| Implementation in xcube | ||
| ----------------------- | ||
|
|
||
| In xcube, multi-resolution datasets are represented by the abstract class | ||
| `xcube.core.mldataset.MultiLevelDataset`. The xcube data store framework | ||
| refers to this datatype using the alias `mldataset`. The corresponding | ||
| default data format is the xcube `levels` format. Later xcube will also | ||
| support Cloud Optimized GeoTIFF (COG) as format for multi-resolution | ||
| datasets. | ||
|
|
||
| The xcube Levels Format | ||
| ----------------------- | ||
|
|
||
| The xcube Levels format is basically a single top-level directory. | ||
| The filename extension of that directory should be `.levels` | ||
| by convention. The directory entries are Zarr datasets | ||
|
|
||
| 1. that are representations of regular xarray datasets named after | ||
| their zero-based level index, `{level}.zarr`; | ||
| 2. that comply with the xcube dataset convention. | ||
|
|
||
| <div style="color: red;"> | ||
| TODO (forman): link to xcube dataset convention | ||
| </div> | ||
|
|
||
|
|
||
| The following is a multi-resolution dataset with three levels: | ||
|
|
||
| - test_pyramid.levels/ | ||
| - 0.zarr/ | ||
| - 1.zarr/ | ||
| - 2.zarr/ | ||
|
|
||
| An important use case is generating image pyramids from existing large | ||
| datasets without the need to create a copy of level zero. | ||
|
|
||
| To support this, the level zero dataset may be a link to an existing | ||
| Zarr dataset. The filename is then `0.link` rather than `0.zarr`. | ||
| The link file contains the path to the actual Zarr dataset | ||
| to be used as level zero as a plain text string. It may be an absolute | ||
| path or a path relative to the top-level dataset. | ||
|
|
||
| - test_pyramid.levels/ | ||
| - 0.link/ # --> link to actual level zero dataset | ||
| - 1.zarr/ | ||
| - 2.zarr/ | ||
|
|
||
| Related reads | ||
| ------------- | ||
|
|
||
| * [WIP: Multiscale use-case](https://github.com/zarr-developers/zarr-specs/issues/23) | ||
| in zarr-developers / zarr-specs on GitHub | ||
|
|
||
|
|
||
| To be discussed | ||
| --------------- | ||
|
|
||
| * Allow links for all levels? | ||
| * Add top-level metadata such as `num_levels` and links for each | ||
| level? | ||
| * Make top-level directory a Zarr group (`.zgroup`) | ||
| and encode level metadata in `.zattrs` (e.g. `num_levels`)? | ||
| * Link relative to link file? | ||
|
|
||
| To do | ||
| ----- | ||
|
|
||
| * Currently, the FS data stores treat relative link paths as relative | ||
| to the data store's `root`. | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is not correct.