ddf-pipeline icon indicating copy to clipboard operation
ddf-pipeline copied to clipboard

refining galactic field masking

Open twshimwell opened this issue 2 years ago • 5 comments

For some galactic fields where there is not a lot of structure the galactic default masking thresholds of 50 are far too high. For other galactic fields where there is an awful lot of structure the masking of the residual image (MakeMask.py --RestoredIm=image_dirin_SSD.residual01.fits --Th=20 --Box=50,2 --OutMaskExtended MaskDiffuse --OutNameNoiseMap Noise) essentially masks the entire field.

Seems like something wiser should be done to more routinely get appropriate masks for these galactic fields.

twshimwell avatar Nov 09 '22 10:11 twshimwell

Can you show an image of the field?

cyriltasse avatar Nov 09 '22 10:11 cyriltasse

Top example of field and corresponding mask where every thing gets masked (this is MaskDiffuse.fits which is the most problematic).

Bottom example is a field again on the galactic plane but with no big structures and here the threshold of 50 is too high for things to get deconvolved.

Screenshot 2022-11-09 at 11 43 44

Screenshot 2022-11-09 at 11 42 34

twshimwell avatar Nov 09 '22 10:11 twshimwell

By changing the threshold and box size I can make the mask of the galactic one much better. Example below is left Threshold 50, box 200,2. Right is threshold 50, box 50,2. But might be also nice to change the MaskExtended=(self.Noise<0.1*np.median(self.Noise)) in makemask to make the 0.1 an input parameter.

Screenshot 2022-11-09 at 11 48 15

twshimwell avatar Nov 09 '22 10:11 twshimwell

Perhaps this is a very tedious solution but what do you think about the idea of just having a large manually drawn ds9 region file that has all the galactic diffuse emission and just input this same file for all ddf-pipeline galactic runs? It would be quite painful to make but could be built up gradually when feeling enthusiastic. For the galactic fields we could then turn off the MaskDiffuse bit which is the bit that generally goes a bit wrong. We could also lower the masking threshold (presently 50) to try to get more compact sources in.

twshimwell avatar Nov 11 '22 09:11 twshimwell

Could also put various other objects in it and then just use the ds9 file for all runs...

twshimwell avatar Nov 11 '22 09:11 twshimwell