Closed jortiz12 closed 2 years ago
It's because your image has units ('erg / (Angstrom cm2 s)'), which is not the case for the tutorial image. So your should create a Gaussian/Moffat image with the same unit, i.e.:
gfitim = gauss_image(wcs=source.wcs, gauss=gfit, unit=source.unit)
Then the subtraction should work.
Another workaround when dealing with unit issues is to do the operation with a Numpy array instead of the Mpdaf object. Here you could use source - gfitim.data
(don't use this for object that have a variance array, which is not the case for the gfitim
image).
Much appreciated Simon.
Un Saludo
José A. Ortiz
On Tue, Jul 12, 2022 at 6:06 PM Simon Conseil @.***> wrote:
It's because your image has units ('erg / (Angstrom cm2 s)'), which is not the case for the tutorial image. So your should create a Gaussian/Moffat image with the same unit, i.e.:
gfitim = gauss_image(wcs=source.wcs, gauss=gfit, unit=source.unit)
Then the subtraction should work. Another workaround when dealing with unit issues is to do the operation with a Numpy array instead of the Mpdaf object. Here you could use source
- gfitim.data (don't use this for object that have a variance array, which is not the case for the gfitim image).
— Reply to this email directly, view it on GitHub https://github.com/musevlt/mpdaf/issues/28#issuecomment-1181957473, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUYA6TZFHUSIGTZX3QN7QLVTWJXPANCNFSM53IKJ4VA . You are receiving this because you authored the thread.Message ID: @.***>
Dear MPDAF community,
I´m tryng to replicate the "Image Object tutorial" with a 3D MUSE Datacube:
Once sources (6) are detected, when trying to run the following,
, I get an error related to the coordinate units. Both, source and the fits have the same WCS coordinate system, so I'm not sure why I´m getting this error.
Thanks in advance. Jose