soxspipe.commonutils.dispersion_map_to_pixel_arrays¶
use a first-guess dispersion map to convert wavelengths to pixels
- Author
David Young
- Date Created
April 15, 2021
Module Contents¶
Functions¶
Use a dispersion solution to convert wavelength, slit-position and echelle order numbers to X,Y pixel positions. |
|
find cached coefficients (if they exist) |
API¶
- soxspipe.commonutils.dispersion_map_to_pixel_arrays.dispersion_map_to_pixel_arrays(log, dispersionMapPath, orderPixelTable, removeOffDetectorLocation=True, trimColumns=False)[source][source]¶
Use a dispersion solution to convert wavelength, slit-position and echelle order numbers to X,Y pixel positions.
Return a line-list with x,y fits given a first guess dispersion map.*
Key Arguments:
log– loggerdispersionMapPath– path to the dispersion maporderPixelTable– a data-frame including ‘order’, ‘wavelength’ and ‘slit_pos’ columnsremoveOffDetectorLocation– if data points are found to lie off the detector plane then remove them from the results. Default TruetrimColumns– if True, only return the specified columns. Default False
Usage:
from soxspipe.commonutils import dispersion_map_to_pixel_arrays myDict = { "order": [11, 11, 11], "wavelength": [850.3, 894.3, 983.2], "slit_position": [0, 0, 0] } orderPixelTable = pd.DataFrame(myDict) orderPixelTable = dispersion_map_to_pixel_arrays( log=log, dispersionMapPath="/path/to/map.csv", orderPixelTable=orderPixelTable )
- soxspipe.commonutils.dispersion_map_to_pixel_arrays.get_cached_coeffs(log, arm, settings, recipeName, orderDeg, wavelengthDeg, slitDeg, reset=False)[source][source]¶
find cached coefficients (if they exist)
Return a line-list with x,y fits given a first guess dispersion map.*
Key Arguments:
log– loggerarm– the spectrograph arm.settingspipeline settings dictionaryrecipeName– the name of the recipe.orderDeg– the order degwavelengthDeg– wavelength degreeslitDeg– slit degreereset– always reset the coeffs. Don’t use cached. Default False
Usage:
from soxspipe.commonutils import get_cached_coeffs xcoeff, ycoeff = get_cached_coeffs( log=log, arm=arm, settings=settings, recipeName=recipeName, orderDeg=orderDeg, wavelengthDeg=wavelengthDeg, slitDeg=slitDeg )