xtellcor : construct kernel -- dealing with missing orders or doublets.

In the help files, you are told that Pa δ contains the least contamination and therefore should be used for constructing the kernel. In cases where this feature shows a doublet, or if you weren't able to save order 6 (the order that has that particular feature), then you need to use a different feature on another order.

ORDER 5: Generally least contaminated feature is Pa β as shown (Vacca et. al. 2003):

A fit with a polynomial of degree 3 should work just fine (tested on several objects, and data was arguably identical as when done with Pa δ in order 6), and should look a bit like this:

ORDER 4: After a bit of testing, it seems that the best feature here is Br 11, as shown (Vacca et. al. 2003):

A fit with polynomials of degree 2 or 3 should work just fine. If Br 11 has a doublet, please skip it. Doublets are never good.

ORDER 3: this order seems to be particularly tricky. At this wavelength, the data starts becoming a bit noisier. The best feature here is Br γ, found at roughly 2.17µ but can often look very contaminated. The majority of the data that I've had to deal with have had contamination and therefore it would be wise to not deal with this order unless there are no other options. If order 3 is the only option, then choose Br γ in the location shown below (Vacca et. al. 2003):

This blog post should take care of dealing with construction of spectra. One more point: when normalizing the spectrum, a max deviation around 5% and RMS deviation around 2% is generally acceptable. If max deviation is in the 2% range, and RMS is in the 1% range, then you should expect to produce excellent data.