.. _SIRIDSModel: Inverse Dispersion Solution Product ----------------------------------- Metadata ______________________ +--------------------------------------------+----------------------------------------------------------------------------------------------+ | Data product name | DpdSirIdsModel | +--------------------------------------------+----------------------------------------------------------------------------------------------+ | Data product custodian | SIR | +--------------------------------------------+----------------------------------------------------------------------------------------------+ | Name of the Schema file | .. raw:: html | | | | | | `euc-sir-IdsModel.xsd `_ | +--------------------------------------------+----------------------------------------------------------------------------------------------+ | Processing function using the data product | SIR | +--------------------------------------------+----------------------------------------------------------------------------------------------+ Proposed for inclusion in EAS/SAS ================================= This product is proposed for inclusion in the SAS: no This is an internal Data Product. Data product elements ===================== +--------------+----------------------------------------------+ | Header | object of type sys:genericHeader | +--------------+----------------------------------------------+ | Data | object of type sir:sirIdsModel | +--------------+----------------------------------------------+ | QualityFlags | object of type dqc:sqfPlaceHolder | +--------------+----------------------------------------------+ | Parameters | object of type ppr:genericKeyValueParameters | +--------------+----------------------------------------------+ Detailed description of the data product ======================================== .. DetailedDescStart The ``sirIdsModel`` describes the relation between spectra wavelengths and pixels on the detector. Given a spectrum, this model (combined with :ref:`sirOPTModel` and :ref:`sirCRVModel`) predicts on which pixel to find a specific :math:`\lambda`. The :math:`\lambda \longleftrightarrow pix` relationship is not linear and this relationship varies across the field of view; the mathematical description of this model is analogous to the description of the ``sirCRVModel``. Like the ``sirCRVModel`` does, the ``sirIDSModel`` operates within the SIR rotated layout. The XML file has the same structure. Each grism/tilt configuration is independently calibrated and the coefficients of each configuration are store the ``sirIdsModelOrders`` structure. The ``sirIdsModel`` collects all the ``sirIdsModelOrders`` available. Also in this case relevant items of ``sirIdsModelOrder``, are: * ``GWATilt``: the grism nominal tilt value (0, +4, -4); * ``ExtraTilt``: the extra tilt computed during calibration (not implemented yet); * ``SpectraOrder``: the list of ``sirIdsModelContent``, each item contains the geometrical description of a given spectrum order for the current grism (see description below). SpectraOrders description """"""""""""""""""""""""" For each spectral order, one Chebychev mono dimensional polynomial (of order :math:`N`) is used to compute the local relation between :math:`\lambda` (Angstrom) and pixel. .. math:: :name: idsmono \Delta d_{[mm]} = \sum_{k=0}^M \beta_{x,y,k} T_k\left(\lambda \right) :math:`\Delta d` is the displacement along the dispersion direction (in mm) between the lambda reference position and the input required :math:`\lambda`. Like in the sirCrvModel case the :math:`\beta` coefficients variation is described by a global 2D Chebychev polynomial .. math:: \beta_{x,y,k} = \sum_{i,j} b^{(k)}_{i,j} T_i(x)T_j(y) These :math:`\textbf{B}^{(k)} := \{ b^{(k)}_{i,j} \}` matrices are stored in the ``sirIdsModelContent`` structure, which contains: * ``Order``: the order of the spectrum (1 :sup:`st`, 0 :sup:`th`, 2 :sup:`nd`, ...) to model; * ``LocalModelDeg``: the degree of the Local ids model (:math:`M` in the equation :math:numref:`idsmono`); * ``LocalRanges``: the validity domain of the local Chebychev polynomial; range extremes are in Angstrom and they contain the blue and the red edges of the spectrum; * ``GlobalRanges``: the validity domain (along the 2 directions of the FOV) of the local 2D Chebychev polynomial. These range extremes are in ``mm`` * ``Model``: a list of ``specificDegreeMatrix``, each item of this list contains one :math:`\textbf{B}^{(k)}` matrix. If the local polynomial is of degree :math:`M`, the model will contain :math:`M+1` matrices. Each matrix is used to obtain one local coefficient :math:`\beta_{x,y,k}` in a given position (:math:`x,y`) of the FOV .. _Models-usage-example: Usage example """"""""""""" This example concatenates all the 3 models (OPT, CRV and IDS) to retrieve the pixel position of a given :math:`\lambda` for a given object (RA, Dec coordinates). **1.** Given an objects position (RA, Dec) the OpticalModel is used to obtain the mm position the reference lambda: .. math:: :label: ref_lambda_pos x_{ref}, y_{ref} **2.** This reference lambda position is used to obtain the set of local coefficients: :math:`\alpha_{0...N}` for the ``sirCRVModel`` and :math:`\beta_{0...N}` for the ``sirIDSModel``. .. math:: \alpha_{x_{ref},y_{ref},k} = \sum_{i,j} a^{(k)}_{i,j} T_i(x_{ref})T_j(y_{ref}) \quad k\in{0...N} .. math:: \beta_{x_{ref},y_{ref},k} = \sum_{i,j} b^{(k)}_{i,j} T_i(x_{ref})T_j(y_{ref}) \quad k\in{0...N} **3.** The displacement (in mm) wrt to the reference lambda is obtained applying the ``sirIdsModel`` .. math:: :label: disp_dist \Delta d = \sum_{k=0}^M \beta_{x,y,k} T_k\left(\lambda\right) **4.** The displacement correction (in mm) wrt to the ideal dispersion position is obtained applying the ``sirCrvModel`` .. math:: :label: xdisp_dist \Delta c = \sum_{k=0}^N \alpha_{x,y,k} T_k\left(\Delta d\right) **5.** Combining :eq:`ref_lambda_pos`, :eq:`disp_dist` and :eq:`xdisp_dist` we obtain the final position for the RGS000 and BGS000: .. math:: \begin{bmatrix} x_{\lambda} \\ y_{\lambda} \end{bmatrix} = \begin{bmatrix} x_{ref} \\ y_{ref} \end{bmatrix} + \begin{bmatrix} \Delta d \\ \Delta c \end{bmatrix}; and for RGS180 .. math:: \begin{bmatrix} x_{\lambda} \\ y_{\lambda} \end{bmatrix} = \begin{bmatrix} x_{ref} \\ y_{ref} \end{bmatrix} - \begin{bmatrix} \Delta d \\ \Delta c \end{bmatrix}. **6.** **NOT IMPLEMENTED YET**. If an extra tilt (:math:`\theta`) is computed and the ``sirPivotModel`` exist and extra rotation is applied. The pivot position is obtained by ``sirPivotModel`` .. math:: x_{pivot}, y_{pivot} and applied .. math:: \begin{bmatrix} x_{\lambda} \\ y_{\lambda} \end{bmatrix} = \begin{bmatrix} \cos(\theta) & -\sin(\theta) \\ \sin(\theta) & \cos(\theta) \end{bmatrix} \begin{bmatrix} x_{\lambda}-x_{pivot} \\ x_{\lambda}-x_{pivot} \end{bmatrix} + \begin{bmatrix} x_{pivot} \\ x_{pivot} \end{bmatrix}. **7.** The :ref:`sirDETModel`, which contains the correct detectors metrology, is used to convert the :math:`x_{\lambda},y_{\lambda}` position in mm into a pixel. .. DetailedDescEnd