igrins / plp

IGRINS pipeline package v3
18 stars 16 forks source link

Contents of the output files #19

Open mveyette opened 7 years ago

mveyette commented 7 years ago

There isn't much documentation on the output of the pipeline and I'm having a little trouble parsing all the files. There also seems to be a lot of the same data in duplicate locations. I've gather that my telluric-corrected spectrum is in a file named something like SDCH_20161112_0026.spec_a0v.fits, with five extensions: telluric-corrected spectrum, wavelength, target spectrum, A0V spectrum, and a Vega spectrum. I'm left with two questions.

1) How do I figure out which A0V spectrum was used for telluric correction for each target?

2) Is there a quick way to get the variance of the telluric-corrected spectrum?

The 2nd and 3rd extensions of the .spec_a0v.fits are the same as the 2nd and 1st extensions of the .spec.fits file of the target, respectively. I've figured out that the telluric-corrected spectrum is nearly exactly = target / (A0V / Vega). If I choose the right A0V, I can just do the target/(A0V/Vega) myself and get nearly exactly what is in the .spec_a0v.fits file. So I could just propagate the variances myself, but that requires going through and confirming I am using the right A0V in each case. Knowing which A0V the pipeline used would make this easier and not a big deal.

Furthermore, the wavelengths in the .spec_a0v.fits file are the same as in the .spec.fits file. I would have guessed they would be the same as what is in the .wave.fits file for the A0V star because that has gone through a fine-tuning based on a telluric absorption model, correct?

leejjoon commented 7 years ago

Telluric correction (divide-a0v) in the pipeline is unfortunately very primitive. And I do not recommend to use it directly if telluric correction is critical for your science. The output is simply the target spectra divided by a nearby A0V (corrected by Vega model). It does not even try to match different wavelength solutions of target and A0V. And a simple Vega model is applied without correcting for doppler shift, etc.

For your question 1, there is no easy way for now. The information should be available in the header though. I will try to push the relevant changes soon.

The wanvelength solution of the target can be different from that of A0V, so the initial wavelength solution is kept for now (it does not mean that it is correct). I have been planning to fine-tune the wavelength solution of the target using its own telluric lines and/or OH lines, but this has not happened yet.

I know there is no proper documentation and some key features (e.g, proper telluric correction) are missing, but progress has been very slow. Any help/contribution will be very much appreciated.

mveyette commented 7 years ago

Thanks for the response.

For your question 1, there is no easy way for now. The information should be available in the header though. I will try to push the relevant changes soon.

Could you point me to the relevant keyword?

leejjoon commented 7 years ago

I meant that I will put it in the header by changing the code.

mveyette commented 7 years ago

Ah. Great!

leejjoon commented 7 years ago

This is now implemented in the new versions. See my comment at the end of following page.

https://github.com/igrins/plp/wiki/Plotting-spectra-&-divide-by-A0V

gully commented 7 years ago

So I too was confused about what is in the spec_flattened file, but dug around the code to find some more info and visualized the outputs. Here is what I came up with. Can you confirm if it is correct?

number title vector Interpretation
0 "flattened_spec" s_orig/continuum_array The original A0V flux, divided by an estimate for interpolated "continuum"
1 "wavelength" w The wavelength in micrometer
2 "fitted_continuum" continuum_array The estimated, interpolated continuum, fitted by avoiding telluric lines.
3 "mask" mask_array A mask array: 0 if pixels used in continuum estimation, 1 if pixels contain telluric absorption
4 "a0v_norm" a0v_array A model Vega spectrum (broad H lines) sampled at the IGRINS pixels-- no RV or vsini convolution
5 "model_teltrans" teltrans_array A forward model of Earth's atmospheric absorption sampled at IGRINS pixels
gully commented 7 years ago

Also, essentially we're assuming that the model for Vega is a perfect representation of all A0V stars. I can think of at least 2 ways that a Vega model is imperfect:

Here's what that might look like for a recessional velocity shift: vz_shift

I reckon 40 pix is ~ 90 km/s.

gully commented 7 years ago

Here's a version with rotational broadening (Gaussian Kernel, bandwidth h shown): vsini_shift