%% This is a manuscript marked up using the
%% AASTeX v5.x LaTeX 2e macros. 

\documentclass[]{emulateapj}
\usepackage{amsmath}

\usepackage{epsfig}
\usepackage{rotate}
%\usepackage{lscape}
%\usepackage{setspace}

\newcommand{\myemail}{jarronl@email.arizona.edu}

\usepackage{hyperref}
\usepackage[capitalize,noabbrev]{cleveref}
\crefname{section}{\S}{\S\S}
\Crefname{section}{\S}{\S\S}
% patch for emulateapj
\makeatletter
\usepackage{etoolbox}
\patchcmd\H@refstepcounter{\protected@edef}{\protected@xdef}{}{}
\makeatother


\newcommand{\pynrc}{\texttt{\MakeLowercase{py}NRC}}

% Custom definitions and commands
\def\arcsec{{$^{\prime\prime}$}}
\def\arcmin{{$^{\prime}$}}
\def\ptsec{$^{\prime\prime}\mskip-7.6mu.\,$}
\def\ptmin{$^{\prime}\mskip-4.0mu.$}
\def\ptdeg{$^\circ\mskip-7.6mu.\,$}

\newcommand{\um}{$\mu$m}
\newcommand{\sm}{M$_{\sun}$}
\newcommand{\acet}{C$_2$H$_2$}
\newcommand{\water}{H$_2$O}
\newcommand{\neii}{[Ne~{\scshape II}]}
\newcommand{\neiii}{[Ne~{\scshape III}]}
\newcommand{\hi}{H~{\scshape I}}
\newcommand{\ctemp}{$[6.0]-[13.5]$}

\newcounter{qcounter}
% A nice bulleted list
\newcommand{\squishlist}{
 \begin{list}{$\bullet$}
  { \setlength{\itemsep}{2pt}
     \setlength{\parsep}{0pt}
     \setlength{\topsep}{3pt}
     \setlength{\partopsep}{0pt}
     \setlength{\leftmargin}{2.5em}
     \setlength{\labelwidth}{1em}
     \setlength{\labelsep}{0.5em} } }
\newcommand{\squishlisttwo}{
 \begin{list}{$\bullet$}
  { \setlength{\itemsep}{0pt}
     \setlength{\parsep}{0pt}
     \setlength{\topsep}{0pt}
     \setlength{\partopsep}{0pt}
     \setlength{\leftmargin}{2em}
     \setlength{\labelwidth}{1em}
     \setlength{\labelsep}{0.5em} } }
\newcommand{\squishnum}{
 \begin{list}{\arabic{qcounter}.}
  {  \usecounter{qcounter}
     \setlength{\itemsep}{2pt}
     \setlength{\parsep}{0pt}
     \setlength{\topsep}{3pt}
     \setlength{\partopsep}{0pt}
     \setlength{\leftmargin}{2.5em}
     \setlength{\labelwidth}{1em}
     \setlength{\labelsep}{0.5em} } }
\newcommand{\squishend}{
  \end{list}  }


\shorttitle{\pynrc}
\shortauthors{Leisenring \emph{et al.}}

\begin{document}

\title{\pynrc: A NIRCam ETC and Simulation Toolset}

\author{Jarron M. Leisenring, Everett Schlawin, Marcia Rieke}
\affil{Steward Observatory, University of Arizona, 933 N.\ Cherry Ave., Tucson, AZ 85721}
\email{jarronl@email.arizona.edu}

\author{Jonathan Fraine}
\affil{Space Telescope Science Institute, Baltimore, MD 21218}

\author{Thomas Greene}
\affil{NASA Ames Research Center, Space Science and Astrobiology Division, M.S. 245-6, Moffett Field, CA 94035}


%\doublespace
\begin{abstract}
With the approaching launch of the James Webb Space Telescope (JWST), the astronomical community requires easily accessible software tools to assist in the development of observing proposals. Each science instrument offers a variety of observing modes with a range of flexibility and complexity often confusing to an uninitiated user. As JWST's primary near-IR imager, NIRCam is no exception, offering simultaneous wide-field imaging of two wavelength channels, coronagraphic imaging over small fields of view, wide-field slitless spectroscopy at two perpendicular orientations, and time-series observations in both imaging and spectroscopic modes. We present the open-source Python package \pynrc, a NIRCam-specific exposure time calculator (ETC) and simulator to help choose optimal instrument settings for specific science cases. At its core, \pynrc\ uses point-spread-function (PSF) information generated by WebbPSF to create two-dimensional signal and noise images. The package incorporates realistic throughputs, detector effects, and MULTIACCUM ramp sampling schemes with results verified and validated by the NIRCam instrument design team. Building off of this framework, \pynrc\ goes beyond a simple ETC and also includes functions to generate realistic simulations of complex astronomical scenes, enabling end-to-end testing of the JWST data management system, reduction pipelines, and analysis techniques.
\end{abstract}

\keywords{JWST, NIRCam, Instrument Simulation, Python, Software}

\section{Introduction}

NIRCam acts as the primary near-infrared (NIR) camera for the James Webb Space Telescope (JWST). With wavelength coverage from $\lambda=0.6$ to 5.0~\um, NIRCam offers multiple observing modes such as wide-field imaging, coronagraphic imaging (20\arcsec~$\times$~20\arcsec), and slitless spectroscopy spanning $\lambda=2.4$ to 5.0~\um\ \citep{beic12, kris07, riek05, gree07, gree17}. In addition, future proposal cycles may expand the allowed science modes, presenting users the opportunity to observe with NIRCam's dispersed Hartmann sensors (DHSs), which provides spectral coverage at $\lambda=1$ to 2~\um\ with $R \equiv \lambda/\delta\lambda \simeq 300$ \citep{schl17}.

As the main instrument responsible for wavefront sensing and primary segment phasing, NIRCam was constructed with multiple redundant systems to minimize risk of critical failures. Specifically, the instrument consists of two identical modules (A and B), each with an independet 2\ptmin2~$\times$~2\ptmin2 field of view (FOV) adjacently aligned. Each module further houses two wavelength channels separated by a dichroic beamsplitter and occupying the same FOV. The short-wavelength (SW) channel images $\lambda<2.4$~\um\ light onto a grid of four HAWAII-2RG \citep[H2RG;][]{bele08} detectors (32~mas/pixel), whereas the long-wavelength (LW) channel utilizes a single H2RG with approximately twice the pixel scale (65~mas/pixel). This allows simultaneous observations with the SW and LW channels of the same NIRCam field in each module.

While a boon for observers, the expanded instrument modes and built-in flexibility also burdens users with added complexity and potential confusion. For instance, it may not be obvious which observational mode and detector readout setting will optimize the scientific return, especially when taking into account instrument and observatory overheads and efficiency. Initially devised as a guide for Guaranteed Time Observations (GTO) science program, the NIRCam instrument team developed an exposure time calculator (ETC) to better understand the relative instrument performance between different modes. This software evolved into \pynrc, a Python-based toolset that includes a simple ETC for quick calculations, a basic slope image simulator, and a full-featured simulator to generate realistic raw data for testing reduction pipelines and analysis software. Simulation components, such as instrument throughputs and detector characteristics, are based on as-built performance tests wherever possible and observatory design parameters otherwise. All PSFs are generated via WebbPSF\footnote{\url{https://webbpsf.readthedocs.io}} \citep{perr12,perr14} to reproduce realistic NIRCam images and spectra. 

\acknowledgments
\section*{Acknowledgments}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Bibliography
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\clearpage


\bibliographystyle{apj}

\bibliography{refs}


\end{document}




