Next: 4.2.4 Example 4: How Up: 6.1 User Examples Previous: 4.2.2 Example 2: My

4.2.3 Example 3: Screening out ``bad'' data

Occasionally a spectral observation may display features which defy explanation. You occasionally must ask -- Is it the source, or is it some instrument problem? There are two common sources of error that should be checked on some observations:

To perform these two types of screening, we will use two different processes. For removing the ODS data, we will instruct SPECANAL to ignore SDR records with the ODS flag set. We will also write a user-screening routine which will pass only records where the spacecraft's orbit does not send it through the SAA.

For this outing, we will take a look at the Seyfert Type 1 galaxy NGC 4151 observed by OSSE during viewing period 222.0. If we perform a normal SPECANAL run and use FITIT with a power-law model , we obtain a result like the that displayed in Figure 4.2.

  figure239
Figure 4.2: A Spectrum of NGC 4151 from Viewing Period 222.0. The model is a power-law fit. Only standard screening has been performed on the data.

For whatever reason, we are curious as to whether the spectrum has suffered any contamination from such things as distorted background estimates from SAA passages or possibly mis-flagged data sets from ODS. How do we re-run SPECANAL to exclude this data?

Since orbits with SAA passages is not a piece of information stored in each SDR, we cannot use the standard data flagging information. However, each SDR does contain information from which we can derive whether the spacecraft passed throught the SAA on a given orbit. Since the information must be derived from the SDR data, we need to write a User Screening routine. The basic User Screening routine takes pointers to the SDRs as input and returns and array of indices which point to SDRs accepted for further processing. In the snippet of code below, SAA_SCREEN.PRO, an array of indices is returned of SDRs which were collected more than 4000 seconds since the last SAA passage (enough to exclude a given orbit):

pro saa_screen,sdr,indxrs
; FILE: SAA_SCREEN.PRO
;
; Set SAA_limit to time from last SAA end want to discard
;
SAA_limit=4000.0  ; 4000.0 secs since last SAA exit
SAA_last = getfld('hdr.last_saa_exit',sdr)
indxrs=where(SAA_last ge SAA_limit) ; keep only if SAA_limit secs beyond SAA
return
end

Next, we need to tell SPECANAL to igore data where the ODS flag is set. This flag corresponds to bit 20 in the DSFStat status word and generates a value of 1048576 as a long integer. This is the value we set for DSFSTAT_MASK=1048576. We will use a total of three different namelist files to control these parameters.

To control the building of the background subtracted 2-minute spectra, we use the file NGC4151_SCREEN.BQD listed below:

; %NameList% BQD_STRUC % Structure created 12-Sep-1995 16:21:11.00
VIEWPERIOD =       222.000
START_TIME = "93/144 17:10:34"
STOP_TIME = "93/151 12:14:37"
DSFSTAT_MASK =      1048576
PROD_DIR = "$PROD:"
TARGDEF = "NGC 4151"
USERSCREEN = "saa_screen"
/END ; of setup element definition

We use the file NGC4151_SCREEN.dsm to control the DAY_SUMMER (as a technical point, we don't really need to specify DSFSTAT_MASK and USERSCREEN in this paramter file since the selection and screening performed by BLD_QUAD_DIF has already extracted the appropriate SDRs.)

; %NameList% DAYSUM_STRUC % Structure created 12-Sep-1995 16:21:53.00
OUTFILE = "NGC4151_screen_DSM.SDB"
GOOD_SUMFILE = "NGC4151_screen_GSM.SDB"
DSFSTAT_MASK =      1048576
PROD_DIR = "$PROD:"
USERSCREEN = "saa_screen"
START_TIME = "93/144 17:10:34"
STOP_TIME = "93/151 12:14:37"
/END ; of setup element definition

Finally, the file NGC4151_SCREEN.fp control FFIT_PREP (the major reason we must write a namelist file for FFIT_PREP is to specify the proper good-summed SDB file for input.)

; %NameList% FIT_PREP_STRUC % Structure created 12-Sep-1995 16:23:14.00
FILEROOT = "ngc4151_screen"
SDBFILE(0) = "NGC4151_screen_GSM.SDB",
DAYFILE = "NGC4151_screen_DAY.SDB"
OUTFILE = "NGC4151_screen_TOT.SDB"
/END ; of setup element definition

Then start SPECANAL running...

Igore> specanal,target='ngc 4151',vp=222.0,fileroot='ngc4151_screen',$
Igore>         bqd_config='NGC4151_SCREEN.BQD',$
Igore>         fitprep_config='ngc4151_screen.fp',$
Igore>         daysum_config='NGC4151_SCREEN.DSM',$
IGORE>         /nobln,/noplotanal,$
Igore>         que='sys$ossep'

The final results from FITIT are plotted in Figure 4.3. Note that the error bars are larger and the accumulated live time is smaller. This is the kind of tradeoff one must make when screening data. It is up to the investigator to determine if screening actually improves the results.

  figure257
Figure 4.3: A Spectrum of NGC 4151 from Viewing Period 222.0. The model is a power-law fit. Only data from orbits without an SAA passage and non-ODS data are included in this spectrum.


Next: 4.2.4 Example 4: How Up: 6.1 User Examples Previous: 4.2.2 Example 2: My