Closed SmirnGreg closed 2 years ago
Specifying different beams does not change the final value (as expected)
cube1 = cube.with_beam(Beam(1e-10*u.arcsec)).to(u.K)
cube2 = cube.with_beam(Beam(1e-3*u.arcsec)).to(u.K)
np.nanmax((cube1/cube2).filled().value)
#Out[31]: 1.0
np.nanmin((cube1/cube2).filled().value)
#Out[32]: 1.0
OK, right, the problem is that a cube with Jy/sr units can't convert to K, but it should be able to. I think this is an easy fix. Thanks for identifying it.
and I think your fix is right; that looks like a logical error. Would you be willing to submit a PR removing or has_perangarea
from that statement and add a test of a Jy/sr->K conversion?
Hello!
I am getting, to my understanding, a false alarm from
SpectralCube.to()
.I have modeled data in Jy/sr units with rest frequency in the file header (
RESTFREQ
) and frequency axis in Hz. The data have no beam as it was never smoothed. Now, I want to convert Jy/sr to K, which seems to me as a trivial problem knowing the frequencies of the channel.13CO J=3-2_image.zip
The check appears here:
https://github.com/radio-astro-tools/spectral-cube/blob/7d0b9c7b1ef9259fa698af954a1087b24ddf5acf/spectral_cube/cube_utils.py#L661-L664
Can
or has_perangarea
just be omitted here? If the beam is involved neither in the original cube unit nor in the target unit, would anyone need it for the transformation?Thanks for checking this.