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

Viewing .zarr files with tigger #146

Open
landmanbester opened this issue Jul 14, 2022 · 5 comments
Open

Viewing .zarr files with tigger #146

landmanbester opened this issue Jul 14, 2022 · 5 comments

Comments

@landmanbester
Copy link

At the moment I am creating zarr datasets containing image products (mainly because zarr plays nicely with s3 but also just because zarr is cool). This does however mean that I have to convert them to fits to view them with tigger. For example here

https://github.com/ratt-ru/pfb-clean/blob/37d328442141291981e1ef90198f7283d4439c4e/pfb/workers/grid.py#L392

It would be amazing if we could view these zarr files directly with tigger. All the information in the fits header can be specified as attributes of the zarr dataset.

@landmanbester
Copy link
Author

As an example, if we have a zarr dataset containing multiple data variables we could select out a single one using eg.

xds = xds_from_zarr("test_I.mds.zarr", columns='MODEL')

In [6]: xds
Out[6]:
[<xarray.Dataset>
 Dimensions:  (band: 4, x: 484, y: 484)
 Dimensions without coordinates: band, x, y
 Data variables:
     MODEL    (band, x, y) float64 dask.array<chunksize=(1, 484, 484), meta=np.ndarray>
 Attributes:
     cell_rad:  5.43239476512341e-05
     dec:       0.5235987755982988
     nband:     4
     nx:        484
     ny:        484
     ra:        0.0]

Maybe we can come up with a command line syntax eg

$ tigger path/to/.zarr::COLNAME

or whatever. Happy to discuss the required format here.

@bennahugo
Copy link
Collaborator

bennahugo commented Jul 14, 2022 via email

@landmanbester
Copy link
Author

We can in principle duplicate the full header as attributes of the dataset, not sure how much more conformant one could be. Converting to a fits file still duplicates the image data so won't really solve the problem. In fact I already have a utility for that

@landmanbester
Copy link
Author

This https://github.com/ratt-ru/xarray-fits should make this much easier

@razman786
Copy link
Collaborator

razman786 commented Apr 6, 2024 via email

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

No branches or pull requests

3 participants