radio-astro-tools / spectral-cube

Library for reading and analyzing astrophysical spectral data cubes
http://spectral-cube.rtfd.org
BSD 3-Clause "New" or "Revised" License
98 stars 65 forks source link

air wavelengths and vacuum correction #480

Open dawnerb opened 6 years ago

dawnerb commented 6 years ago

I have a cube for which the spectral axis is the air wavelength. After being puzzled for a while as to why the conversion of the spectral axis to velocity didn't agree with my calculation, I looked at the code and found that if the AWAV parameter is present in the header the spectral axis is converted to vacuum before the velocity conversion. Two questions about this:

  1. It would be great if it were stated in the documentation that this is happening, since it took a while to figure out what was going on.

  2. The air-to-vacuum conversion applied uses standard temperature and pressure, which isn't appropriate to spectra calibrated from line lists measured at high altitude observatories. Is it possible to allow the user to control how the vacuum correction is performed through something like the ref_index package?

I know air wavelengths aren't supported, but unfortunately many optical pipelines still use them.

keflavich commented 6 years ago

Adding it to the docs is certainly important; I had overlooked it because I haven't encountered an air wavelength cube yet.

I think something like you suggest in (2) is possible, but I'm not immediately sure how. It probably is described in the FITS paper.

dawnerb commented 6 years ago

Thanks. I don't think that paper discusses how to change the correction, but the ref_index package I linked above is an example.