DQInspect
saves the current X and Y positions in self.xcen
and self.ycen
. Given that Ginga can concurrently display images of different sizes, the coordinates may be invalid when user switches to another (possibly smaller) image. When this happens, the following traceback will appear:
2015-11-24 15:43:05,497 | E | GwMain.py:74 (update_pending) | gui error: index 1903 is out of bounds for axis 0 with size 800
2015-11-24 15:43:05,499 | E | GwMain.py:78 (update_pending) | Traceback:
File ".../ginga/gw/GwMain.py", line 69, in update_pending
res = future.thaw(suppress_exception=False)
File ".../ginga/misc/Future.py", line 36, in thaw
res = self.method(*self.args, **self.kwdargs)
File ".../stginga/plugins/DQInspect.py", line 332, in redo
pixval = data[int(self.ycen), int(self.xcen)]
This can be recreated by opening two images with different dimensions (say, one fullframe and one subarray). Start the plugin. Set X and Y positions to a place on the fullframe that would be out of range for the subarray. Switch display to subarray.
This can also be recreated by just selecting X and Y positions that are out of range on the same image.
Suggested solution 1: Automatically set the offending coordinate to max allowed value based on the size of the newly selected image. (What if user is angry at losing the existing values?)
Suggested solution 2: Issue an error a warning message in the log and do nothing.