soxs_spatial_solution¶
The soxs_spatial_solution recipe enhances the wavelength solution achieved with soxs_disp_solution by expanding the solution into the spatial dimension (along the slit). The resulting 2-dimensional solution accounts for any tilt in the spectral lines relative to the cross-dispersion axis. The recipe is similar in logic to soxs_disp_solution, but now samples arc lines along the slit in the cross-dispersion direction using a multi-pinhole slit mask.
Input¶
Data Type |
Content |
Related OB |
|---|---|---|
FITS Image |
Arc Lamp through multi-pinhole mask |
|
FITS Image |
Master Dark Frame (VIS only, optional) |
- |
FITS Image |
Master Bias Frame (VIS only) |
- |
FITS Image |
Master Flat Frame (optional) |
- |
FITS Image |
Dark frame (Lamp-Off) of equal exposure length as multi-pinhole frame (Lamp-On) (NIR only) |
|
FITS Table |
First-guess Dispersion map table |
Data Type |
Content |
|---|---|
FITS images |
Default bad-pixel map |
FITS Binary Table |
A spectral format table for the detector, giving the minimum and maximum wavelengths covered by each spectral order. |
FITS Binary Table |
An arc-lamp line list. This table gives the predicted x, y pixel position that each arc line is expected to appear near for each spectral order and pinhole in the multi-pinhole mask. |
Parameters¶
Parameter |
Description |
Type |
Entry Point |
Related Util |
|---|---|---|---|---|
|
divide image by master flat frame |
bool |
settings |
- |
|
fit and subtract the intra-order background light |
bool |
settings |
|
|
the size of the square window used to search for an arc-lamp emission line, centred on the predicted pixel position of the line |
int |
settings |
|
|
minimum significance required for arc-line to be considered ‘detected’ |
float |
settings |
|
|
degree of echelle order number component of global polynomial fit to the dispersion solution [x, y] |
int/list |
settings file or command-line |
|
|
degree of wavelength component of global polynomial fit to the dispersion solution [x, y] |
int/list |
settings file or command-line |
|
|
degree of slit position component of global polynomial fit to the dispersion solution [x, y] |
int/list |
settings file or command-line |
|
|
number of sigma-clipping iterations to perform before settings on a polynomial fit for the dispersion solution |
int |
settings |
|
|
sigma clipping limit when fitting global polynomial to the dispersion solution |
float |
settings |
|
|
clipping performed on multi-pinhole sets (true) or individual pinholes (false) |
bool |
settings |
|
|
maximum distance allowed from the pixel centre when calculating wavelength, order and slit-position for 2d disp-sol image |
float |
settings |
|
|
full multi-pinholes sets (same arc line) with fewer than mph_line_set_min lines detected get clipped |
int |
settings |
|
|
degree of bsplines used to fit the inter-order background (if |
int |
settings file |
|
|
Standard deviation of Gaussian kernel used to smooth background image (if |
int |
settings file |
Method¶
The algorithm used in the soxs_spatial_solution recipe is shown in Fig. 47.
Having prepared the multi-pinhole frame, the bias and dark signatures are removed, and the frame is divided through by the master flat frame. The calibrated frame and the first-guess dispersion map are passed to the create_dispersion_map utility, arc-lines from a static line-list are detected and fitted to produce a 2D dispersion solution covering both the spectral and spatial dimensions. Note that saturated arc-lines are either absent from the input line-list file or get clipped during the fitting process and so are not included in the final dispersion solution fitting.
A three-extension FITS image with the same format as the detector is created using the complete dispersion solution. The first extension contains the wavelength values for each pixel, the second the slit positions, and the third the echelle order number.
Fig. 47 The soxs_spatial_solution recipe algorithm. At the top of the diagram, NIR input data is found on the right and VIS on the left.¶
Output¶
Label |
Content |
Data Type |
PRO CATG |
PRO TYPE |
PRO TECH |
|---|---|---|---|---|---|
|
Full dispersion-spatial solution |
FITS |
|
|
|
|
2D detector map of wavelength, slit position and order |
FITS |
|
|
|
|
Fitted intra-order image background |
- |
- |
- |
|
|
Dispersion solution fitted lines |
FITS |
- |
- |
- |
|
Undetected arc lines |
FITS |
- |
- |
- |
|
Dispersion solution QC plots |
- |
- |
- |
QC Metrics¶
Label |
Description |
Unit |
Acceptable Range |
|---|---|---|---|
|
Total number of detected lines clipped during solution fitting |
lines |
- |
|
Number of lines detected in single pinhole frame |
lines |
- |
|
Proportion of input line-list lines detected on single pinhole frame |
VIS: [0.95,1.0] |
|
|
Total number of line in single line-list |
lines |
- |
|
Proportion of good, unclipped lines in single pinhole frame |
lines |
VIS: [0.55,1.0] NIR: [0.4,1.0] |
|
The minimum number of pinholes found across all orders (should be 9) |
pinholes |
VIS: 9, NIR: 9 |
|
Maximum residual in fitting of pinholes along x-axis (global) |
pixels |
- |
|
Minimum residual in fitting of pinholes along x-axis (global) |
pixels |
- |
|
Median of absolute residuals in fitting of pinholes along x-axis (global) |
pixels |
- |
|
Std-dev of residuals in fitting of pinholes along x-axis (global) |
pixels |
VIS: [0,0.25], NIR: [0,0.42] |
|
Maximum residual in fitting of pinholes along y-axis (global) |
pixels |
- |
|
Minimum residual in fitting of pinholes along y-axis (global) |
pixels |
- |
|
Median of absolute residuals in fitting of pinholes along y-axis (global) |
pixels |
- |
|
Std-dev of residuals in fitting of pinholes along y-axis (global) |
pixels |
VIS: [0,0.48], NIR: [0,0.12] |
|
Maximum residual in fitting of pinholes (global) |
pixels |
- |
|
Minimum residual in fitting of pinholes (global) |
pixels |
- |
|
Median residual in fitting of pinholes (global) |
pixels |
VIS: [0,0.7], NIR: [0,0.3] |
|
Std-dev of residuals in fitting of pinholes (global) |
pixels |
VIS: [0,0.5], NIR: [0,0.4] |
|
Median difference between observed and predicted pinhole detector locations along the x-axis (global) |
pixels |
- |
|
Standard deviation in difference between observed and predicted pinhole detector locations along the x-axis (global) |
pixels |
- |
|
SMedian difference between observed and predicted pinhole detector locations along the y-axis (global) |
pixels |
- |
|
Standard deviation in difference between observed and predicted pinhole detector locations along the y-axis (global) |
pixels |
- |
|
Median difference between observed and predicted pinhole detector locations (global) |
pixels |
- |
|
Standard deviation of difference between observed and predicted pinhole detector locations (global) |
pixels |
- |
|
Median FWHM of detected lines in pinhole frames (global) |
pixels |
VIS: [1.60,1.72], NIR: [1.55,1.85] |
|
Standard deviation in FWHM of detected lines in pinhole frames (global) |
pixels |
VIS: [0.0,0.16], NIR: [0.0,0.145] |
|
Median spectral resolution measured from detected lines in pinhole frames (global) |
- |
|
|
Maximum residual in fitting of pinholes along x-axis (order N) |
pixels |
- |
|
Minimum residual in fitting of pinholes along x-axis (order N) |
pixels |
- |
|
Median of absolute residuals in fitting of pinholes along x-axis (order N) |
pixels |
- |
|
Std-dev of residuals in fitting of pinholes along x-axis (order N) |
pixels |
- |
|
Maximum residual in fitting of pinholes along y-axis (order N) |
pixels |
- |
|
Minimum residual in fitting of pinholes along y-axis (order N) |
pixels |
- |
|
Median of absolute residuals in fitting of pinholes along y-axis (order N) |
pixels |
- |
|
Std-dev of residuals in fitting of pinholes along y-axis (order N) |
pixels |
- |
|
Maximum residual in fitting of pinholes (order N) |
pixels |
- |
|
Minimum residual in fitting of pinholes (order N) |
pixels |
- |
|
Std-dev of residuals in fitting of pinholes along (order N) |
pixels |
- |
|
Median difference between observed and predicted pinhole detector locations along the x-axis (order N) |
pixels |
- |
|
Standard deviation in difference between observed and predicted pinhole detector locations along the x-axis (order N) |
pixels |
- |
|
SMedian difference between observed and predicted pinhole detector locations along the y-axis (order N) |
pixels |
- |
|
Standard deviation in difference between observed and predicted pinhole detector locations along the y-axis (order N) |
pixels |
- |
|
Median difference between observed and predicted pinhole detector locations (order N) |
pixels |
- |
|
Median FWHM of detected lines in pinhole frames (order N) |
pixels |
- |
|
Standard-deviation in FWHM of detected lines in pinhole frames (order N) |
pixels |
- |
|
Median spectral resolution measured from detected lines in pinhole frames (order N) |
- |
Fig. 48 A QC plot resulting from the soxs_spatial_solution recipe. The top-left panel shows an SOXS VIS arc-lamp frame, taken with a multi-pinhole mask. The green circles represent arc lines detected in the image, and the blue circles and red crosses are lines that were detected but dropped because other pinholes of the same arc line were not detected, or because the lines were clipped during polynomial fitting. The grey circles represent arc lines reported in the static calibration table that were not detected in the image. The bottom-left panel shows the same arc-lamp frame with the dispersion solution overlaid as a blue grid. Lines travelling along the dispersion axis (left to right) are lines of equal slit position, and lines travelling in the cross-dispersion direction (top to bottom) are lines of equal wavelength. The top-right panel shows the residuals of the dispersion solution fit, and the bottom-right panel shows the resolution measured for each line (projected through the pinhole mask), with different colours for each echelle order and the mean order resolution in black.¶
Recipe API¶
- class soxs_spatial_solution(log, settings=False, inputFrames=[], verbose=False, overwrite=False, create2DMap=True, polyOrders=False, command=False, debug=False, turnOffMP=False)[source]¶
Bases:
soxspipe.recipes.base_recipe.base_recipeEnhance the wavelength solution achieved with
soxs_disp_solutionby expanding the solution into the spatial dimension (along the slit)Key Arguments
log– loggersettings– the settings dictionaryinputFrames– input fits frames. Can be a directory, a set-of-files (SOF) file or a list of fits frame pathsverbose– verbose. True or False. Default Falseoverwrite– overwrite the product file if it already exists. Default Falsecreate2DMap– create the 2D image map of wavelength, slit-position and order from disp solution.polyOrders– the orders of the x-y polynomials used to fit the dispersion solution. Overrides parameters found in the yaml settings file. e.g 345435 is order_x=3, order_y=4 ,wavelength_x=5 ,wavelength_y=4, slit_x=3 ,slit_y=5. Default False.command– the command called to run the recipedebug– debug mode. True or False. Default FalseturnOffMP– turn off multiprocessing. True or False. Default False. If True, multiprocessing will be turned off and the recipe will run in serial. This is useful for debugging.
See
produce_productmethod for usage.Initialization
- produce_product()[source]¶
generate the 2D dispersion map
Return:
productPath– the path to the 2D dispersion map
Usage
from soxspipe.recipes import soxs_spatial_solution recipe = soxs_spatial_solution( log=log, settings=settings, inputFrames=fileList ) disp_map = recipe.produce_product()