Out of Date

Note that this page, originally written in early 2005, is out of date and is not being maintained. For current, complete specifications of the sources that are available to gtobssim see the Science Tools section of the User Workbook, under the 'Observation Simulation' link.

Notes on Sources

Here are some notes about using the gamma-ray sources that are available for use with obsSim.

The XML file for the sources described below, with annotations about the definitions of the parameters, is available here.

FT1 event files generated for these sources used an FT2 file for a one-week scanning/rocking observation. These files are available here. For all of these FT1 files, I used the random seed 34621 in obsSim.par. There's nothing special about this number, but don't be surprised when you get different gamma rays if you use a different seed. All FT1 files are for the FRONT/BACK (i.e., DC1) response functions.

I can't personally vouch for the correctness of the output for any of these sources. I haven't seen anything that looks obviously wrong yet, but I haven't tried quantitatively studying the numbers of gamma rays that the sources generate and I haven't seriously tried any timing studies.

TransientTemplate (Chiang)

Here is a very simple example of a transient source. Note that observationSim/v5r1p3/xml/obsSim_source_library.xml has more examples of TransientTemplate sources.

The parameter values in params="..." below are as follows:

  1. source flux (photons m -2 s -1 integrated over [ Emin,Emax ])
  2. photon spectral index for a power-law spectrum
  3. start time (in s)
  4. stop time (in s) for the flare (both measured with respect to whatever the 0 of time is
  5. name of the file that has the flare profile
  6. Emin (MeV) for the energy range of the gamma rays
  7. Emax (MeV)

NOTE: The last two arguments are optional; the values for the limits default to 30 MeV and 1e5 MeV if not specified.

(info) The file (item 5 above) contains two columns, time and flux. They are BOTH RESCALED; the time column is scaled to match the start and stop times specified in the XML file and the flux entries are scaled so that the MEAN flux is the same as specified in the XML file. transient_profile.dat is available here. The profile rises linearly from 0 for the first 1/3rd of the time, plateaus for the next 1/3rd, and then falls linearly to 0 again in the final 1/3rd of the time interval.

<source name="flaring_source">
 <spectrum escale="MeV">
        <SpectrumClass name="TransientTemplate"
         params="0.2,2,1e5,1.2e5,transient_profile.dat"/>
        <celestial_dir ra="80" dec="20"/>
    </spectrum>
</source>

Here is the distribution of arrival times for the gamma rays from this simulation. Note that during the 20 ks that the source is on, the source is seen on 3 different orbits (with 3 different aspect angles). Also shown are the RA and Dec of the LAT z-axis on the same time scale. The count rates are lower for the first and third orbits because the LAT is pointed further away from the source (which has RA, Dec = 80 deg, 20 deg) and because the source has lower flux at those times.

SpectralTransient (Chiang)

This is a generalization of the TransientTemplate source and allows a broken power-law to specified for the spectrum during each interval. In addition, beginning and end times must be given for each interval, thereby allowing non-uniform interval sizes, as well as zero flux intervals that do no need to be explicitly defined.

Here is an annotated example of an xml-file entry:

   <source name="spectral_transient">
      <spectrum escale="MeV">
<!-- 
     mean flux = 0.1 (1e4/m^2/s) integrated over [emin,emax]
     start time = 0 (MET s)
     stop time = 1e4 (MET s)
     template file name = $(GENERICSOURCESROOT)/data/testTemplate.dat
     emin = 20 (MeV, this is the default)
     emax = 2e5 (MeV, default)
     lc # (in FITS file) = 0 (default)
     z (redshift) = 0 (default)
--!>
          <SpectrumClass name="SpectralTransient"
          params="1e-1, 0., 1e4, $(GENERICSOURCESROOT)/data/testTemplate.dat, 20, 2e5, 0, 0"/>
          <celestial_dir ra="193.4" dec="-5.82"/>
      </spectrum>
   </source>

Light curves may be defined using a text file or a FITS file; the latter is convienient for allowing large libraries of light curves to be accessed compactly. The text format files can contain only one light curve. In the case of text files, the "lc #" parameter is ignored. Here is an example light curve text file:

testTemplate.dat
# $Header: /nfs/slac/g/glast/ground/cvs/celestialSources/genericSources/data/testTemplate.dat,v 1.2 2005/02/08 00:20:55 jchiang Exp $
#
# @file testTemplate.dat
# @brief Used by SpectralTransient class
# The columns are
# tstart tstop  flux gamma1 gamma2 ebreak/MeV 
  0.     0.3     50.   1.7   2.5    300.
  0.5    0.8    100.   1.5   2.2    1000.
  0.8    1.0     10.   2.1   2.1    1000.

Lines beginning with a "#" are comments and are ignored.

A description of the FITS file version of the light curve templates is forthcoming. Here is an example that was generated in preparation for the DC2 source model.

PulsarSpectrum (Omodei & Razzano)

The source below is lifted from celestialSources/Pulsar/v1r0p0/xml/Pulsar_user_library.xml. It more or less describes the Crab for some epoch.

This source does not presently apply arrival time corrections to take into account the motion of the LAT or general relativistic effects.

The parameters in the params="..." attribute below are as follows
1. Select model (for now the only available is default=1);
2. Pulsar flux above 100 MeV (ph cm -2 s -1);
3. Period (s);
4. Period derivative (s per s);
5. Number of peaks in light curve;
6-9. Parameters of the functional form describing the spectrum (see PulsarSpectrum tutorial link below in this section);

NOTE: The period derivative is ignored in Science Tools v5r1; you will want at least v5r1p1 to get the version of the source that actually uses the period derivative.

<source name="PSRCrabPolarPhen" >
    <spectrum escale="MeV"> <SpectrumClass name="PulsarSpectrum" params=" 1,2
.3e-6,0.033,422e-15,2,1e6,30e6,-1.9,0.29"/>
       <galactic_dir l="184.56" b="-5.78"/>
       </spectrum>
 </source>

Here is the distribution of the events on the sky (with some outliers cropped off) for this simulation. Also shown is the overall counts spectrum for the one-week observation.

This source also leaves behind a file called pulsar.root in the directory from which you run obsSim.

Tutorial for PulsarSpectrum

A new Web page with PulsarSpecrtum Tutorials is available at :

http://www.pi.infn.it/~razzano/Pulsar/PulsarSpTutor/PulsarSpTutor.htm

In this page I will put some tutorials about use of PulsarSpectrum. For now I've included the tutorial describing how to create and simulate a source with the new features of PulsarSpectrum. It contains the steps to follow for generating an example of pulsar.

GalPulsars (Hierath)

There's nothing really to specify in the XML file. All of the information is in the file named in the params attribute, which is human readable. vela.txt is available here, in addition to the repository. The file flux/v8r10p2/sources/pulsars.txt has many more pulsars.

This source does keep track of where the LAT is and where the earth is in its orbit in order to make arrival time corrections. I have not personally tested this yet. Because this source needs to use an actual ephemeris for the solar system, the absolute times will matter.

<source name="vela-galactic">
    <spectrum escale="GeV">
        <SpectrumClass name="GalPulsars" params="vela.txt"/> <use_spectrum frame="galaxy"/>
    </spectrum>
</source>

Here is the distribution of the events on the sky (with some outliers cropped off) for this simulation. Also shown is the overall counts spectrum for the one-week observation.

Note: I do not know right now why this source generated so many fewer gamma rays than the one above (470 vs. 1842). Nominally Vela is brighter. I used the source specifications exactly as they were given in the XML files in the repository.
(11 Nov 2004): One reason for the difference is that the flux specification in the science tools checkout-era vela.txt was for the 'off-pulse' phase of the pulsar. This is 9.28e-7 vs. 2.3e-6 for the PulsarSpectrum source above. The ratio is ~2.5, so it doesn't explain the full factor of ~4 difference.
Also, note that the SpectralIndex specification for the GalPulsars sources is for the energy spectrum not the (usual for us) photon spectrum, so the index values given to GalPulsars have to be (photon spectral index) + 1.

GRBmanager (Omodei & Cohen-Tanugi?)

The source below is mostly lifted from celestialSources/GRB/v4r0p7/xml/GRB_user_library

The parameters in the params="..." attribute are as follows

  1. Time of initial GRB (s)
  2. Interval between GRBs (s)

I don't know what the time reference is, i.e., what absolute time 0 corresponds to.

Nothing else other than the coordinates of the GRB can be specified. You must be careful to have the GRBs go off when they are in the FOV of the LAT. One unphysical way to do this (pointed out to me by Johann) is to replace the galactic_dir line with, e.g., <direction frame="glast" theta="0" phi="0"/>, which fixes the GRB to be right on the LAT z-axis no matter where it is pointed.

Note: this source will also make grb_#####.root files in your current directory. These files are alleged to contain 2-dim histograms of the GRB and are generated whether or not the GRB was within the FOV. -->

<source name="GRB_50_60">
    <spectrum escale="MeV"> <SpectrumClass name="GRBmanager" params="10000
,20000"/>
        <galactic_dir l="50" b="60"/>
    </spectrum>
</source>

Here are the times and energies of the 104 gamma rays that this source generated for the one week observation period. The second plot is the time history of the gamma rays in the intense burst near the end of the week.

Diffuse interstellar emission with MapSource (Chiang)

The source below is lifted from observationsSim/v5r1p3/xml/obsSim_source_library.xml

The 'MapSpectrum' source can also be used for this purpose. I don't know whether one is superior to the other. The definitions of the params="..." attributes are given below:

  1. Total photon flux from the map (#/m^2/s) = 17.
  2. Photon spectral index = 2.1
  3. Fits file (plate-carree only) = $(FLUXROOT)/sources/gas_gal.fits
  4. Minimum photon energy (MeV) = 30.
  5. Maximum photon energy (MeV) = 2e5

gas_gal.fits is the EGRET team's interstellar emission model (basically Hunter et al. 1997). The file is a 2-dimensional array of the integrated intensity (>100 MeV) on a 30' grid in Galactic coordinates. For MapSource there's nothing special about the grid size, or using Galactic vs. celestial coordinates. The important point is that the image be in a flat (plate-caree) projection, as mentioned above.

This source generated 502320 gamma rays for the run that I made. In obsSim.par, I had set a limit of 200k events per output FITS file, so the output spans 3 FITS files.

Note that gas_gal.fits does not contain extragalactic diffuse emission. This was determined with EGRET to have an isotropic distribution with integrated intensity 1.5 x 10 -5 cm -2 s -1 sr -1 (>100 MeV, Sreekumar et al. 1998). The expectation is that the LAT will resolve a significant fraction of this into point sources (blazars). Still, the isotropic intensity or its equivalent in point sources should be included in the model for realistic representation of the celestial gamma-ray background. You can do this either by adding a constant intensity to gas_gal.fits and writing it out in a new FITS file, or you can define an additional, isotropic source for obsSim.

<source name="Galactic_diffuse">
    <spectrum escale="MeV">
        <SpectrumClass name="MapSource"
          params="17.,2.1,$(FLUXROOT)/sources/gas_gal.fits,30.,2e5"/>
         <use_spectrum frame="galaxy"/>
    </spectrum>
</source>

Diffuse interstellar emission with MapCube (Chiang)

The MapCube source is a generalization of the MapSource source. MapCube allows separate maps to be specified for arbitrary energies. This allows for spectral variations across a diffuse source. I think that in generating gamma rays, MapCube interpolates in log(Energy) between the planes.

MapCube was used to generate the interstellar gamma rays from the Milky Way for Science Tools Checkout 2 using a cube generated from gamma-ray intensities calculated by GALPROP. Of course, MapCube can be used for sources that don't subtend the entire sky, too.

The MapCube source has only 2 parameters in its specification:

  1. Total photon flux from the map, integrated over the energy range of the cube (#/m^2/s)
  2. Fits file of cube (plate-carree only)

Note that MapCube requires the input FITS cube to have a binary table extension 'ENERGIES' that defines the energy of each of the spatial planes in the cube.

The FITS cube that I generated from the GALPROP model is available as GP_gamma.fits.gz. (Beware: It is large, ~32 Mbyte uncompressed.) It has dimensions 720x360 (0.5 deg grid spacing in Galactic longitude and latitude) and contains 32 planes spaced by factors of 1.4 in energy, from ~29 MeV to ~980 GeV. This could safely be trimmed to have an upper limit of ~300 GeV, and in fact the calculation probably should not be trusted all the way to 1 TeV.

The units of the FITS cube are differential intensity (e.g., photons cm^-2 s^-1 MeV^1 sr^-1), although the integral value is renormalized by whatever total photon flux is specified in the specification of the source.

Note that GP_gamma.fits does not contain extragalactic diffuse emission. See notes above for MapSource and below for an isotropic emission source.

The example below is for the GP_gamma.fits model of the interstellar emission of the Milky Way.

   <source name="GALPROP_source">
      <spectrum escale="MeV">
<!-- Total photon flux from the map (#/m^2/s) = 12.59
     Fits file (plate-carree only)=/a/surrey01/vol/vol2/g.glast_users/glground/d
igel/galprop/GP_gamma.fits-->
         <SpectrumClass name="MapCube" params="12.59,GP_gamma.fits"/>
         <use_spectrum frame="galaxy"/>
      </spectrum>
   </source>
</source_library>

Isotropic emission as a source in instrument coordinates (who wrote it?)

This source is actually defined in terms of cos(theta), i.e., with respect to the instrument axis rather than in some celestial system. You can get away with this for an isotropic celestial source. I assume that occultation by the earth is properly taken into account, although it hardly matters for the step-rocking observation strategy. Occultation of this source would be worth checking, though, for a pointed observation.

The source below implements the extragalactic diffuse inferred by EGRET (Sreekumar et al. 1998). The flux has units of photons m -2 s -1 integrated between Emin and Emax. The photon spectral index is gamma, i.e., dN/dE = Const*E -gamma .

    <source name="extragalactic" flux="0.545">
       <spectrum escale="MeV">
          <particle name="gamma">
             <power_law emin="30." emax="100000." gamma="2.1"/>
          </particle>
          <solid_angle mincos="-0.4" maxcos="1."/>
       </spectrum>
    </source>

This source generated 163,716 gamma rays in the one-week observation.

More sources to come

  • No labels

5 Comments

  1. Regarding the note of Seth about the Vela in the Theodore source.
    I think it's too weak because the flux in Vela.txt is of order 9E-7, but the right flux of Vela pulsar is about 9E-6 as reported for example in the EGRET catalogs (the 2nd report 9 and the 3rd report about 8.3)

  2. It would be very nice if confluence would allow comments to be attached to specific
    items. Maybe it is possible, but I see no obvious way of doing so. In any case,
    the MapSource source was indeed written by me, Jim Chiang. It runs at least six times
    faster than the MapSpectrum source (formerly of the MapFlux package, now incorporated
    as part of the flux package) for Galactic Diffuse emission. Also, MapSource can be used
    for any FITS image file in plate-carree projection, where as the MapSpectrum source
    can only be used with the gas_gal.fits file.

  3. This comment is in response to the discussion associated with the source labled "Isotropic emission as a source in instrument coordinates (who wrote it?)". As far as I can tell, Earth occultation is not taken into by the flux package or any part of our simulation software. In fact, the reason for the xml tag <solid_angle mincos="-0.4" maxcos="1."/> in the entry for this source is to account for Earth occultation in a very, very crude way. For the step rocking mode we used for DC1, this restriction on solid angle had almost no effect. For any other pointing mode, it will almost certainly not do the right thing.

  4. Earth occultation is implemented in FluxSource::Occulted() in the flux package. This has been there for quite some time, after an inital false start, it was used successfully in the generation of the DC1 data. The angles in xml tags like <solid_angle mincos="-0.4" maxcos="1."/> are defined in the zenith pointed frame, so are independent of the pointing mode (the documentation does not make this very clear). In Gleam, Earth occultation and sources defined in the zenith-pointed frame (like the extragalactic diffuse and Earth albedo) seem to do the right thing.