#######################################################################
#                                                                     #
#               Centre d'Etude Spatiale des Rayonnements              #
#                     (in collaboration with ISDC)                    #
#                                                                     #
#                          SPI PSD ANALYSIS                           #
#                                                                     #
# ------------------------------------------------------------------- #
#                                                                     #
#  File:      spi_psd_buildlib.par                                    #
#  Version:   1.5.0                                                   #
#  Component: PA                                                      #
#                                                                     #
#  Author:    Juergen Knoedlseder                                     #
#             knodlseder@cesr.fr                                      #
#             CESR                                                    #
#                                                                     #
#  Purpose:   Parameter file of the SPI PSD library building          #
#             executable                                              #
#                                                                     #
#  History:   1.5.0  23-Sep-2002  First ISDC delivery (Rev. 5.0)      #
#                                                                     #
#######################################################################
#
# The input DOLs
#===============
curveDOL,  s,ql, "og_spi.fits[1]",,, "Input DOL (SWG/IDX/OG)"
algoparDOL,s,ql, "algFM280701.fits[SPI.-ALGO-PSD]",,, "PSD algorithm parameters DOL"
#
# The output DOLs
#================
libDOL,s,ql, "lib.fits",,,    "PSD result library DOL or filename"
outDOL,s,ql, "curves.fits",,, "Selected PSD curves output filename"
#
# OBT limits
#===========
minOBT,s,h, "",,, "Curve usage minimum OBT"
maxOBT,s,h, "",,, "Curve usage maximum OBT"
gtiDOL,s,h, "",,, "Curve usage GTI DOL (GNRL/OBS)
#
# Task parameters
#================
mult,       i,ql,  2,1, 3, "PSD curve multiplicity (1-3)"
timesteps,  i,h,  64,0,64, "Number of time steps to use for library"
adc0_gain,  r,h,    1.0,,, "Gain PSD ADC 0"
adc1_gain,  r,h,    1.0,,, "Gain PSD ADC 1"
adc2_gain,  r,h,    1.0,,, "Gain PSD ADC 2"
adc3_gain,  r,h,    1.0,,, "Gain PSD ADC 3"
adc0_offset,r,h,    0.0,,, "Offset PSD ADC 0"
adc1_offset,r,h,    0.0,,, "Offset PSD ADC 1"
adc2_offset,r,h,    0.0,,, "Offset PSD ADC 2"
adc3_offset,r,h,    0.0,,, "Offset PSD ADC 3"
#
# Energy filters
#===============
engmin,   r,ql, 1800.0,0.0,8000.0, "Total energy minimum (keV)"
engmax,   r,ql, 1900.0,0.0,8000.0, "Total energy maximum (keV)"
mp3engmin,r,ql,    0.0,0.0,8000.0, "Curve energy minimum (keV)"
mp3engmax,r,ql, 8000.0,0.0,8000.0, "Curve energy maximum (keV)"
mp4engmin,r,ql,    0.0,0.0,8000.0, "Scattered energy minimum (keV)"
mp4engmax,r,ql, 8000.0,0.0,8000.0, "Scattered energy maximum (keV)"
#
# Curve error rejection
#======================
fltonboard, b,h, no,,, "Reject curves with on-board error ?"
fltonground,b,h, no,,, "Reject curves with on-ground error ?"
#
# Single site curve usage (post processing and fitting)
#======================================================
fltusesingle,b,h,    no,,, "Use only single-site curves ?"
fltpost,     b,h,    no,,, "Do discrimination post-processing ?"
disDOL,      s,h,    "",,, "Discrimination parameter DOL"
fltlib,      b,h,    no,,, "Use library for on-ground fitting ?"
fltlibDOL,   s,h,    "",,, "PSD filter library DOL"
fltlibset,   i,h,  0,0, 1, "Template library set used for fitting (0/1)"
fltlibsteps, i,h, 64,0,64, "Number of time steps used for fitting"
fltlibtpls,  i,h,  0,0,38, "Number of templates used for fitting (0=all)"
#
# Starttime filter
#=================
fltstart,    b,h,              no,,, "Use starttime filter ?"
fltstartmin, r,h,  0.0,   0.0, 80.0, "Starttime minimum (absolute)"
fltstartmax, r,h, 80.0,   0.0, 80.0, "Starttime maximum (absolute)"
fltsstartmin,r,h, -3.0,-100.0,100.0, "Starttime minimum (sigma)"
fltsstartmax,r,h, +3.0,-100.0,100.0, "Starttime maximum (sigma)"
#
# Endtime filter
#===============
fltend,    b,h,              no,,, "Use endtime filter ?"
fltendmin, r,h,  0.0,   0.0, 80.0, "Endtime minimum (absolute)"
fltendmax, r,h, 80.0,   0.0, 80.0, "Endtime maximum (absolute)"
fltsendmin,r,h, -3.0,-100.0,100.0, "Endtime minimum (sigma)"
fltsendmax,r,h, +3.0,-100.0,100.0, "Endtime maximum (sigma)"
#
# Duration filter
#================
fltdur,    b,h,              no,,, "Use duration filter ?"
fltdurmin, r,h,  0.0,   0.0, 80.0, "Duration minimum (absolute)"
fltdurmax, r,h, 80.0,   0.0, 80.0, "Duration maximum (absolute)"
fltsdurmin,r,h, -3.0,-100.0,100.0, "Duration minimum (sigma)"
fltsdurmax,r,h, +3.0,-100.0,100.0, "Duration maximum (sigma)"
#
# Baseline filter
#================
fltbase,    b,h,              no,,, "Use baseline filter ?"
fltbasemin, r,h, 20.0,   0.0,511.0, "Baseline minimum (absolute)"
fltbasemax, r,h, 80.0,   0.0,511.0, "Baseline maximum (absolute)"
fltsbasemin,r,h, -3.0,-100.0,100.0, "Baseline minimum (sigma)"
fltsbasemax,r,h, +3.0,-100.0,100.0, "Baseline maximum (sigma)"
#
# Baseline slope filter
#======================
fltbaseslope,    b,h,              no,,, "Use baseline slope filter ?"
fltbaseslopemin, r,h, -1.0, -10.0, 10.0, "Baseline slope minimum (absolute)"
fltbaseslopemax, r,h, +1.0, -10.0, 10.0, "Baseline slope maximum (absolute)"
fltsbaseslopemin,r,h, -3.0,-100.0,100.0, "Baseline slope minimum (sigma)"
fltsbaseslopemax,r,h, +3.0,-100.0,100.0, "Baseline slope maximum (sigma)"
#
# Baseline slope significance filter
#===================================
fltbasesig,   b,h,              no,,, "Use baseline slope significance filter ?"
fltbasesigmin,r,h, -3.0,-100.0,100.0, "Baseline slope significance minimum (absolute)"
fltbasesigmax,r,h, +3.0,-100.0,100.0, "Baseline slope significance maximum (absolute)"
#
# Noise filter
#=============
fltnoise,    b,h,              no,,, "Use noise filter ?"
fltnoisemin, r,h,  0.0,   0.0,511.0, "Noise minimum (absolute)"
fltnoisemax, r,h, 20.0,   0.0,511.0, "Noise maximum (absolute)"
fltsnoisemin,r,h, -3.0,-100.0,100.0, "Noise minimum (sigma)"
fltsnoisemax,r,h, +3.0,-100.0,100.0, "Noise maximum (sigma)"
#
# Chisqr filter
#==============
fltchisqr,    b,h,                   no,,, "Use Chi squared filter ?"
fltchisqrmin, r,h,     0.0,   0.0,10000.0, "Chi squared minimum (absolute)"
fltchisqrmax, r,h, 10000.0,   0.0,10000.0, "Chi squared maximum (absolute)"
fltschisqrmin,r,h,    -3.0,-100.0,  100.0, "Chi squared minimum (sigma)"
fltschisqrmax,r,h,    +3.0,-100.0,  100.0, "Chi squared maximum (sigma)"
#
# Standard parameters
#====================
clobber,b,ql, no,,,"Overwrite existing template library ?"