DavidT3 / XGA

X-ray: Generate and Analyse is a module designed to make the analysis of XMM observations simple and efficient. It provides an interface with SAS for the creation of XMM data products, as well as a way to easily perform fits (scalable for multiple observations) and retrieve information about an object, all within a Python package.
BSD 3-Clause "New" or "Revised" License
29 stars 3 forks source link

Add a smoothing section to the imagetools submodule #579

Open DavidT3 opened 3 years ago

DavidT3 commented 3 years ago

Ties in with issue #571 (hopefully), but first off will simply allow the easy creation of smoothed images using a gaussian kernel for instance. I will probably try and make a general function to base other functions off of, as Astropy has some great smoothing stuff already implemented - its just a case of making it work on my Images/RateMaps

DavidT3 commented 3 years ago

Must alter update_products to make sure smoothed ratemaps are automatically assembled

DavidT3 commented 3 years ago

This is doing what its meant to now, at least the initial implementation.

I am struggling to decide how the masking of images is to be handled. In many cases where we want to analyse the smoothed images (thinking of clusters for instance) it is proper that the point sources be removed BEFORE smoothing, or their emission will never be removed properly with the original masks.

However then that image shouldn't necessarily be used for another source's analysis. So I might make sure that smoothed images are only loaded into a source when the source name is identical in the inventory. I also might make a mask entry in the smoothed image fits files, so it can be compared to.

DavidT3 commented 3 years ago

It would also appear that the mask parameter which can be passed to astropy convolution requires the opposite of how I define XGA masks. I passed an interloper mask (1 everywhere but where the interlopers are), and this is the result:

image

I shall have to state how I expect the masks in the general_smooth function docstring (i.e. as XGA would output them), and then invert them before I pass them to the convolve function