input masks

Issue #8 wontfix
Lorrie Straka created an issue

since you prefer this forum...

I was wondering if it would be difficult to slightly modify the requirements for the input masks. I believe (and I may be mistaken) that the required format is 0 for unmasked pixels and 1 for masked pixels. How about 0 for unmasked and accepting ANY other number for masked? In this way you'd be able to directly input maps from, say, SExtractor (segmentation or object images), which uses numbers >1 for multi-object fields...

Just a thought.

Comments (2)

  1. Christian Herenz repo owner

    What about a little python-snippet like this, which will convert your masks accordingly.

    from astropy.io import fits
    hdu = fits.open('sextractor-segmentation-map.fits')
    data = hdu[0].data
    select = data >= 1
    fits.writeto('mask-map.fits',data=select,header=hdu[0].header)
    

    Untesteted - but something like this should convert a segmentation map into a mask that lsd-cat chews.

  2. Christian Herenz repo owner

    feel free to open again if you would like to see this as a feature of LSDCat - but for now I will close this, given that above snippet should somehow do the job.

  3. Log in to comment