rabrahm / ceres

A set of pipelines and routines for echelle spectrographs
MIT License
39 stars 27 forks source link

Problem with wavelength calibration #12

Open sousasag opened 7 years ago

sousasag commented 7 years ago
Wavelength solution of ThAr calibration spectra:

Traceback (most recent call last): File "ferospipe.py", line 569, in fref = ThAr_Ne_ref[sorted_ThAr_Ne_dates[0]] IndexError: index 0 is out of bounds for axis 0 with size 0

I was trying to reduce some rather old FEROS data (Sep 2004). And from what I debugged from the code, it seems that the problem is connected with the WAVE files that I have for this data.

dfits *.fits | fitsort OBJECT "HIERARCH ESO DPR TYPE" "HIERARCH ESO INS CALMIRR2 ID" DATE | grep WAVE
FEROS.2004-09-20T19:40:45.367.fits  WAVE            WAVE                    LAMP1                           2004-09-20T19:40:49.888 
FEROS.2004-09-20T19:41:43.175.fits  WAVE            WAVE                    LAMP1                           2004-09-20T19:41:47.732 
FEROS.2004-09-20T19:42:47.432.fits  WAVE            WAVE                    LAMP1                           2004-09-20T19:43:04.059 
FEROS.2004-09-20T19:43:56.876.fits  WAVE            WAVE                    LAMP1                           2004-09-20T19:44:13.519 
FEROS.2004-09-20T19:45:16.194.fits  WAVE            WAVE                    LAMP1                           2004-09-20T19:45:47.588 
FEROS.2004-09-20T19:46:43.151.fits  WAVE            WAVE                    LAMP1                           2004-09-20T19:47:14.934

During the classification of the files, it seems these WAVEs are stored some where, but then the wavelenght calibration seems to be only working when you have WAVEs with LAMP3.

Is this something that can be easily fixed?

rabrahm commented 7 years ago

The default LAMP for FEROS is LAMP3 and LAMP1 is almost not used anymore. However, I think a possible workaround will be to slightly modify lines 234 and 238 of ferosutils.py:

if h[0].header['HIERARCH ESO INS CALMIRR2 ID'] == 'LAMP1': to if h[0].header['HIERARCH ESO INS CALMIRR2 ID'] == 'LAMP3':

and

elif h[0].header['HIERARCH ESO INS CALMIRR2 ID'] == 'LAMP3': to elif h[0].header['HIERARCH ESO INS CALMIRR2 ID'] == 'LAMP1':

sousasag commented 7 years ago

Hi,

That did the trick. I wasn't sure if these different WAVE would required different procedure. Apparently not, which leads me to the question, why make the distinction on the file selection? I guess, for a given dataset you will either have LAMP1 or LAMP3.

And on another subject. Some question/sugestions:

Thanks!

ganesh1076 commented 1 year ago

Wavelength Calibration for PFS is not working properly or I am missing something. I have a Lamp spectrum with binning '1x1' and 64 orders whereas in the ceres line list it has 66 orders. Also, the orders in my data start from the 0th order 3896-3938 A and 63rd order from 6540-6611A. This is inverse in the line list for a lamp. Can you please suggest to me how to get a proper wavelength solution? Thanks.