spacetelescope / imexam

imexam is a python tool for simple image examination, and plotting, with similar functionality to IRAF's imexamine
http://imexam.readthedocs.io
BSD 3-Clause "New" or "Revised" License
75 stars 45 forks source link

Cycle through fits images with load_fits without erasing the ds9 frame? #174

Open iskren-y-g opened 5 years ago

iskren-y-g commented 5 years ago

Hi,

this is a minor thing, but I think that load_fits would benefit from having a parameter to disable/enable the refresh of the ds9 frame? This will be useful for when I want to cycle through a list of fits images and display them one after each other. Now after load_fits I need to invoke zoomtofit() and scale(). I can achieve this with view(img), however, I wanted to skip one step of using fits.getdata.

For example, this works as I want it and is nice to just watch it on ds9:

img_lst = glob.glob("tmp*.fits")
for img in img_lst:
      ds9.view(fits.getdata(img))
      ds9.scale()

But the following is not nice to just watch. However, it is ~30% faster:

for img in img_lst:
     ds9.load_fits(img)
     ds9.zoomtofit()
     ds9.scale()

Cheers, Iskren