imexam icon indicating copy to clipboard operation
imexam copied to clipboard

view() does not actually accept a header

Open darthoctopus opened this issue 6 years ago • 3 comments

Although the documentation suggests that I can pass a FITS header to the view() method, actually attempting to do so yields TypeError: view() got an unexpected keyword argument 'header'

darthoctopus avatar May 04 '18 00:05 darthoctopus

Thankyou for the bug report! The documentation here is wrong.

view() is meant to display a numpy array to either the DS9 or Ginga window.

imexam.view() --> displays an in-memory numpy array imexam.load_fits(filename) --> loads and displays a fits image

If you would like to look at a fits header, you can use the standard fits syntax or from an already displayed image, imexam.get_header()

cheers

sosey avatar May 04 '18 14:05 sosey

I think it's a worthwhile feature to consider having. the main utility of this would be to pass a FITS header to the viewer for use in conjunction with a numpy array, rather than retrieving one from the current view (e.g. one could reduce a frame in memory, but use the coordinate system & flux calibration from the raw FITS file to do analysis with DS9)

darthoctopus avatar May 04 '18 20:05 darthoctopus

That could be interesting, but as far as I know the XPA interface that needs to be used to talk with DS9 doesn't allow for this. You might consider opening an issue over in the DS9 repository. As a secondary option, you could always write the array you processed back to the fits file and then load it as a whole for further analysis, as long as you update the header information for any pixel rescaling or resampling that has occurred that might be okay. You might also consider checking out the Ginga toolkit: https://ginga.readthedocs.io/en/latest/

sosey avatar May 07 '18 13:05 sosey