astronomyk / SimCADO

Other
4 stars 5 forks source link

Input images should be normalized before being resampled #29

Open miguelverdugo opened 6 years ago

miguelverdugo commented 6 years ago

https://github.com/astronomyk/SimCADO/blob/8be8e3fa6a7100ffd9038c3ed21c0923adfd2bf8/SimCADO/simcado/source.py#L2263

like that

    images[images<=flux_threshold]=0  #masking noise
    images=images/np.sum(images[images>flux_threshold])

see demo of the problem in emailed jupyter notebook

oczoske commented 6 years ago

Your suggestion would place the flux scaling entirely onto the side of the spectrum. lam, spec = sim.source.SED("spiral",filter_name='K', magnitude=20) is then the total magnitude of the image. This is appropriate if there is a single object in the field. I've leaned towards the image providing a zero point MAGZERO, putting the flux scaling on the side of the image. However, that interpretation is not fully implemented either, I think. For the lensing case I did some more scaling externally in the script...