jobovy / apogee

Tools for dealing with APOGEE data
BSD 3-Clause "New" or "Revised" License
43 stars 25 forks source link

Added wavelength to pixel and pixel to wavelength conversion functions #35

Closed npricejones closed 8 years ago

npricejones commented 8 years ago

for the apStar and aspcapStar wavegrids

jobovy commented 8 years ago

I tested this for the apStarWavegrid=True setting and am getting the following relation:

pixs= numpy.arange(8575)
wavs= pix2wv(pixs,apStarWavegrid=True)

and am getting this: test which I don't think is correct (but maybe would be correct if the x-axis were reversed?). pix2wv with the ASPCAP grid seems to do the same: test

The other way around wv2pix also seems to reverse the pixels, so perhaps this is just a matter of the definition of pixel.

npricejones commented 8 years ago

I've updated the code to reflect the appropriate definition for pixel, I think I was still going on http://www.sdss.org/dr12/irspec/spectra/ which had me doing things in reverse.

jobovy commented 8 years ago

This all looks good and seems to pass my basic tests. I left some minor comments, but after that I think it's ready to merge.

jobovy commented 8 years ago

Thanks for the changes, I'll merge this in. I guess we should add some documentation of these in the README as well at some point (although the documentation in the README is getting somewhat out of hand...)