Open cdeil opened 7 years ago
My colleague François-Xavier provided me with a Java executable to compute this WCS. I know he planned to release his HEALPix-related code under a LGPL licence, I will check if he can already provide me the source code.
Moving to v0.2 milestone, this isn't urgent. Still, @tboch - any news?
I have the Java source code available. I'll provide a Python version by end of this week. Where should I put this?
If you have time, you could add this directly to the hips
package.
Maybe a property or method on https://hips.readthedocs.io/en/latest/api/hips.HipsTileMeta.html would be a good location?
If you want @adl1995 to add it (and add tests / docstring), then you could just put the code you have in a https://gist.github.com/ and then @adl1995 will make a PR adding everything.
@tboch - Coming back to this: is it really possible to have a WCS for a HiPS tile?
If yes, I think this would be very nice. E.g. one could just use http://reproject.readthedocs.io/ to get a precise tile painting or tile generation if going the other way. And also for debugging, it's very nice to be able to add a WCS and e.g. open a tile in DS9 or check world and pixel coords from Python.
@cdeil : yes, it's possible, I have some working code I still have to properly validate. Should I create a different branch for this?
Yes, always work in a git branch.
Probably it's a function that makes a WCS or a Header object? Could go here: https://github.com/hipspy/hips/tree/master/hips/utils
If you have an implementation, validating shouldn't be too hard. Pick one or two example tiles and a few pixels in the tile and check their sky position from the WCS against the known sky position from HEALPix.
I don't have much time, but could also try to go back to hipspy
a bit in the next weeks and do some things.
@tboch - Do you have code for a WCS for the HiPS tile? Or should we move this from the v0.3 milestone (in the next weeks) to v1.0 (aka some time in the future)?
thanks to the work of @fxpineau and @bmatthieu3 , I have now a working and validated code (tested with Montage and reproject) to create a WCS for a given HiPS tile: https://gist.github.com/tboch/636913974763f462fb4b51e61e76ee67 It requires cdshealpix package.
Still have to write proper tests, and it will be ready for inclusion in the hips package
🎉
@tboch - I see you gave an example of a FITS WCS for a given FITS HIPS tile: https://hips.readthedocs.io/en/latest/drawing_algo.html#wcs-for-fits-tiles
Can you describe how it could be computed for any tile?
Maybe @adl1995 (or you if it's too complex) could add a function (e.g. in
hips/utils.py
or a new module) that returns such anastropy.wcs.WCS
for given HiPS tile parameters?I think that would be valuable to have, both for debugging and precise tile drawing (e.g.
reproject
just calls intowcslib
viaastropy.wcs.WCS
, so probably reprojecting a tile with WCS into any other sky image will just work with one call intoreproject
(and they have the slow flux conserving method also implemented, which is nice).