ejeschke / ginga

The Ginga astronomical FITS file viewer
BSD 3-Clause "New" or "Revised" License
121 stars 77 forks source link

Feature Request: Draw shape based on iso-flux contours #396

Open pllim opened 7 years ago

pllim commented 7 years ago

As requested by Elena Sacchi in Ginga unconference session in JWST Data Analysis Workshop II, it would be nice to draw a shape based on some iso-flux contour.

pllim commented 7 years ago

Note: This might overlap a bit with imexam functionality. Maybe we should wait to see how that imexam plugin works out first (c/c @sosey).

sosey commented 7 years ago

I don't think this overlaps too much, but would need to be implemented in both viewers (ginga and ds9). Are you talking about them hand-selecting anything or figuring out the contours based on some other user input and then just drawing? And by shape do you mean an astropy/region?

pllim commented 7 years ago

I didn't ask for a lot of details. It was just a single-line question asked during the workshop, which is what was recorded above. Naively, I would assume user wants to draw an irregular shape (in Ginga, it would use some kind of Path object, as Ginga has not yet adopted Astropy's region stuff) that follows the selected flux value (maybe +/- certain delta flux). Exactly how that flux is selected (by clicking or entering in a box), I am not sure. I am guessing user would expect something like http://matplotlib.org/examples/pylab_examples/contour_demo.html .

ejeschke commented 7 years ago

This could also possibly be done with an overlay, similar to the Overlays plugin, but confined to some area around the drawing region.

ejeschke commented 7 years ago

How does matplotlib represent contours internally? As polygons?

Wondering if you could represent a contour as a compound object made up of filled polygons.

pllim commented 7 years ago

Maybe we can go the lazy route and have such a plugin just overlay matplotlib contours somehow?