radio-astro-tools / spectral-cube

Library for reading and analyzing astrophysical spectral data cubes
http://spectral-cube.rtfd.org
BSD 3-Clause "New" or "Revised" License
98 stars 65 forks source link

Interface with cngi xarr #740

Open keflavich opened 3 years ago

keflavich commented 3 years ago

CNGI is using xarr objects as their main data object, and their plan is to keep the code base entirely functional (not object-oriented).

We should make sure that all CNGI functions can either work directly on spectral-cube objects or can be easily interfaced, e.g., cngi_function(cube.xarr).

This page holds the closest thing available to a spec & test right now: https://cngi-prototype.readthedocs.io/en/latest/images.html

keflavich commented 3 years ago

Alright, this is much harder than I thought. The CNGI approach is to evaluate everything at import time, which means there's no serial storage of the WCS. We can only provide an interface to the pre-computed values, which kind of kills all of the coordinate transformations that make spectral-cube nice.

https://github.com/casangi/cngi_prototype/blob/9a2333076db876deaa4d1c90f3a5bf0fdd267064/cngi/conversion/convert_image.py#L109-L134

keflavich commented 3 years ago

yeah, without a serialization of the WCS, none of the io functions work, so I don't see a point in trying to push this.