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

expose all metadata from .nc and .tif files #36

Open
2 tasks
lazarusA opened this issue Dec 12, 2024 · 2 comments
Open
2 tasks

expose all metadata from .nc and .tif files #36

lazarusA opened this issue Dec 12, 2024 · 2 comments

Comments

@lazarusA
Copy link
Collaborator

Currently not all metadata is being captured when reading these files. Also, if some properties, such as scale_factor are applied we should be explicit about it.

TODO

  • be explicit about the application of properties such as scale_factor or offset.
  • consider .nc and .tif.
@danlooo
Copy link
Member

danlooo commented Dec 16, 2024

See also EarthyScience/RQADeforestation.jl#39
Might also be dangerous to keep properties, e.g. scale_factor after applying them. Similar to concatenatecubes. However, one needs these properties, e.g. to write files with the same scale factor. I'd throw away properties by default and allow the user to explicitly keep them e.g. with open_dataset("foo.tif";keep_properties=true)

@danlooo
Copy link
Member

danlooo commented Dec 17, 2024

Current behaviour of tif file properties:

  • gdalinfo on file : All properties
  • xarray.Dataset: No properties
  • YAXArrays.Dataset : Only projection as PROJCS string
  • xarray.DataArray : Most properties except the already applied ones, e.g.. scale_factor
  • YAXArrays.YAXArray : Only missing_value, name, and projection

In addition, there is also:

  • optional and less popular band specific properties see also python notebook.
  • optional and more popular metadata xml sidecar files, e.g. created by qgis about band statistics, loaded by xarray and ignored by YAXArrays
  • xarray treats the band as an additional dimension of the single DataArray band_data, thereby omitting band specific meta data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants