-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
savefits_residim does not work #212
Comments
Thanks for reporting the problem. Indeed, the option was completely ignored. I've made a PR (#213) to fix it. The PR also adds an option ( |
Hi David,
Always happy to report bugs! I've recently returned to my pybdsf project and I have a query: where in the code is the total flux evaluated for gaussians? I've looked on github without success, but I assume this is not done deep in the gaussian fitting process as the total flux is not an obvious fit parameter. I ask because I have noticed that in some but not all circumstances the total flux is set equal to the peak flux if the deconvolved size is zero, not just when the fitted size is exactly equal to the model beam, but (usually) when it is smaller. This happened in a run with ini_gausfit = 'nobeam', if that's relevant. More usually, total flux < peak flux for sources with fitted size < beam. It would be useful to know exactly what triggers the switch.
Regards,
Paddy
…________________________________
From: David Rafferty ***@***.***>
Sent: 11 September 2023 15:18
To: lofar-astron/PyBDSF ***@***.***>
Cc: Patrick Leahy ***@***.***>; Author ***@***.***>
Subject: Re: [lofar-astron/PyBDSF] savefits_residim does not work (Issue #212)
Thanks for reporting the problem. Indeed, the option was completely ignored. I've made a PR (#213 [github.com]<https://urldefense.com/v3/__https://github.com/lofar-astron/PyBDSF/pull/213__;!!PDiH4ENfjr2_Jw!E_g9fiFT6dGC-Ob4qyIDwkDYNsXJqVPsgDKGQbC9RPnjrpTtBEioDHRGFagPMMqcgdJmmGmFVyVF5XN4s9cpGPZV7U9-y7Fz$>) to fix it. The PR also adds an option (savefits_modelim) for saving the Gaussian model image, since that was an easy related change.
—
Reply to this email directly, view it on GitHub [github.com]<https://urldefense.com/v3/__https://github.com/lofar-astron/PyBDSF/issues/212*issuecomment-1713983953__;Iw!!PDiH4ENfjr2_Jw!E_g9fiFT6dGC-Ob4qyIDwkDYNsXJqVPsgDKGQbC9RPnjrpTtBEioDHRGFagPMMqcgdJmmGmFVyVF5XN4s9cpGPZV7Rz5IRRU$>, or unsubscribe [github.com]<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/ARCPXBA7GFK2RSMCWIEBYODXZ4MRRANCNFSM6AAAAAA4PBF5IM__;!!PDiH4ENfjr2_Jw!E_g9fiFT6dGC-Ob4qyIDwkDYNsXJqVPsgDKGQbC9RPnjrpTtBEioDHRGFagPMMqcgdJmmGmFVyVF5XN4s9cpGPZV7UK3doB5$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
The total flux is calculated here: https://github.com/lofar-astron/PyBDSF/blob/master/bdsf/gausfit.py#L1043. There's a check just above (line 1021) that might be relevant for the issue you're seeing. It sets the size to the beam size in certain cases. But I don't see any obvious relation between what's done here and the value of |
Thanks for the quick reply!
…________________________________
From: David Rafferty ***@***.***>
Sent: 11 September 2023 16:05
To: lofar-astron/PyBDSF ***@***.***>
Cc: Patrick Leahy ***@***.***>; Author ***@***.***>
Subject: Re: [lofar-astron/PyBDSF] savefits_residim does not work (Issue #212)
The total flux is calculated here: https://github.com/lofar-astron/PyBDSF/blob/master/bdsf/gausfit.py#L1043 [github.com]<https://urldefense.com/v3/__https://github.com/lofar-astron/PyBDSF/blob/master/bdsf/gausfit.py*L1043__;Iw!!PDiH4ENfjr2_Jw!An0KJkQks-Puj6NEXzJ5y0rKITyXv3QQuPX9ASBJnmz04RQGhPqF6Tj5EgFoq4VnuHuQshC0nZ-6rs18_9eXs-eSY1qgXV7H$>. There's a check just above (line 1021) that might be relevant for the issue you're seeing. It sets the size to the beam size in certain cases. But I don't see any obvious relation between what's done here and the value of ini_gausfit. However, the logic surrounding all that is quite convoluted so it may be related somehow. The deconvolution is done just after the calculation of the total flux in line 1053.
—
Reply to this email directly, view it on GitHub [github.com]<https://urldefense.com/v3/__https://github.com/lofar-astron/PyBDSF/issues/212*issuecomment-1714076234__;Iw!!PDiH4ENfjr2_Jw!An0KJkQks-Puj6NEXzJ5y0rKITyXv3QQuPX9ASBJnmz04RQGhPqF6Tj5EgFoq4VnuHuQshC0nZ-6rs18_9eXs-eSYwZdTqaD$>, or unsubscribe [github.com]<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/ARCPXBDYBSKWJUVRUKZPLU3XZ4SEHANCNFSM6AAAAAA4PBF5IM__;!!PDiH4ENfjr2_Jw!An0KJkQks-Puj6NEXzJ5y0rKITyXv3QQuPX9ASBJnmz04RQGhPqF6Tj5EgFoq4VnuHuQshC0nZ-6rs18_9eXs-eSY5RpanSG$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
I set the savefits_residim option to True in process_image, but no such fits image is output. In the log file, this is not listed as a non-default input parameter (unlike savefits_rmsim, which is, and does produce an output image). I realize that I can use export_image to do this, but having the residual image generated automatically, in the appropriate subdirectory like the rms image, would be convenient!
The text was updated successfully, but these errors were encountered: