Next: 6 Advanced Exercises Up: User Examples Previous: 5.2.3 Example 3: Hard

5.2.4 Example 4: Combining Separate Observations

It often happens that an OSSE observation of a given target may be split into two or more parts. This can occur due to interruption by a target of opportunity, a scheduling constraint, or any one of a number of other possibilities. If the observations are not greatly separated in time, it can be desirable to concatenate the multiple observations into a single file. An excellent example for this is a Phase 2 observation of the QSO 3C 273 which was observed across three different viewing periods: 204, 205, and 206. The observation actually shared some of the OSSE pointings with 3C 279.

We'll begin this exercise by assuming you already have generated the high level products for the targets and three viewing periods in question, either by downloading them directly from the archive or generating them yourself in IGORE:

Igore> specanal,target='3C273',vp=204.0
Igore> specanal,target='3C273',vp=205.0
Igore> specanal,target='3C273',vp=206.0

(In reality, if you have full access to the low-level data products, it is more worthwhile to run SPECANAL over the entire time period in question for the desired target. For this exercise, we will assume it is most convenient to use the high-level products.)

If you are only interested in the time-averaged spectrum accumulated over the entire time of observation, we can utilize the total spectra (by detector) and response matrices in the *TOT.SDB files. Basically, we will extract the SDRs in each *TOT.SDB file and sum them together before passing the result to FITIT. The listing below illustrates this process.

; extract the SDRs from the files desired
Igore> sdr_load,'3C273_204_TOT.SDB',sdrvp204
Igore> sdr_load,'3C273_205_TOT.SDB',sdrvp205
Igore> sdr_load,'3C273_206_TOT.SDB',sdrvp206

; now combine them into a single set of SDRs by detector
;  and keep the response matrices
Igore> sdr_sum,[sdrvp204,sdrvp205,sdrvp206],$
              sdrtot,$              ; output SDR
              /bydet,$              ; summing by detector
              /matrix               ; and retaining response matrices

; now generate a fit to a power-law model
Igore> status=fitit(sdr=sdrtot,$        ; input SDR
Igore>        modelfile='pwrlaw.mod',$  ; model name
Igore>        fileroot='3C273_pwrlaw_bydet')  ; saving files to...

This will generate a plot and fit for each detector used in the observation and a totaled spectra. For the above exercise, we have assumed a power-law model template, pwrlaw.mod, has already been generated.

Suppose were not interested in the spectra for each detector which is generated by FITIT. In this case, simply sum all the detectors using SDR_SUM and call FITIT again:

; now combine them into a single SDR
;  and keep the response matrice
Igore> sdr_sum,[sdrvp204,sdrvp205,sdrvp206],$
              sdrtot,$              ; output SDR
              /matrix               ; and retain response matrix

; now generate a fit to a power-law model
Igore> status=fitit(sdr=sdrtot,$        ; input SDR
Igore>        modelfile='pwrlaw.mod',$  ; model name
Igore>        fileroot='3C273_pwrlaw')  ; saving files to...

A sample output from this process is presented in Figure 5.2.

  figure334
Figure 5.2: Power Law Spectral fit for 3C 273 in periods 204, 205 & 206.

Suppose you wish to check this extended observation for time variability. In this case, we wish to keep the individual days separated by detector (to ensure the variability is consistent across each detector). In this case, we can accumulate the SDRs from the Good-Summed SDB file and send them through PLT_ENE_BANDS which generates the EBAND output file from SPECANAL. Here's how to do it:

; extract SDRs from the files in desired
Igore> sdr_load,'3C273_204_GSM.SDB',sdrvp204
Igore> sdr_load,'3C273_205_GSM.SDB',sdrvp205
Igore> sdr_load,'3C273_206_GSM.SDB',sdrvp206

Now we have a problem. We could combine the SDRs into one long array by the simplest means possible, i.e.:

; combine them into a single SDR
Igore> sdr=[sdrvp204,sdrvp205,sdrvp206]

However, this immediately runs into problems. The transition from one viewing period to the next doesn't occur at some nice convenient time, like midnight, GMT. As a result, there are common days between viewing period 204 and 205. This is easy to illustrate by examining the starting time of the SDRs:

print,getfld('hdr.strttim',sdrvp204)/86400.0
;      8978.67      8978.86      8978.67      8978.68      8979.04      8979.04
;      8979.05      8979.04      8980.06      8980.00      8980.00      8980.00
;      8981.02      8981.02      8981.03      8981.02      8982.04      8982.04
;      8982.05      8982.04      8983.00      8983.00      8983.01      8983.06
;      8984.02      8984.02      8984.02      8984.02      8985.04      8985.04
;      8985.04      8985.04
print,getfld('hdr.strttim',sdrvp205)/86400.0
;      8985.82      8985.81      8985.81      8985.81      8986.01      8986.06
;      8986.00      8986.02      8987.04      8987.08      8987.04      8987.04
;      8988.04      8988.04      8988.04      8988.04      8989.06      8989.06
;      8989.12      8989.06      8990.02      8990.01      8990.02      8990.01
;      8991.04      8991.04      8991.04      8991.04      8992.01      8992.02
;      8992.01      8992.01

where the division by 86400.0 converts the value to truncated Julian days. It's easy to see that the last four entries in VP 204 are on the same day as the first four entries in VP 205. There are four entries for each day corresponding to each of the four OSSE detectors used in this observation.

What do we do? We prefer to combine the last four SDRs in VP 204 with the first four SDRs in VP 205, making them into a single day. Similarly, we find that the last four SDRs in VP 205 are on the same day as the first four SDRs in VP 206. We finally want to merge the entire set into a single array of SDRs, properly separated by detector and sorted by day. Simple enough:

; merge the connecting day for VP 204 & 205
sdr_sum,[sdrvp204(28:31),sdrvp205(0:3)],sdrda,/bydet

; merge the connecting day for VP 205 & 206
sdr_sum,[sdrvp205(28:31),sdrvp206(0:3)],sdrdb,/bydet

;and now slip those outputs into the appropriate sequence...
sdrlc2=[sdrvp204(0:27),sdrda,sdrvp205(4:27),sdrdb,sdrvp205(4:*)]

An finally we plot the results.

; now plot them in the 0.05-0.15 MeV energy band
Igore> bandedge=0.05
Igore> bandwidth=0.10
Igore> plt_ene_bands,'',bandedge,bandwidth,insdr=sdrlc2

A sample output of the resulting light-curve is presented in Figure 5.3.

  figure342
Figure 5.3: Light Curve at 0.05-0.15 MeV for 3C 273 in periods 204, 205 & 206.


Next: 6 Advanced Exercises Up: User Examples Previous: 5.2.3 Example 3: Hard