You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In lines 373 ~ 376 at radmc3dPy/image.py, radmc3dImage.writeFits() has a wrong unit conversion for images which has been convolved by radmc3dImage.imConv().
if len(self.fwhm) == 0:
# Conversion from erg/s/cm/cm/ster to Jy/pixel
conv = self.sizepix_x * self.sizepix_y / (dpc * nc.pc)**2. * 1e23
else:
# If the image has already been convolved with a gaussian psf then self.image has
# already the unit of erg/s/cm/cm/beam, so we need to multiply it by 10^23 to get
# to Jy/beam
conv = 1e23
In the convolved radmc3dImage object returned by imConv(), its self.image still has the unit of erg/s/cm/cm/ster. In fact, this design is consistent with the behavior of image.plotImage(bunit='jy/beam'), which correctly first convert the values in self.image from erg/s/cm/cm/ster to Jy/pixel, and then convert it to Jy/beam in lines 1466 ~1487. This bug in radmc3dImage.writeFits() could be fixed by changing things to
if len(self.fwhm) == 0:
# Conversion from erg/s/cm/cm/ster to Jy/pixel
conv = self.sizepix_x * self.sizepix_y / (dpc * nc.pc)**2. * 1e23
else:
# Conversion from erg/s/cm/cm/ster to Jy/beam
beam_area_sqasec = self.fwhm[0] * self.fwhm[1] * np.pi / 4. / np.log(2.0)
beam_area_sr = beam_area_sqasec * (np.pi/180./3600.)**2
conv = beam_area_sr * 1e23
The text was updated successfully, but these errors were encountered:
thanks for pointing this out. This is a Python package that I did not write, so it is hard for me to judge what the author meant with this. But it does seem you are right. I'll keep this issue open and see if someone else (who uses radmc3dPy with the convolution) confirms your suggestion. Then I'll build it in the way you suggest.
In lines 373 ~ 376 at radmc3dPy/image.py,
radmc3dImage.writeFits()
has a wrong unit conversion for images which has been convolved byradmc3dImage.imConv()
.In the convolved
radmc3dImage
object returned byimConv()
, itsself.image
still has the unit of erg/s/cm/cm/ster. In fact, this design is consistent with the behavior ofimage.plotImage(bunit='jy/beam')
, which correctly first convert the values inself.image
from erg/s/cm/cm/ster to Jy/pixel, and then convert it to Jy/beam in lines 1466 ~1487. This bug inradmc3dImage.writeFits()
could be fixed by changing things toThe text was updated successfully, but these errors were encountered: