HRC AMP_SF Correction and Reducing Tap-Ringing Distortions
[CIAO 3.4 Science Threads]
OverviewLast Update: 14 Sep 2007 - updated for CALDB 3.4.1: new HRC-I degap files Synopsis: There is a marginal instability in the HRC electronics that leads to a "ringing" in the amplifiers used in measuring event positions. Under certain conditions, the ringing is still present when the signals used to calculate the position are sampled, leading to a distortion in the calculated position for some events. Since the positions are calculated in ground processing (rather than on board the spacecraft), we apply a correction to minimize this distortion in normal HRC Level 1 processing. However, this correction requires a knowledge of the amplifiers' gain setting, or amplitude scale factor (AMP_SF), which differs from event to event. The AMP_SF is available in HRC telemetry, but it is often telemetered incorrectly. Fortunately, it is possible to deduce the correct value of AMP_SF from other HRC event data. This correction became part of standard data processing at software version DS 7.3.0. Purpose: To correct the AMP_SF values in HRC level=1 event files and to use these new values to reduce the tap-ringing distortion in the HRC event position reconstruction. A new level=2 event file is then generated. Read this thread if: you are working with any HRC-S or HRC-I observation, regardless of whether it is imaging or grating data, that was processed with a software version lower than DS 7.3.0; the Determine the RANGELEV keyword section shows how to check the version of the software used in processing your data.
Related Links:
|
Contents
- Get Started
- Generate A New Level=1 Event File
- Generate A New Level=2 Event File
- Summary
- Parameter files:
- History
Get Started
Sample ObsID used: 1557 (HRC-S, G21.5-09)
File types needed: evt1; bpix1; flt1; asol1
If you created a new bad pixel file by running the Creating a New Observation-Specific HRC Bad Pixel File thread, use that file in this analysis. Otherwise, use the bpix1.fits file from the Archive.
In this thread, we assume that all relevant files are in the same working directory.
In order to perform this correction, the columns containing the raw amp values, as well as the AMP_SF column, must be present in the input file. Since these are filtered out in level=2 processing, this thread must be run on the level=1 event file.
To determine if the AMP_SF correction has already been applied to the data, check for the AMPSFCOR header keyword:
unix% dmkeypar hrcf01557_000N002_evt1.fits AMPSFCOR echo+ # dmkeypar (CIAO3.4): ERROR: Keyword 'AMPSFCOR' was not found in file 'hrcf01557_000N002_evt1.fits'.
Since the keyword does not exist, the correction has not yet been done. Additionally, if the keyword exists, but has any value other than "yes" (TRUE), the correction has not been applied. If the correction had been applied, the AMPSFCOR would have a value of "yes" (TRUE). Note that although is does not hurt to run this thread more than once on the same dataset, nothing will be changed after the first run.
There are two other threads that should be considered, since they may affect how hrc_process_events is run:
Generate A New Level=1 Event File
Determine the RANGELEV keyword
The header keyword RANGELEV contains the value of an HRC operational parameter which is used to determine the appropriate parameters for the AMP_SF correction. This keyword has been added to data processed with DS 6.9.0 or later:
unix% dmkeypar hrcf01557_000N002_evt1.fits ASCDSVER echo+ 6.0.2 unix% dmkeypar hrcf01557_000N002_evt1.fits RANGELEV echo+ # dmkeypar (CIAO3.4): ERROR: Keyword 'RANGELEV' was not found in file 'hrcf01557_000N002_evt1.fits'.
Since this dataset was processed with a software version before DS 6.9.0, it is not surprising that the RANGELEV keyword is missing from the header. In this case, we need to add the keyword with dmhedit. First, we need to know when the data was taken (DATE-OBS keyword):
unix% dmkeypar hrcf01557_000N002_evt1.fits DATE-OBS echo+ 2001-03-09T03:02:44
Now choose the appropriate RANGELEV value from this table:
DATE-OBS | Detector | RANGELEV value |
before 1999-12-6 | HRC-I & HRC-S | 90 |
after 1999-12-6 | HRC-I | 115 |
after 1999-12-6 | HRC-S | 125 |
Since we are using an HRC-S observation taken after 1999-12-6, we need to use "125" in the value parameter of dmhedit:
unix% dmhedit infile=hrcf01557_000N002_evt1.fits filelist=none operation=add key=RANGELEV value=125
To confirm that the update was made correctly:
unix% dmkeypar hrcf01557_000N002_evt1.fits RANGELEV echo+ 125
Run hrc_process_events
Running this tool with the SDP level=1 event file as the input will produce a new level=1 event file. Setting do_amp_sf_cor to "yes" indicates that the AMP_SF correction should be applied.
Since it is necessary to recalculate the sky coordinates, we need to supply the proper aspect solution:
unix% punlearn hrc_process_events unix% pset hrc_process_events infile=hrcf01557_000N002_evt1.fits unix% pset hrc_process_events outfile=hrc_1557_new_evt1.fits unix% pset hrc_process_events badpixfile=hrcf01557_000N002_bpix1.fits unix% pset hrc_process_events acaofffile=pcadf100494341N001_asol1.fits unix% pset hrc_process_events do_amp_sf_cor=yes unix% pset hrc_process_events instrume=hrc-s unix% pset hrc_process_events badfile=NONE unix% hrc_process_events input level 0 event file/stack (hrcf01557_000N002_evt1.fits): output level 1 file (hrc_1557_new_evt1.fits): bad pixel file ( NONE | none | <filename>) (NONE): # hrc_process_events (CIAO3.4): The following error occurred 2482 times: dsHPEEVENTSEQERR -- WARNING: Out of sequence events discovered in hrcf01557_000N002_evt1.fits. # hrc_process_events (CIAO3.4): The following error occurred 224 times: WARNING: can't find a proper degap value for this raw coord. in hrcf01557_000N002_evt1.fits
There are several things to note here:
-
The warnings may be ignored; they are explained in the hrc_process_events "out of sequence" and hrc_process_events "no degap value" FAQs.
-
You may have to change the instrume parameter for your observation.
-
In some cases there will be more than one asol1.fits file for an observation. All the files must be input to the acaofffile parameter in chronological order (the time is in the filename, so "ls" lists them in order), either as a comma-separated list or as a stack (see ahelp stack for more information).
The contents of the parameter file may be checked using plist hrc_process_events.
Generate A New Level=2 Event File
If you are working with grating data, you should now proceed to the LETG/HRC-S or LETG/HRC-I Grating Spectra thread to create a new level=2 event file (and a new PHA file). Otherwise, finish running this thread.
Filter on status
Now we apply the appropriate status filter; a value of 0 demands that the bit be flagged as "good", a value of x indicates that either status (0/1) is acceptable.
For HRC-S observations (the pha filter removes about 25% of the background with no X-ray losses; see this FAQ):
unix% punlearn dmcopy unix% dmcopy "hrc_1557_new_evt1.fits[pha=0:254,status=xxxxxx00xxxx0xxx0000x000x00000xx]" \ hrc_1557_flt1_evt1.fits
For HRC-I observations:
unix% punlearn dmcopy unix% dmcopy "hrci_new_evt1.fits[status=xxxxxx00xxxx0xxx00000000x0000000]" \ hrci_flt1_evt1.fits
Apply GTI filter
Finally, the Good Time Intervals (GTIs) supplied by the pipeline need to be applied. We simultaneously eliminate unnecessary columns from the output.
unix% punlearn dmcopy unix% dmcopy \ "hrc_1557_flt1_evt1.fits[EVENTS][@hrcf01557_000N002_std_flt1.fits][cols -crsu,-crsv,-amp_sf,-av1,-av2,-av3,-au1,-au2,-au3,-raw,-sumamps]" \ hrc_1557_evt2.fits
Be sure to include the @ symbol in the filter expression; the command will not be executed properly if it is omitted.
Summary
The thread is now complete; the new level=2 event file is hrc_1557_evt2.fits. To confirm that the AMP_SF correction was applied, check the header:
unix% dmkeypar hrc_1557_evt2.fits AMPSFCOR echo+ 1 unix% dmkeypar hrc_1557_evt2.fits AMPSFFIL echo+ hrcsD1999-07-22amp_sf_corN0001.fits
A value of "1" is the same as "yes". Or, alternatively:
unix% dmlist hrc_1557_evt2.fits header | grep AMP 0072 AMPSFFIL hrcsD1999-07-22amp_sf_corN0001.fits String AMF_SF Correction file used 0086 AMPSFCOR TRUE Logical TRUE=apply_amp_sf_corr; FALSE=NOT_apply;
Each of these sets of commands shows that the AMPSFCOR keyword is set to "yes" (TRUE) and that the AMP_SF file used has been recorded.
Next, read the Computing Average HRC Dead Time Corrections thread to see if you need to recompute the deadtime statistics for your dataset.
Parameters for /home/username/cxcds_param/hrc_process_events.par # # Parameters for the hrc_process_events task # infile = hrcf01557_000N002_evt1.fits input level 0 event file/stack outfile = hrc_1557_new_evt1.fits output level 1 file badpixfile = hrcf01557_000N001_bpix1.fits bad pixel file ( NONE | none | <filename>) acaofffile = pcadf100494341N001_asol1.fits aspect offset file ( NONE | none | <filename>) (geompar = geom) Parameter file for Pixlib Geometry files (alignmentfile = )acaofffile -> pcadf100494341N001_asol1.fits) sim/fam alignment file ( NONE | none | <filename>) (obsfile = NONE) obs.par file for output file keywords ( NONE | none | <filename>) (gainfile = CALDB) gain correction image file ( NONE | none | <filename>) (ADCfile = NONE) ADC correction table file ( NONE | none | <filename>) (degapfile = CALDB) degap factors (NONE | none | COEFF | <filename>) (hypfile = CALDB) Hyperbolic test coefficients file ( NONE | none | <filename>) (ampsfcorfile = CALDB) caldb file for amp_sf_correction( NONE | none | <filename>) (tapfile = CALDB) tap ring test coefficients file ( NONE | none | <filename>) (ampsatfile = CALDB) ADC saturation test file ( NONE | none | <filename>) (evtflatfile = CALDB) Event flatness test file ( NONE | none | <filename>) (badfile = NONE) output level 1 bad event file (logfile = stdout) debug log file (STDOUT | stdout | <filename>) (eventdef = )stdlev1 -> {d:time,s:crsv,s:crsu,s:amp_sf,s:av1,s:av2,s:av3,s:au1,s:au2,s:au3, l:raw,s:chip,l:tdet,f:det,f:sky,s:pha,s:pi,s:sumamps,s:chip_id,x:status}) output format definition (badeventdef = )badlev1 -> {d:time,s:crsu,s:crsv,s:au1,s:au2,s:au3,s:av1,s:av2,s:av3,s:pha}) output format definition (grid_ratio = 0.5) charge ratio (pha_ratio = 0.5) pha ratio (wire_charge = 0) turn on center wire test (-1=off,0=on) (cfu1 = 1.0) u axis 1st order cor. factor (cfu2 = 0) u axis 2nd order cor. factor (cfv1 = 1.0) v axis 1st order cor. factor (cfv2 = 0) v axis 2nd order cor. factor (time_offset = 0) Offset to add to event time field to synch w/ fam data (amp_gain = 75.0) amp gain (instrume = hrc-s) hrc instrument- used for parameter file (do_amp_sf_cor = yes) perform amp_sf correction (y/n) ? (do_ratio = yes) perform ratio validity checks (tstart = TSTART) header key containing default time value (HSI) (tstop = TSTOP) header key containing time of last event (clobber = no) Overwrite output event file if it already exists? (verbose = 0) level of debug detail (0=none, 5=most) (rand_seed = 1) random seed (for pixlib), 0 = use time dependent seed (rand_pix_size = 0.0) pixel randomization width (-size..+size), 0.0 = no randomization (start = coarse) start transformations at [coarse,chip,tdet] (stop = sky) end transformations at [none,chip,tdet,det,sky] (badlev1 = {d:time,s:crsu,s:crsv,s:au1,s:au2,s:au3,s:av1,s:av2,s:av3,s:pha}) event format definition string (hsilev1 = {d:time,s:crsu,s:crsv,s:au1,s:au2,s:au3,s:av1,s:av2,s:av3,s:chipx,s:chipy,s:tdetx,s:tdety, s:x,s:y,l:fpz,s:pha,s:vstat,s:estat}) event format definition string (stdlev1 = {d:time,s:crsv,s:crsu,s:amp_sf,s:av1,s:av2,s:av3,s:au1,s:au2,s:au3,l:raw,s:chip,l:tdet, f:det,f:sky,s:pha,s:pi,s:sumamps,s:chip_id,x:status}) event format definition string (simlev1 = {l:tick,i:scifr,i:mjf,s:mnf,s:evtctr,s:crsu,s:crsv,s:au1,s:au2,s:au3,s:av1,s:av2,s:av3, s:tdetx,s:tdety,s:pha,s:vstat,s:estat}) sim event definition string (fltlev1 = {d:time,s:crsv,s:crsu,s:amp_sf,s:av1,s:av2,s:av3,s:au1,s:au2,s:au3,s:chipx,s:chipy,l:tdetx, l:tdety,s:detx,s:dety,s:x,s:y,s:pha,s:sumamps,s:chip_id,l:status}) event format definition string (mode = ql) |
History
14 Dec 2004 | reviewed for CIAO 3.2: no changes |
20 Dec 2005 | updated for CIAO 3.3: new HRC-S degap and HRC-I gain map files were released in CALDB 3.2.0; the new calibration is automatically applied if you run this thread |
10 Aug 2006 | updated for CALDB 3.2.3: corrected HRC-I gain map file and new degap have been released; the new calibration is automatically applied if you run this thread |
18 Dec 2006 | updated for CIAO 3.4: new calibration files in CALDB 3.3.0; added link to Computing Average HRC Dead Time Corrections thread in Summary; CIAO version in errors |
01 May 2007 | updated for CALDB 3.4.0: new HRC-I gain map files |
14 Sep 2007 | updated for CALDB 3.4.1: new HRC-I degap files |