\documentclass[10pt]{article}

\usepackage{fullpage}
\usepackage{setspace}
\usepackage{parskip}
\usepackage{titlesec}
\usepackage[section]{placeins}
\usepackage{xcolor}
\usepackage{breakcites}
\usepackage{lineno}
\usepackage{hyphenat}





\PassOptionsToPackage{hyphens}{url}
\usepackage[colorlinks = true,
            linkcolor = blue,
            urlcolor  = blue,
            citecolor = blue,
            anchorcolor = blue]{hyperref}
\usepackage{etoolbox}
\makeatletter
\patchcmd\@combinedblfloats{\box\@outputbox}{\unvbox\@outputbox}{}{%
  \errmessage{\noexpand\@combinedblfloats could not be patched}%
}%
\makeatother


\usepackage[round]{natbib}
\let\cite\citep




\renewenvironment{abstract}
  {{\bfseries\noindent{\abstractname}\par\nobreak}\footnotesize}
  {\bigskip}

\titlespacing{\section}{0pt}{*3}{*1}
\titlespacing{\subsection}{0pt}{*2}{*0.5}
\titlespacing{\subsubsection}{0pt}{*1.5}{0pt}


\usepackage{authblk}


\usepackage{graphicx}
\usepackage[space]{grffile}
\usepackage{latexsym}
\usepackage{textcomp}
\usepackage{longtable}
\usepackage{tabulary}
\usepackage{booktabs,array,multirow}
\usepackage{amsfonts,amsmath,amssymb}
\providecommand\citet{\cite}
\providecommand\citep{\cite}
\providecommand\citealt{\cite}
% You can conditionalize code for latexml or normal latex using this.
\newif\iflatexml\latexmlfalse
\providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}%

\AtBeginDocument{\DeclareGraphicsExtensions{.pdf,.PDF,.eps,.EPS,.png,.PNG,.tif,.TIF,.jpg,.JPG,.jpeg,.JPEG}}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}










\begin{document}

\title{Gain Calibration of the NuSTAR CZT Detectors~~~}



\author[1]{Brian Grefenstette}%
\author[1]{Kristin K. Madsen}%
\affil[1]{California Institute of Technology (Caltech)}%


\vspace{-1em}



  
  \date{June 18, 2024}


\begingroup
\let\center\flushleft
\let\endcenter\endflushleft
\maketitle
\endgroup








\sloppy


\section*{Introduction}

{\label{269235}}

\par\null

The \emph{Nuclear Spectrscopic Telescope ARray
(NuSTAR)}~\cite{Harrison_2013}~is a NASA Astrophysics Small Explorer
observatory that launched in June of 2012. \emph{NuSTAR}~is composed of
two co-aligned hard X-ray telescopes focused onto two focal plane arrays
(hereafter FPMA and FPMB). We have previously described the
time-dependent gain calibration of the detectors as a function of time
\cite{Madsen_2015}. Here we describe an updated approach to the
time-dependent gain and our process for validating our time-dependent
gain corrections to determine if any additional corrections as a
function of time are required.~

\section*{Updates to Time-dependent Gain
Calibration}

{\label{279513}}

The conversion of the pulse heights (PHAs) collected by the
\emph{NuSTAR} detectors is a multi-stage process that relies on several
underlying CALDB files (for a full description see
the~\href{https://heasarc.gsfc.nasa.gov/docs/nustar/analysis/nustar_swguide.pdf}{NuSTAR
data analysis software users guide}). Several corrections were made to
the CLC files after launch to account for differences in the gain for
the FPMA detectors compared to pre-launch estimates using the in-flight
\textbf{155-Eu} calibration source. However, since the lines that are
produced are predominantly at high energies (86.54 and 105.4 keV) with
several blended X-ray lines at low energies (including strong lines at
6.06 and 6.71 keV. In \cite{Madsen_2015}{ we used two epochs of the
calibration source to determine the time-dependent change in the energy
scale using the standard }\emph{Xspec}{~formalism, where the transfer
function to the correct }\emph{PI}{~values are:}

\par\null

\begin{equation}
PI^{\prime} = PI / Slope - Offset
\end{equation}



\ldots{}where in Table 7 of~\cite{Madsen_2015}{ we allowed both the
}\emph{Slope}{ and }\emph{Offset}{ to vary as a function of time. Values
were stored for the 2012 and 2015 epochs and the NuSTARDAS pipeline then
interpolated the corrections to a given epoch for an observation.}

In subsequent analyses of observations of the Crab we noted allowing
the~\emph{Offset} parameter to vary with time was artificially
introducing low energy residuals in the Crab spectrum. We instead re-fit
the 2012 and 2015 calibration source data with the \emph{Offset} value
frozen to zero, thereby forcing all time-dependent variations into
the~\emph{Slope}~parameter. This remove the artificial~low-energy
residuals in the Crab spectrum. The updated values for the 2015 epoch
calibration source data are given below. The method we use to determine
the offsets~is formally limited by the digitization of the~\emph{NuSTAR}
energy channels (which have a width of 40 eV). To achieve a 20 eV shift
(enough to shift a count from one channel to the next) at the 86.54 keV
line energy of the calibration source, the \emph{Slope} must differ from
unity by at least 2e-4 so all values in the table below are assume to
have an uncertainty of (2) in the last reported digit.

\par\null

The implementation of the gain CALDB files assumes that the variations
are linear with time with the measure changes in the gain corresponding
to a drop of 0.2\% per year from 2012-2015. This does not currently
extrapolate beyond 2015.

\par\null

\begin{center}
\begin{tabular}{lrrrr}
\hline
Module & Det0 & Det1 & Det2 & Det3 \\
\hline
FPMA & 0.9933  & 0.9919  & 0.9993   & 0.9973  \\
FPMB & 0.9955  & 0.9929  & 0.9928   & 0.9960  \\
\hline
\end{tabular}
\end{center}

\par\null

\section*{Long-term Monitoring of the Gain
Calibration}

{\label{476795}}

\subsection*{}

{\label{585732}}

\subsection*{Strategy}

{\label{391926}}

The long-term monitoring of the the gain can be accomplished without
risking the deployment of the source (which is mounted on a mechanical
arm that moves in and out of the focal plane). We break the monitoring
into two cases: (1) monitoring the relative change in the \emph{Offset}
using an astrophysical source; and (2) monitoring the relative change in
the~\emph{Slope} using high-energy background lines in the~\emph{NuSTAR}
background. Both of these measurements are performed after the
time-dependent \emph{Slope} correction been applied to the data.

\subsection*{Offset Monitoring}

{\label{585077}}

Use use the Kepler supernova remnant (SNR) to determine if there have
been any changes in the~\emph{Offset}~beyond what is recorded in the
CALDB. This remnant is compact (only 3-acmin across), allowing us to
easily integrate over the entire remnant. We concentrate on the
low-energy X-ray band (2.5 -- 10 keV) where the spectrum can be describe
by two thermal plasmas (modeled here using bremss) and several X-ray
lines from the heated ejecta. Here we do not attempt to determine any
spatial variations in the ejecta spectrum; we are primarily interested
in constructing a phenomenological model that produces an adequate fit
to the spectrum. We know that on the time scale of
\textasciitilde{}years the spectrum should not be changing. We can then
use observation spaced out over several years to search for changes in
the energy scale.

\par\null\par\null

\par\null\selectlanguage{english}
\begin{figure}[h!]
\begin{center}
\includegraphics[width=0.70\columnwidth]{figures/kepler-with-model3/kepler-with-model3}
\caption{{Data (black circles with 1-sigma errors) along with the bremss models
(dashed orange), and Gaussian lines representing contributions from Si
(cyan), S (purple), Ca (magenta), broad and narrow Fe lines (green) and
Ni (red) and the combined model (blue).
{\label{393167}}%
}}
\end{center}
\end{figure}

Kepler was observed during the extended prime mission as part of the
supernova remnant program. We have subsequently observed the remnant as
part of Director's Discretionary Time (DDT). We plan on continuing to
observe to remnant roughly once per year for roughly 50 ks per year to
continuing monitoring the gain shift.\selectlanguage{english}
\begin{figure}[h!]
\begin{center}
\includegraphics[width=1.00\columnwidth]{figures/comparison-figures/comparison-figures}
\caption{{A comparison of the spectra between the 2014 epoch (black) and the
April~2017 epoch (red) along with the best fit models (top) and the
ratio of the models to the data (bottom).
{\label{248567}}%
}}
\end{center}
\end{figure}

The only free parameters in the figures are a cross-normalization term
to account for any change in the off-axis angles and the~\emph{Offset}
parameter for the later epoch. The 90\% limits on \emph{Offset}
parameters are given in the table below.

\par\null

\begin{center}

\begin{tabular}{ccc}
\hline
Observation Epoch & FPMA Offset (eV) & FPMB Offset (eV) \\
\hline
2014-10-11T12:21:07 & - & - \\
2017-04-22T08:51:09 & 12 $\pm$ 10 & -7 $\pm$ 10 \\
2017-10-08T19:06:09 & -25 $\pm$ 11 & -21 $\pm$ 11 \\ 
\hline
\caption{{Note: Offsets are given with respect to the 2014 observation
\end{tabular}
\end{center}

\subsection*{Gain Monitoring}

{\label{795285}}

As all of the lines in Kepler are at relatively low energy, we cannot
use these observations to constrain the \emph{Slope} parameter. We can,
however, use ~high-energy background lines to accomplish this. We
integrate over all data where \emph{NuSTAR} is pointing at the Earth
(know as ``MODE02'' in NuSTARDAS parlance) and compare the
year-over-year spectra. We use the data from 100 -- 150 keV, which are
relatively easy to interpret as the contributions mainly come from the
internal background continuum component as well as lines from the
calibration source at 105, 122, and 144 keV.

The internal continuum is modeled as a broken power-law and, as we
expect this to derive from down-scattered components in the instrument,
we use a diagonal RMF (rather than the~\emph{NuSTAR}~CZT RMFs that are
appropriate for incident photons). Since the continuum model is
dependent on the space weather conditions (which may vary
year-over-year) we allow the power-law indices above and below the break
energy (fixed to 124 keV) as well as the normalization of the broken
power law to vary between the two year-long spectra. The only other free
parameter is the~\emph{Slope}, implemented here by Xspec's ``gainfit''
formalism with the~\emph{Offset} parameter frozen to zero. A comparison
of the 2012 and 2017 background epochs are shown below after best-fit
gain shift have been applied. We do not find any evidence for an
additional gain shift, verifying our assumption that the gain drift is
linear with time.

\par\null

\begin{figure}[h!]
\begin{center}
\includegraphics[width=1.00\columnwidth]{figures/comparison-spec1/comparison-spec1}
\caption{A comparison of the spectra for DET0 on both FPMs between the 2012 epoch
(black) and the 2017 epoch (red) along with the best fit models (top)
and the ratio of the models to the data (bottom).
{\label{880146}}%
}
\end{center}
\end{figure}

\begin{center}
\begin{tabular}{crr}
\hline
Date & FPMA Slope & FPMB Slope\\
\hline
2017 v 2012 & 0.9994 $\pm$ 0.0004 & 0.9998 $\pm$ 0.0003 \\
\hline
\end{tabular}
\end{center}

\section*{Conclusion}

{\label{559130}}\par\null

With the current \emph{NuSTAR} calibration we find deviations from the
time-dependent gain stored in the CALDB file of substantially less than
1 NuSTAR channel (40 eV) over the three year baseline currently
available in the Kepler data set. We will continue to monitor Kepler
once per year to monitor any changes in the \emph{Offset} that may be
required.

Over the \textasciitilde{}4.5 year baseline from mid-2012 to early 2017
we find small residual deviations in the~\emph{Slope} parameter. At 80
keV, these deviations correspond to a shift in a line centroid of
roughly 40 eV, or one \emph{NuSTAR} channel. However, the uncertainties
in the \emph{Slope} measurements are large enough that we do not
consider additional corrections to the NuSTAR gain required at this
time.

We consider these results a confirmation that we have adequately
characterized the time-dependence of the gain of the~\emph{NuSTAR}
detectors as a function of time.

\section*{Appendix: History of Gain-Related CALDB
Files:}

{\label{929361}}\par\null

\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}

\subsection*{nu{[}A/B{]}clc20100101v001.fits \textbar{}
nu{[}A/B{]}gain20100101v004.fits}\label{nuabclc20100101v001.fits-nuabgain20100101v004.fits}

Pre-launch values.

Based on ground calibration data and data obtained during environmental
testing (for FPMB).

\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}

\subsection*{nu{[}A/B{]}clc20100101v002.fits \textbar{}
nu{[}A/B{]}gain20100101v005.fits}\label{nuabclc20100101v002.fits-nuabgain20100101v005.fits}

Released in \textasciitilde{}July 2012.

Corrections based on 2012 calibration source data.

No time dependence.

Contains large corrections to FPMA, smaller corrections to FPMB.

Grade-dependent values given in the gain file.

\subsection*{nu{[}A/B{]}clc20100101v004.fits \textbar{}
nu{[}A/B{]}gain20100101v006.fits}\label{nuabclc20100101v004.fits-nuabgain20100101v006.fits}

Released in March 2015.

CLC update based on revised analysis of 2012 data.

Time-dependent \emph{Slope} and \emph{Offset} values given in the gain
file.

\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}

\subsection*{nu{[}A/B{]}gain20100101v007.fits}\label{nuabgain20100101v007.fits}

Released in July 2016. \textbf{Current set of CALDB Files}

Analysis described above.

Uses the 005 version of the gain files as a base and performs a
cross-correlation between the 2012 and 2015 calibration data sets to
determine the \emph{Slope} parameter. The \emph{Offset} parameter is not
allowed to vary with time.

\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}

\subsection*{nu{[}A/B{]}clc20100101v005.fits}\label{nuabclc20100101v005.fits}

Unreleased.

Same as v004 CLC with the GR\_OFFSET += 25 channels.

\selectlanguage{english}
\FloatBarrier
\bibliographystyle{plainnat}
\bibliography{bibliography/converted_to_latex.bib%
}

\end{document}

