HXDGRADE (Sep05)            ftools.hxdgrade                  HXDGRADE (Spe05)

NAME
	hxdgrade -- fill the GRADE column for the WELL FITS

USAGE
	hxdgrade input_name=<infile> \
	    hxdgrade_psdsel_fname=<caldb_hxdgso_psd_fits>
	    hxdgrade_pinthr_fname=<caldb_hxdpin_thr_fits>
	    [read_iomode=<iomode> [time_change=<time_change> 
	    [grade_change=<grade_change> [pi_pmt_change=<pipmt_chagne>
	    [pi_pin_change=<pipin_change> [gtimode=<mode> [gti_time=<name>
	    [num_event [event_freq [anl_verbose [anl_profile]]]]]]]]]]]

DESCRIPTION
	Fill the GRADE columns,
		(1) GRADE_QUALTY (data quality)
		(2) GRADE_PMTTRG (tag for a PMT triggerd event)
		(3) GRADE_PINTRG (tag for a PIN triggerd event)
		(4) GRADE_PSDSEL (GSO likelihood in the Slow Fast diagram)
		(5) GRADE_HITPAT (hit pattern grade)
	The event type which the HXD team recommend is summerized in 
	the 'DET_TYPE' column (0=GSO, 1=PIN, and 255=others).

	For PIN events (with single trigger pattern of 'TRG'), the detector
	id (0,1,2,3) in a Well unit is filled into the 'PIN_ID' column.

	The 'PI_PIN' column is copied by the value of 'PINn_PI' (n=0,1,2,3)
	of the corresponding 'PIN_ID', using the 'DET_TYPE' value.


PARAMETERS
( read_iomode = overwrite )
	HXD event fits input I/O mode : readonly or overwrite or create ?

( time_change = no )
	HXD event fits update TIME : yes or no ?

( grade_change = yes )
	HXD event fits update GRADE : yes or no ?

( pi_pmt_change = no )
	HXD event fits update PI_FAST PI_SLOW : yes or no ?

( pi_pin_change = no )
	HXD event fits update PI_PIN0 PI_PIN1 PI_PIN2 PI_PIN3: yes or no ?

( gtimode = no )
	HXD event fits using GTI : yes or no ?

( input_name = "ae20041215_1055_1932_hxd_wel.uff" )
	HXD event fits file name ?

( hxdgrade_psdsel_fname = "ae_hxd_gsopsd_20050613.fits")
	Settings for PSD selection, used for GRADE_PSDSEL.

( hxdgrade_pinthr_fname = "ae_hxd_pinthr_20050613.fits")
	Settings for PIN lower discriminator, used for GRADE_PINTRG.

( create_name = "NONE")
	HXD event fits created file name ?

( num_event = -1 )
	number of event (-1=all,0=exit)

( event_freq = 10000)           
	Event number printout frequency

( anl_verbose=-1)
	ANL verbose level (-1:full, 0:minimum)

( anl_profile=yes)

EXAMPLES
	Fill GRADE column for the event file ae19990903_1050_1200_hxd_wel.unf,
	using psdsel caldb FITS file, "ae_hxd_gsopsd_20050907.fits" and 
        "ae_hxd_pinthr_20050907.fits":

	ft>  hxdgrade input_name="ae19990903_1050_1200_hxd_wel.unf" \
		hxdgrade_psdsel_fname="ae_hxd_gsopsd_20050907.fits" \
		hxdgrade_pinthr_fname="ae_hxd_pinthr_20050907.fits" \

SEE ALSO 
	none

AUTHOR
   Takao KITAGUTI (Univ. of Tokyo; kitaguti@amalthea.phys.s.u-tokyo.ac.jp)
   Yukikatsu TERADA (RIKEN; terada@riken.jp)
   and HXD team (astroe-hxd-ftools@amalthea.phys.s.u-tokyo.ac.jp).

   help file by Y.Terada June 15 2005 (last updated).

CONTACT
   Questions and comments should be addressed to
   astroehelp@olegacy.gsfc.nasa.gov.


