{'fraction_non_alphanumeric': 0.023539956599679213, 'fraction_numerical': 0.015709029153693745, 'mean_word_length': 4.69406392694064, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Background estimation in a wide-field background-limited instrument such as Fermi GBM

The supporting instrument on board the Fermi Gamma-ray Space Telescope, the Gamma-ray Burst Monitor (GBM) is a wide-field gamma-ray monitor composed of 14 individual scintillation detectors, with a field of view which encompasses the entire unocculted sky. Primarily designed as transient monitors, the conventional method for background determination with GBM-like instruments is to time interpolate intervals before and after the source as a polynomial. This is generally sufficient for sharp impulsive phenomena such as Gamma-Ray Bursts (GRBs) which are characterised by impulsive peaks with sharp rises, often highly structured, and easily distinguishable against instrumental backgrounds. However, smoother long lived emission, such as observed in solar flares and some GRBs, would be difficult to detect in a background-limited instrument using this method. We present here a description of a technique which uses the rates from adjacent days when the satellite has approximately the same geographical footprint to distinguish low-level emission from the instrumental background. We present results from the application of this technique to GBM data and discuss the implementation of it in a generalised background limited detector in a non-equatorial orbit.


INTRODUCTION
Wide-field instruments have played an important role in the development of gamma-ray astronomy by performing the important task of simultaneously monitoring a large fraction of the sky. They can therefore alert highly sensitive, narrow-field instruments to transient activity that would otherwise not be detected. An important example is the detection of the first Gamma-Ray Burst (GRB) afterglow in the optical and X-ray regimes. 1,2 Scintillation detectors in the gamma-ray regime are particularly well suited to the role of monitors, due to their wide field of view, large energy bandwidth and affordability (relative to more complex focused detectors).
Such systems have several limitations, primarily the lack of positional information. This can be somewhat ameliorated by using several detectors and comparing the relative rates in each to derive the approximate location. This typically gives locations with accuracy on the order of degrees. A further limitation is that in general, such systems are optimised for the study of bright impulsive events, cannot able to easily separate smooth emission from the background.
For satellites in low earth orbits, the instrumental background has large variations over the course of an orbit due to the variation of local particle flux densities in the atmosphere. A secondary effect is activation of the spacecraft materials following passage through the South Atlantic Anomaly (SAA). The relatively short periods of such orbits also means that bright sources (e.g. Crab, Cyg X-1 and Sco X-1) which enter/exit earth occultation will result in a step in the background continuum. In order to make accurate measurements, a confident estimation of this variable background level is necessary. The conventional method for determining the background in wide-field instruments is to interpolate time intervals before and after the event of interest as a polynomial (usually of order 0-4). This is particularly well suited to the study of transient phenomena such as GRBs, the prompt emission of which is characterized by impulsive peaks with sharp rises, often highly structured, and easily distinguishable against instrumental backgrounds. The timescales on which the prompt emission occurs is usually short enough that this method is sufficient, however for events with long durations or less impulsive time profiles, a more rigorous background determination is required.
In this work we present one method of background estimation which uses the rates from alternate days when the satellite had the same geographical footprint. In § 2 we present the scientific motivation/requirement for a more rigorous background determination and in § 3 we describe the Fermi telescope and the Gamma-ray Burst Monitor (GBM). In § 4 we present a detailed description of our method of background estimation, and in § 5 we discuss several ways in which our technique was validated.

SCIENTIFIC MOTIVATION
Capable of making observations across an unprecedented 8 decades of energy (10 keV -300 GeV), the Fermi Gamma-Ray Space Telescope has ushered in a new era in gamma-ray astrophysics. This broad energy bandwidth is afforded by its two constituent instruments, the Large Area Telescope (LAT), a pair-production telescope with an effective energy bandwidth of 20 MeV -300 GeV 3 and the supporting instrument, the Gamma-ray Burst Monitor (GBM), which consists of 14 individual scintillation detectors with an effective energy range of 10 keV -40 MeV. 4 Gamma-ray bursts (GRBs) and solar flares are two of the strong science drivers for both instruments on-board Fermi.
With GRBs, this has lead directly to the discovery of additional high and low energy spectral components in addition to the empirical 'Band' model 5 (e.g. Abdo et al. 6 and Ackermann et al. 7 ). The sensitivity of the Large Area Telescope (LAT) on board Fermi has also led to the discovery of long lived emission in the MeV-GeV energy range on kilo-second timescales. Extended emission from GRBs above 100 MeV had previously been hinted at by observations made by the EGRET instrument on board the Compton Gamma Ray Observatory. 8 This emission has been observed in several GRBs by the LAT and can be explained as synchrotron emission from the external forward shock. 9, 10 These observations on timescales which have been conventionally associated with lower energy (sub-MeV) afterglow emission have raised the question of whether such emission would be visible in GBM.
Fermi GBM has detected 511 keV positron annihilation, 2.2 MeV neutron capture lines, and several other nuclear lines up to 7 MeV from an M-class solar flare on June 12 2010. 11 The Large Area Telescope (LAT) detected emission above 100 MeV from this flare, most likely from pion decay. Current predictions place the sunspot number maximum during February 2013 † , and as it approaches we can expect the frequency of solar flares to increase. Class X and M flares can have durations on the order of hours, and in order to study them with GBM, and in particular to trace the evolution in time of the nuclear line component, a reliable background subtraction method is required. Once this is achieved, the evolution of the nuclear emission with the non-thermal emission from accelerated particles can be studied, at both GBM and LAT energies. GBM is the successor of the highly successful BATSE instrument on board the Compton Gamma Ray Observatory. Connaughton (2002) 12 employed a method of background estimation to create background subtracted signals from hundreds of BATSE GRBs. By summing these, extended emission up to hundreds of seconds after the bursts was found. This provides clear evidence that the conventional interpolation method of determining the background is not always sufficient, particularly for the situations described above. A more rigorous method is required to deal with such cases of non-structured emission. Motivated by this, and particularly by the approaching solar maximum, we have developed a technique to accurately determine the background.

FERMI-GBM
In orbit since June 2008, Fermi has an altitude of ∼565 km, inclination of 26 • , and period of ∼95 minutes. Both instruments recorded data continuously except when passing through the SAA (see Fig 1). The primary observation mode of Fermi is sky survey mode. This mode optimises the sky coverage of the LAT whilst maintaining near uniform exposure. In this mode the satellite rocks about the zenith such that the entire sky is observed for ∼30 minutes every 2 orbits (∼ 3 hours). The rocking causes the satellite pointing to alternate between the northern and southern hemispheres each orbit. The variation in pointing complicates the background in GBM, already highly variable due to the changing geomagnetic conditions. As the satellite slews, bright sources enter/exit the field of view of individual detectors. This manifests in the data as steps, the amplitude of which depends on the strength of the source. The rates in two of the detectors on GBM over 5 orbits (∼25.5 ks) can be seen in Fig. 2.
Of the 14 individual scintillation detectors which make up GBM, 12 are sodium iodide (NaI) which cover the energy range 10 -1000 keV and 2 are bismuth germanate (BGO) which cover 200 keV -40 MeV. The 12 NaI detectors are positioned in clusters of three around the spacecraft such that any event which is above the horizon of the Earth's limb will illuminate at least one cluster. The two BGO detectors are positioned at opposite sides of the spacecraft, aligned perpendicular to the LAT boresight.

BACKGROUND ESTIMATION USING ORBITAL SUBTRACTION
Motivated by Connaughton (2002), 12 we have implemented a simple method which uses the rates from adjacent days, when the satellite has the same geographical footprint to estimate the background at the time of interest.
The orbit of Fermi is such that it will be at approximately the same geographical coordinates every 15 orbits (∼24 hrs). However, due to the rocking angle of the spacecraft in sky survey mode, the pointing of the individual GBM detectors is only the same every second orbit. Thus, sources within the field of view (FOV) at T 0 may be outside the FOV at T 0 ± 15 orbits and so this temporal offset cannot be used to approximate the rates at T 0 . This leaves two possibilities; to use the rates from T 0 ± 30 orbits or use the rates from T 0 ±14 and T 0 ±16 orbits to approximate the rates from T 0 ±15 orbits. As the background region is offset in time, the change in the sky background at a given geomagnetic location increases. An initial study showed that the rates from ±30 and ±14,16 orbits can be used interchangeably to estimate the background at the time of interest unless there is a SAA passage exit close to the time of interest, in which case the rates from ±30 should be used. 13 A major limitation of this technique is that it cannot be employed to investigate times during which the satellite underwent an Autonomous Repoint Request (ARR) or any other deviation from the standard sky survey mode of operation (e.g. ToO). When an ARR is triggered the telescope will slew so that the GBM calculated position is within the LAT FOV. A natural consequence of this is that the periodic pointing is interrupted for the duration of the ARR (∼2.5 hours, formerly 5 hours).

VERIFICATION
In order to test the validity of the technique, an initial study was undertaken, the results of which showed good agreement between the estimated and observed rates. 13 For four blank fields of duration 2.5 ks, this method generates a background which closely matches the rates in the source region for both NaI and BGO detectors. However, in order to fully validate the method a more rigorous investigation was performed. Specifically, systematic offsets in temporal and spectral properties were investigated and are described below.

Blank Sky Tests
In order to search for systematic offsets, 120 blank fields of duration 2 ks were selected from the first three years of operation (excluding regions of high solar and Soft-Gamma Repeater (SGR) activity). For each region, lightcurves of the on region (defined as the source) and the estimated off region (defined as the background) in three representative energy bands for the NaI and two energy bands for the BGO were generated using the rates from ±30 orbits. Details of these energy bands and the rationale for their selection can be seen in Table 1. The data used were continuous CSPEC, which consist of 128 pseudo-logarithmic spectral bins and 4.096 s timing resolution. Regions where there was clear evidence of an interfering source or a systematic offset between the on and the off were flagged as bad and discarded. For each energy band, an average residual lightcurve (on − off) was found by averaging all regions and the results are shown in Fig. 3. For each energy band, the average lightcurve is best fit with a 0 th order polynomial which is consistent with a straight line of intercept zero. For both BGO energy bands, the average lightcurve shows a clear negative bias. As an additional test, the significance 14 of the on relative to the off was calculated for each region. The distribution of significances for each energy range was then modelled as a normal distribution, the results for the NaI and BGO energy bands can be seen in Fig. 4. For the NaI energy bands, the significances are well-described by Gaussian functions: 10-1000 has a slightly negative mean, 25-1000 has a slightly positive mean and the mean  . Left: Average lightcurves in each energy band for blank field regions for NaI detectors in ∼20 s bins. For each energy band, the data is best described by a 0 th order polynomial of intercept zero. Right: Average lightcurves in each energy band for blank field regions for BGO detectors in ∼20 s bins. For each energy band, the data exhibits a clear negative bias, however the best fit is a 0 th order polynomial which is consistent with a straight line of zero intercept.  of 50-300 is consistent with zero. This is the expected result, as 50-300 keV is the most sensitive range of the NaI. For the BGO energy ranges the resulting distributions are a factor of ∼2 wider and both exhibit a clear negative offset from zero. This may be due to the effect of activation following SAA passages and warrants further investigation.  method introduces a further uncertainty in the position of spectral features. The current implementation of the orbital subtraction technique aligns the data from the different epochs in channel space and then selects the channel-energy edges from the day of the on region. These edges are also used for the background regions. This assumes that the on-flight calibration is sufficient.

Gain Drift
In orbit, the gain of the detectors can be influenced by a variety of factors, including temperature, ageing of the PMTs, etc. This is corrected on board the spacecraft by the automatic gain control (AGC) which adjusts the high voltage of the detectors to keep a background line in a specific channel. 4 For the NaI detectors the background feature used as reference is the 511 keV annihilation line and in the BGO is the 2.2 MeV neutron capture line. Due to the fact that the high voltage can only be adjusted in discrete steps of 2 V, and to prevent the AGC from chasing statistical fluctuations in the data, the accumulation time used is 90 minutes. The AGC therefore allows small drifts in the gain to proceed uncorrected. In order for the high voltage to be changed, the position of the line must change by 1.4% in the NaI and 1% in the BGO. Predictions made pre-launch give a rms gain variation of < 2% per detector over one orbit assuming the worst case thermal and magnetic models.
To investigate whether the current implementation is sufficient, two datasets from the BGO detectors of ∼3 ks duration separated by 60 orbits (∼324 ks) were selected. The BGO were selected as they have two spectral line features that are visible in the background count spectra (counts/s/keV), the 511 keV and 2.2 MeV lines. The difference between the normalised counts spectra was found and examined for a smearing out of the line features that would be indicative of an uncorrected gain drift. This was performed twice, once for a period of low solar activity in November 2009 and once for high solar activity in March 2012. The results can be seen in Fig. 5. Quantifying the level of gain drift present is complicated by the relative coarseness of the spectral resolution of the detectors on GBM, however examination of the residual plots hints at the possibility of a smearing of the 511 keV line. A lack of statistics limits the amount that can be said for the 2.2 MeV line. In order to draw a more quantitative conclusion on the level of gain drift, a spectral fit to a source with strong line features is required, with a solar flare being the ideal candidate. This was performed for the June 12 th 2010 M2 class solar flare, 11 and is described in the following section ( § 5.2.1).

Solar Flare June 10th
On June 12 th 2010, both instruments on board Fermi detected a GOES M2 class solar flare (SOL2010-06-12T00:57). 11 The flare had an impulsive phase of ∼50 s and produced gamma-ray emission up to 400 MeV. The short duration of this event implies that the polynomial method should be sufficient and therefore it is an excellent opportunity to compare the results from the two different background methods. The data from the BGO detector on the sun facing side of the satellite were analysed using a background derived with the  usual polynomial method and with one derived from the orbital subtraction technique using the rates from ±30 orbits. A lightcurve of the event and a comparison of the two backgrounds can be seen in Fig. 6. Following Ackermann et al. (2012), 11 in each case the spectrum was fit with a compound model consisting of a power law, a power law with exponential cutoff, a nuclear de-excitation component and two Gaussians (511 keV and 2.2 MeV spectral lines). In order to check for a shifting of the spectral line features, the centroid of the 2.2 MeV line was frozen and the 511 keV centroid left as a free parameter. The resulting νF ν spectra for each background model can be seen in Fig. 7. The fit parameters are comparable for both background models, but the fit statistic increases significantly for the background derived using orbital subtraction (∆Castor C-Stat ‡ ∼60). For both the polynomial and orbital subtraction methods the centroids of the 511 keV line are consistent (534 ± 16 keV and 530 ± 17 keV respectively).
The consistent fit parameters for the different background methods proves that the orbital subtraction method is a viable technique for background estimation. The good agreement of the 511 keV centroid for both interpolated and estimated backgrounds shows that the orbital subtraction method does not introduce an additional uncertainty in the line feature position.

IMPLEMENTATION IN A GENERALISED BACKGROUND LIMITED DETECTOR
The orbital subtraction method described herein can be generalised to any background-limited detector which is in a non-equatorial low earth orbit. The exact implementation of the technique depends on the main observation mode of the satellite. For example, BATSE had a fixed zenith pointing on timescales of 2 weeks, therefore the background could be estimated using data from ±15 orbits, whereas the sky survey mode of Fermi means that ±30 orbits must be used. For a generalised instrument, the precise offset depends intrinsically on the orbital parameters of the spacecraft, such as altitude, inclination and orbital period.
The applicability of the technique depends very much on the energy of the instrument. For hard X-rays (arbitrarily defined as < 25 keV), the background variation is composed not only of the local particle flux density, but also includes a contribution from transient X-ray sources. This limits the effectiveness of this technique at these energies, as it cannot account for bright variable sources, which must be manually flagged as bad. In contrast, for gamma-rays, the main variation in the background is due to the local particle flux density (excluding solar contributions). This energy regime is therefore more suited to this technique. An important point is that this method does not account for the contribution of source photons which are scattered by the Earth's upper atmosphere (albedo photons).

CONCLUSION
Attempting to study long lived or non-impulsive smooth emission in a background limited instrument like GBM presents many challenges. In order to do so, the orbital background subtraction technique has been developed. This technique has been validated via several tests, which show that it is a viable method of background estimation.
The best fit to the average residual lightcurve for ∼ 120 blank fields for 5 energy bands was found to be consistent with zero. The distributions of significances for the 3 NaI energy bands were found to be well described by Gaussians, with means consistent with zero. In contrast, for the two BGO energy bands, the means of the Gaussians are not consistent with zero. This may be due to the effect of activation following SAA passage, and will be the subject of future study.
The June 12 th M2 class solar flare was used to compare the results of the conventional polynomial method with that of orbital subtraction. In both cases, the resultant parameters from the spectral analysis are consistent within errors. The 511 keV line centroid and associated error are consistent for both methods. From this, we conclude that the effect of gain drift introduced by the orbital subtraction method is less than the intrinsic gain drift of the instrument and therefore does not contribute significantly to the smearing of spectral features.