Closed bjfultn closed 8 years ago
I'm noticing some pretty weird behavior with the wavelength solutions. Here is a comparison of the input solution vs. the output "wav_obs" column in the .mod file.
Here is a comparison of the "wav_obs" column in the .mod file with the wavelength solution stored in the CPS "vd" file corresponding to the same observation.
The standard CPS wavelength solution (used as an initial guess) is also quite different then the hires.wave
file that we have packaged with grand.
The output wavelength solutions in .mod files are 4th-order polynomials. This is true for both the observatory and stellar frames. I verified this for an hd4628 .mod file BJ created with iGrand. The fractional deviation from 4th order was less than 1e-10 for all pixels and all 100 Keck HIRES observations.
grand.F begins with an initial loop (15 iterations) that iteratively improves: the wavelength solution, a Gaussian LSF, and the template. The subroutine tweak_wls( ) adjusts the wavelength solution and then the subroutine polyfit_w( ) replaces the wavelength scale in wav_imn with a 4th order polynomial fit. I verified that polyfit_w( ) correctly fits a 4th order polynomial by implementing the algorithm in IDL and comparing with the intrinsic poly_fit( ) function in IDL.
After this initial loop, grand.F enters the main loop, where the wavelength is fixed to the 4th order polynomial determined above and the LSF is described by spline nodes instead of a Gaussian.
Look at grand residuals for HD4628 to look for discontinuities at the same places.
Here are the residuals for this order for HD4628. I don't see anything strange going on. The noise actually looks very white.
The wavelength solution in hires.wave is a 4th-order polynomial in the pixel range [20:4000]. There is a wavelength discontinuity between this central region and the edges at [0:19] and [4001:4020]. This is the origin of the artifacts in the comparison plots above. The simulated data replaces wavelengths in these edge regions with values obtained by extrapolating the 4th-order polynomial in the central region. Thus, the simulated wavelength scale can be exactly modeled by grand.F, which uses a 4th-order polynomial.
Compare CPS wavelength solution to grand wavelength solution