.help pcsasscor Oct95 ftools.rosat
.ih
NAME
pcsasscor -- Corrects PI channel in Events file
.ih
USAGE
pcsasscor infile outfile
.ih
DESCRIPTION

This tool operates on  Rev0, or RDF PSPC events file. The tool also operates
on any German  PSPC events file converted to RDF format using the 'gevt2rdf'
ftool. The PI column in all events files are currently incorrect, in the sense
that there is an error in all versions of the SASS spatial gain correction.

This tool recalculates the PI column from the PHA and position information, a
new events file is written out with the same format as the original, but with
the PI column replaced by the new corrected values of PI. This tool allows
correction of the events files without the need for reprocessing of the data
with SASS.

(Later versions of this program will eventually correct the PI data for
temporal deviations).


EVENT CORRECTION :

A detailed description of the calibration corrections applied
to individual PSPC events is available in the HEASARC memo

/caldb/docs/rosat/cal_ros_95_010/cal_ros_95_010.tex 

available in latex and post script format from the anonymous ftp 
account at legacy.gsfc.nasa.gov

The aforementioned memo is essentially a copy of the original MPE memo
TN-ROS-ME-ZA00/027 (Hasinger \& Snowden, 1990), but updated and expanded to
refer to the FITS versions of the calibration files available from the HEASARC
and to detail the corrected algorithms as performed by PCSASSCOR.

In summary, the calibration corrections performed on PSPC events in the SASS
processing include corrections for electronic variations (detailed
characteristics of the anode amplifier chains), electric-field variations due
to the (slight) variable spacing of the anode wires, and long-term temporal
gain variation. The corrections are performed using event arrival position,
time, and pulse height. The PHA to PI corrections are performed in SASS within
the CT module.


THE ORIGIN OF THE ERROR :

Detailed analysis of the PSPC in-flight aluminum K (1487 eV)
calibration-source data showed that the corrections, as they stand in SASS,
have an error in the spatial gain correction. The error produces spurious
fluctuations in PI channels across the image. For more detail on the problem,
see

http://heasarc.gsfc.nasa.gov/docs/heasarc/caldb/docs/summary/
cal_ros_95_003_summary.html

The spatial gain correction should remove the gain variations due to the
variable distance of the anode wires and the relative position of the events
with respect to the anode wires. The SASS DCORG subroutine applies the spatial
gain correction to the events data. That subroutine uses corrections based on
ground calibration data from the gain_kor3_b SASS calibration file. An error
in the implementation of the original ground calibration files within SASS has
lead to a mis-correction which produces spurious variations in PI channel
across the detector. To correct this error, PCSASSCOR recalculates the PI column
from the PHA column, using the Y-based spatial correction instead of the
X-based correction.

The electronically corrected coordinate information is required to convert PHA
channels to PI. As the electronically corrected coordinates are an
intermediate coordinate system, they are not stored in the Rev0 or RDF events
file. This version of PCSASSCOR  calculates electronically corrected positions
starting from DETX and DETY and undoing the field and window corrections. In
the RDF case the RAWX and RAWY coordinates are available, and one can avoid
the minor approximations that undoing the field and window correction entails,
by simply applying the electronic position correction to RAWY. This
enhancement will be available in the next release of this tool.


THE CALIBRATION FILES REQUIRED FOR THE TASK

The default setting for the input calibration files is 'CALDB', this 
facility can only be used by beta-test sites of the calibration database 
access software. Most users will need to obtain a set of calibration files 
via anonymous ftp from heasarc.gsfc.nasa.gov. The datasets
are located in the directory:

         /caldb/data/rosat/pspc/bcf/sass_ct

and have the names/descriptions as follows:

.ls  adc_bins.fits     - PSPC ADC non-linearity correction
.le
.ls  alkhist_v1_b.fits - PSPCB Gain hist from Prescott fits to Al-K obs (v1.0)
.le
.ls  alkhist_v1_c.fits - PSPCC Gain hist from Prescott fits to Al-K obs (v1.0)
.le
.ls  gain_kor3_b.fits  - PSPCB Spatial Gain Correction: Pos-dep terms (v1.0)
.le
.ls  gain_kor3_c.fits  - PSPCC Spatial Gain Correction: Pos-dep terms (v1.0)
.le
.ls  gnampl_new.fits   - PSPC Spatial Gain Correction: Energy-dep term (v1.0)
.le
.ls  scal3.fits        - PSPC Window Correction: Energy-dep correction term
.le
.ls  tabx_093_b.fits   - PSPCB Window Correction: X-axis term
.le
.ls  tabx_093_c.fits   - PSPCC Window Correction: X-axis term
.le
.ls  taby_093_b.fits   - PSPCB Window Correction: Y-axis term
.le
.ls  taby_093_c.fits   - PSPCC Window Correction: Y-axis term
.le

Some files are valid for both PSPC instruments, and hence have 'PSPC' as
the instrument keyword.

Note: Correct use of this task requires that the ymapfile used should be
either taby_093_b.fits or taby_093_c.fits, use of the tabx files
will result in a reproduction of the error currently occurring in SASS.

EXAMPLE:

An example of the pcsasscor parameter file might be:

.ls infile = rp700332.fits      Please enter EVENTS filename
.le
.ls (gtifile = %match)           Please enter gtifile name
.le
.ls outfile =                    Please enter output filename
.le
.ls endepfile = scal3.fits       Please enter energy dependent correction file
.le
.ls ymapfile = taby_093_b.fits   Please enter golden disk file
.le
.ls adcfile = adc_bins.fits      Please enter adc binfile
.le
.ls spgfile = gnampl_new.fits    Please enter E-dep spatial gain correction file
.le
.ls spgkfile = gain_kor3_b.fits  Enter pos-dep spatial gain correction file
.le
.ls alkfile = alkhist_v1_b.fits  Enter alk history file
.le
.ls (chatter = 9)                Please enter chatter flag
.le
.ls (clobber = no)               Overwrite output file if it already exists ?
.le
.ls (mode = ql)               Mode
.le

REMINDER:

If your observation was made before Jan 25  1991 then you should use PSPCC
 calibration files, after that date, use PSPCB calibration files (the 
observation date is stored as the DATE-OBS keyword.


.ih
WARNINGS ON USAGE

Note: Correct use of this task requires that the ymapfile used should be
either taby_093_b.fits or taby_093_c.fits, use of the tabx files
will result in a reproduction of the error currently occurring in SASS.

.ju



.ih
SUPPORTED FITS FILE FORMATS

   Currently only the following OGIP standards are supported by this task

.ls For the input events file :
.le
.ls RDF EXTNAME = 'STDEVT'
.le
.ls US REV0 EXTNAME='EVENTS'  
.le
.ls HDUCLAS1='EVENTS'
.le
.ls HDUCLAS2='ACCEPTED'
.le

.ls For the Calibration files :
.le
.ls File conatining the energy dependent Ga term -
.le
.ls HDUCLAS1='RESPONSE'
.le
.ls HDUCLAS2='WC_E'
.le
.ls File containing the electronic correction
.le
.ls HDUCLAS1='IMAGE'
.le
.ls File containing the energy dependent spatial correction
.le
.ls HDUCLAS1='RESPONSE'
.le
.ls HDUCLAS2='SGC_E'
.le
.ls File containing the position dependent spatial correction
.le
.ls HDUCLAS1='RESPONSE'
.le
.ls HDUCLAS2='SGC_POS'
.le
.ls File containing the temporal gain correction
.le
.ls HDUCLAS1='RESPONSE'
.le
.ls HDUCLAS2='DET_GAIN'
.le

For further details see OGIP calibration memo CAL/ROS/95-010
 
.ih
PARAMETERS
.ls infile [character string]
 The name of the Events file
.le
.ls outfile [character string]
 The name of the output file.
.le
.ls (endepfile) [character string]
 The name of the energy dependent correction file
.le
.ls (ymapfile) [character string]
 The name of the golden disk file
.le
.ls (adcfile) [character string]
 The name of the adc bin correction file
.le
.ls (spgfile) [character string]
 The name of the energy dependent spatial gain correction file
.le
.ls (spgkfile) [character string]
 The name of the position dependent spatial correction file
.le
.ls (clobber = no) [boolean]
 Overwrite output file, if it already exists ? 
.le
.ls (chatter=9) [Integer]
 Flag to indicate how chatty the task is at execution. A value of 9 is the
 default, with lower/higher values producing quieter/verbose output 
 respectively.
.le


.ih
BUGS
None known

.ih
LOG OF SIGNIFICANT CHANGES

.ls v1.0.0 (1995 Oct)
    Beta-test version
.le

.ih
PRIMARY AUTHOR

.nj
Rehana Yusaf
.br
.nj
HEASARC
.br
.nj
NASA/GFSC
.br
.nj
http://heasarc.gsfc.nasa.gov/cgi-bin/ftoolshelp
.br
.nj
(301) 286-6115
.ju


.endhelp


