This is a really useful piece of code :) What I've managed to do is turn the masks into contours as I want to integrate the signal in specified regions. It turns out that the easiest way I've found (so far) is to hack matplotlib to do the job for me.
In the image on the left there's a faint radio galaxy at the field center. The mask output from breizorro is on the right. To integrate the signal from just that galaxy I only want to use the three masked areas near the middle. One can then hack matplotlib to click on the three masks that I want and then have it write out the contours for these masks. I then have a downstream program sum up the signal from inside the polygon regions, et voila -integrated flux densities. There's a nice python package called shapely which does all sorts of useful stuff with polygons which I use to sum up the signal inside the masked areas. The scikit-image package can also be used to generate the contours but I'm not aware that it provides the interactive selection capability that I want.
This is a really useful piece of code :) What I've managed to do is turn the masks into contours as I want to integrate the signal in specified regions. It turns out that the easiest way I've found (so far) is to hack matplotlib to do the job for me.
In the image on the left there's a faint radio galaxy at the field center. The mask output from breizorro is on the right. To integrate the signal from just that galaxy I only want to use the three masked areas near the middle. One can then hack matplotlib to click on the three masks that I want and then have it write out the contours for these masks. I then have a downstream program sum up the signal from inside the polygon regions, et voila -integrated flux densities. There's a nice python package called shapely which does all sorts of useful stuff with polygons which I use to sum up the signal inside the masked areas. The scikit-image package can also be used to generate the contours but I'm not aware that it provides the interactive selection capability that I want.