soxs_straighten

This recipe takes the full dispersion map given by soxs_spatial_solution and uses it to map images from their original representation of the detector surface to one that presents the signal in a wavelength by slit-position coordinate system.

Input

Data Type

Content

Related OB

CSV File

Coefficients of polynomials providing a full dispersion-spatial solution

FITS Image

An associated spectral image requiring rectification

Many

Parameters

Parameter

Description

Type

Entry Point

Related Util

straighten_grid_res_wavelength

size of the grid cell in wavelength dimension (nm)

float

settings file

straighten_grid_res_split

size of the grid cell in slit dimension (arcsec)

float

settings file

Method

We now have a pair of polynomials that can be used to give the exact pixel on the detector containing flux resulting from a specific order, with a given wavelength and slit position.

\[\begin{split} X = \sum\limits_{ijk} c_{ijk} \times n^i \times \lambda^j \times s^k \\ \end{split}\]
\[\begin{split} Y = \sum\limits_{ijk} c_{ijk} \times n^i \times \lambda^j \times s^k \\ \end{split}\]

To begin we want to create a full wavelength and slit-position map; a 2D grid of wavelengths along one axis and slit-position along the other. Using the polynomial solutions above, we populate each cell in the grid with its corresponding detector pixel coordinate. The 2D grid is of fine enough resolution so that many cells in the grid are mapped to each individual detector pixel. With this map in hand we can now assign flux recorded in each detector pixel to the corresponding cells in the 2D wavelength and slit-position grid. The flux from each detector is evenly distributed between all cells found to be associate with that pixel; so if 9 cells are associated then each cell gets 1/9th of the pixel flux.

The error and bad-pixel extensions go through the same mapping process.

Output

Data Type

Content

FITS Images

The straightened images containing flux represented in wavelength space; one for each order

QC Metrics

Metric

Description

TBC

Recipe API

class soxs_straighten(log, settings=False, inputFrames=[], verbose=False, overwrite=False, command=False, debug=False, turnOffMP=False)[source]

Bases: soxspipe.recipes.base_recipe.base_recipe

The soxs_straighten recipe

Initialization

clean_up(forceFail=False)[source]
clip_and_stack(frames, recipe, ignore_input_masks=False, post_stack_clipping=True)[source]
detrend(inputFrame, master_bias=False, dark=False, master_flat=False, order_table=False)[source]
flag_poor_data()[source]
get_recipe_settings()[source]
prepare_frames(save=False)[source]
produce_product()[source]

The code to generate the product of the soxs_straighten recipe

Return:

  • productPath – the path to the final product

Usage

from soxspipe.recipes import soxs_straighten
recipe = soxs_straighten(
    log=log,
    settings=settings,
    inputFrames=fileList
)
straightenFrame = recipe.produce_product()
qc_median_flux_level(frame, frameType='MBIAS', frameName='master bias', medianFlux=False)[source]
qc_ron(frameType=False, frameName=False, masterFrame=False, rawRon=False, masterRon=False)[source]
report_output(rformat='stdout')[source]
subtract_mean_flux_level(rawFrame)[source]
update_fits_keywords(frame, rawFrames=False)[source]
verify_input_frames()[source]

verify the input frame match those required by the soxs_straighten recipe

Return:

  • None

If the fits files conform to the required input for the recipe, everything will pass silently; otherwise, an exception will be raised.

xsh2soxs(frame)[source]