HERA-Team / hera_pspec

HERA power spectrum estimation code and data formats
http://hera-pspec.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
4 stars 3 forks source link

uvd_to_Tsys should check input vis_units and modify the vis_units on the output UVData. #351

Open aewallwi opened 2 years ago

aewallwi commented 2 years ago

utils.uvd_to_Tsys defined here

https://github.com/HERA-Team/hera_pspec/blob/4d2fe17e2015b02b16683b29e2fd5530066dfd7b/hera_pspec/utils.py#L1266

outputs a file with units of mK and assumes that input file is in units of Jy but does not perform any checks to ensure that the input file is actually in units of Jy (which can lead to spurious Tsys if it is not) and also does not change the vis_units of the output file for that matter so anyone reading it down the road will still think it is in units of Jy which are not supported units for a uvdata object.

we should explicitely set the vis_units string for this uvdata to mK and we should check that the input is in Jy.

jsdillon commented 1 year ago

Also, the doc string says that the output is in Kelvin, not mK, further adding to the confusion. There is a /1e3, so I think Kelvin is right.