
 Copyright 2005, 2006 University of Leiden.

 This file is part of MIA+EWS.

 MIA+EWS is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.

 MIA+EWS is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with MIA; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

Calibration_Tools/README.txt

Last Change: Wed Jan 19 18:04:53 2005

This file describes the changes and additions by Frank Prygodda to
support Sci-Phot-Mode.  Note that this is only a simple solution that
does not take into account the different wavelength scales of
photometric and interferometric channels.  We also found that the
ratio of the fluxes is not constant.  Note also that the chopping
flags in the data are not taken into account in the interferometric
analysis, which causes problems for the selection of scans used to
compute the fringe signal and the noise.



xmidispvisi.pro
---------------

This version of 'xmidispvisi' supports the sci_phot channels.  Up to
now only PRISM data is supported.  It is fully backward compatible,
which means that the routine can be called with declaration of
photometric files like usual. In this case the 'xmidispvisi' is
calibrating the flux by using the photometric files like the previous
version.

The new feature is enabled, if no photometric files are given:
     x->obj_new('xmidivisi', fringefile)

(Note that you *have* to use the obj_new syntax, xmdv(fringefile) will
 search for photometric files itself and use them)

In this case, the fringefile must contain photometric channels.
The sciphot version is then using internally the subroutine 
'MIDIChopImageC' to create background subtracted photometric 
channels. Then 'chop_nod_disp_one_window' is used to perform
the trace along the dispersed spectrum and extraction of the flux. 

Note that the extraction of the photometric flux is done for the 
whole fringetrack sequence. There is no calibration of
the interferometric signal "in real time". Just the total uncorrelated 
flux is calculated by the new version of 'xmidispvisi'. 

The sciphoi version of 'xmidispvisi' recovers the flux in the
interferometric channels which would be measured otherwise with
photometric files.  For this, a calibration has to be done which takes
the splitting ratios of the photometric beam splitters into account.
The splitting ratios are a function of wavelength expressed by
third-order polynomals. The coefficients of the polynoms are hard
coded in the source code (search for "coef_pa_i1"). Up to now, there
are no polynoms for the GRISM implemented so that this version works
only with PRISM data. (The coefficients of the polynoms can be derived
by routines described below.)

After calculating the photometric flux which would reach the
interferometric channels, the new version of 'xmidispvisi' calibrates
the correlated flux like the previous version.

All changed or added lines in the code of in the sciphot version is
marked with three semicolons ";;;" or by a label "by FP".



Calibration_tools/
------------------

This subdirectory contains some tools to calculate the coefficients of
polynom describing the splitting ratio of the photometric beam splitters.
The main tool is 'calib_sci_disp.pro' , called by 

calib_sci_disp,'photfileA.fits','photfileB.fits'

which has to be called with two photometric files taken with the beam combiner in,
one with entrance A open and on e with entrance B open.
The routine is calling internally two adapted versions of 'chop_nod_disp' 
to extract the flux along the dispersed channels. These versions are 

chop_int_disp,'photfile.fits'

and

chop_sci_disp,'photfile.fits'

The adapted versions take the different locations of the windows of
interferometric and sciphot channels into account. After extraction of
the flux in the interferometric and photometric channels, the
splitting ratio of the beam splitter is calculated and plotted. For
this, necessary shifts of one to two pixels are introduced to overlay
the spectra as good as possible.  Third-order polynoms are then fitted
to the splitting ratios and overplotted.  The idl plot-window displays
first the ratios PA/I1 and PA/I2 then, after pushing return, PB/I1 and
PB/I2.

The coefficients of the polynoms are displayed in a format, which can
be copy-and-pasted easyly into the new version of 'xmidispvisi'.

 







