#  walter: A Tool for Predicting Resolved Stellar Population Observations
with Applications to the Roman Space Telescope

Lachlan Lancaster Department of Astrophysical Sciences, Princeton University,
4 Ivy Lane, 08544, Princeton, NJ, USA  Sarah Pearson Center for Cosmology and
Particle Physics, Department of Physics, New York University, 726 Broadway,
New York, NY 10003, USA  Center for Computational Astrophysics, Flatiron
Institute, 162 5th Avenue, New York City, NY 10010, USA  Benjamin F. Williams
Department of Astronomy, Box 351580, University of Washington, Seattle, WA
98195, USA  Kathryn V. Johnston Department of Astronomy, Columbia University,
Mail Code 5246, 550 West 120th Street, New York City, NY 10027, USA  Center
for Computational Astrophysics, Flatiron Institute, 162 5th Avenue, New York
City, NY 10010, USA  Tjitske K. Starkenburg Department of Physics & Astronomy
and CIERA, Northwestern University, 1800 Sherman Ave, Evanston, IL 60201, USA
Erin Kado-Fong Department of Astrophysical Sciences, Princeton University, 4
Ivy Lane, 08544, Princeton, NJ, USA  Anil C. Seth Physics & Astronomy,
University of Utah, Salt Lake City, UT 84112, USA  Eric F. Bell Department of
Astronomy, University of Michigan, 1085 South University Ave., Ann Arbor, MI
48109-1107, USA

(Received XXX; Revised XXX; Accepted XXX)

###### Abstract

Studies of resolved stellar populations in the Milky Way and nearby galaxies
reveal an amazingly detailed and clear picture of galaxy evolution. Within the
Local Group, the ability to probe the stellar populations of small and large
galaxies opens up the possibility of exploring key questions such as the
nature of dark matter, the detailed formation history of different galaxy
components, and the role of accretion in galactic formation. Upcoming wide-
field surveys promise to extend this ability to all galaxies within 10 Mpc,
drastically increasing our capability to decipher galaxy evolution and
enabling statistical studies of galaxies’ stellar populations. To facilitate
the optimum use of these upcoming capabilities we develop a simple formalism
to predict the density of resolved stars for an observation of a stellar
population at fixed surface brightness and population parameters. We provide
an interface to calculate all quantities of interest to this formalism via a
public release of the code: walter. This code enables calculation of (i) the
expected number density of detected stars, (ii) the exposure time needed to
reach certain population features, such as the horizontal branch, and (iii) an
estimate of the crowding limit, among other features. These calculations will
be very useful for planning surveys with NASA’s upcoming Nancy Grace Roman
Space Telescope (Roman, formerly WFIRST), which we use for example
calculations throughout this work.

Stellar Populations, Roman Space Telescope

††journal: AJ††software:  scipy (Virtanen et al., 2020), numpy (Harris et al.,
2020), IPython (Perez & Granger, 2007), matplotlib (Hunter, 2007), Cython
(Behnel et al., 2011), ††thanks: Hubble Fellow

##  1 Introduction

The Nancy Grace Roman Space Telescope (Roman) has the potential to
revolutionize the study of stellar populations in nearby galaxies. Roman is a
NASA mission currently under construction and scheduled for launch in 2025. It
is a 2.4m telescope designed to cover a $\sim$0.5 degree field of view (FoV)
with $\sim$0.1$"$ angular resolution with high sensitivity in 7 broad bands:
$F062$, $F087$, $F106$, $F129$, $F158$, and $F184$ (Akeson et al., 2019), plus
a recently added $K_{s}$ analog, $F213$111The naming convention $F{\rm XXX}$
indicates the central wavelength of the filter, i.e. $F062$ and $F158$
correspond to central wavelengths of roughly $0.62\,\mu m$ and $1.58\,\mu m$
respectively.. The large field of view and high resolution make Roman ideal
for studies of resolved stellar populations in the local universe, which we
further motivate in Section 1.1 and Section 1.2 before describing the purposes
of this work in Section 1.3.

###  1.1 Recent Resolved Stellar Populations Studies

Resolved stellar photometry provides a highly sensitive probe for several
fundamental astrophysical processes (e.g., Dalcanton et al., 2012). This
includes the study of field dwarf galaxies, dwarf satellite galaxies, galaxy
stellar halos, and disk formation. In particular, these examples can shed
light on the formation of galaxies and the distribution of dark matter. The
ages of the stellar populations of field dwarfs probe the earliest epochs of
galaxy formation (e.g., Weisz et al., 2015; Fillingham et al., 2018; Sacchi et
al., 2021) as well as the epoch of reionization (e.g., Simon et al., 2021).

The dwarf satellite mass function’s sensitivity to the epoch of reionization
makes these low-mass galaxies significant for cosmological constraints (e.g.,
Bullock et al., 2000; Graus et al., 2016). The constraining power of galaxy
stellar halos has been demonstrated by Bullock & Johnston (2005), who
performed a suite of simulations showing the wide array of structures expected
for a variety of galaxy formation histories. Low surface brightness stellar
halos provide the strongest known constraints on the accretion histories of
galaxies (Bullock & Johnston, 2005; Cooper et al., 2010; Pillepich et al.,
2014; D’Souza & Bell, 2018) and are unique probes of the structure and
substructure of the dark matter halos that surround them (Johnston et al.,
1999; Carlberg, 2009).

Observational work has already begun to address some of the cosmic mysteries
outlined above. In the Local Group, large new imaging surveys have uncovered
dozens of new satellite galaxies and streams around the MW and M31 (e.g.,
Martin et al., 2013; The DES Collaboration et al., 2015; McConnachie et al.,
2018; Malhan et al., 2018, and references therein). This work revealed
abundant substructure in halos and discovered dozens of very low mass dwarf
galaxies, providing dramatic confirmation of the widely accepted hierarchical
galaxy formation paradigm (at least in part; Bell et al., 2008). This sparked
a vigorous theoretical exploration of how the galaxies’ assemblies and mass
distributions can be accurately measured from the remnants of disrupted
satellites (Price-Whelan et al., 2014; Sanderson et al., 2015; Belokurov et
al., 2018; Helmi et al., 2018; Lancaster et al., 2019; Reino et al., 2020).
The Panchromatic Hubble Andromeda Treasury (PHAT; Dalcanton et al., 2012)
survey observations have revealed detailed insight about the formation and
evolution of stars and disk galaxies (e.g, Rosenfield et al., 2012; Williams
et al., 2012; Lewis et al., 2015; Weisz et al., 2015; Johnson et al., 2016;
Williams et al., 2017) by resolving more than 100 million stars in the disk of
M31 (Williams et al., 2014). Outside the Local Group, integrated light and
star-counting observations have allowed course mapping of stellar halos as
well as the discovery of significant substructures and satellites (e.g.,
Martínez-Delgado et al., 2010; van Dokkum et al., 2014; Sand et al., 2014;
Crnojević et al., 2016; Carlin et al., 2016a; Mao et al., 2021). However, due
to their faintness and the limited FoV of previous instruments, the resolved
populations of stellar halos and low-mass dwarf galaxies have so far only been
mapped in detail in a small handful of galaxies (e.g., Newberg et al., 2002;
Majewski et al., 2003; Calchi Novati et al., 2005; Ibata et al., 2007;
McConnachie et al., 2009; Crnojević et al., 2016; Bennet et al., 2019;
Smercina et al., 2020).

###  1.2 Potential Future Impact

These insights have tremendous potential, but with relevant observations
available for only a handful of galaxies in a narrow range of environments,
definitive empirical conclusions on galaxy assembly writ large and the
distribution of dark matter within galaxies remains out of reach. Resolved
stellar photometry from Roman will have the potential to discover faint dwarf
galaxy satellites in stellar halos (see e.g., Crnojević et al., 2019), adding
significantly to the number of galaxies with well-measured satellite mass
functions that can be directly compared to simulated galaxy samples (e.g.,
Garrison-Kimmel et al., 2014; Kelley et al., 2019; Buck et al., 2019; Jiang et
al., 2021; Font et al., 2021). Roman will allow comparisons to be made in new
environments for fainter satellite systems beyond the Local Group. Moreover,
the dark matter halos of dwarf galaxies are predicted to be populated by a
large number of dark matter clumps (Gao et al., 2004). Some of these dwarfs
may host their own faint satellite galaxies (e.g., Carlin et al., 2016b, 2020)
and streams (see e.g., Martínez-Delgado et al. 2012, Starkenburg et al., in
prep.), making the surroundings of any galaxy (regardless of its mass) a
prosperous ground for the discovery of new faint structures (Sales et al.,
2013; Wheeler et al., 2015; Pardy et al., 2020). The statistics of such
satellite counts, from dwarf to massive galaxies, can be increased by orders
of magnitude with Roman.

Beyond intact satellite galaxies, the physical debris from dwarf galaxies
merging with larger halos looks dramatically different if the dwarfs were
accreted early/late, on orbits of low/high eccentricity, and if they were of
high or low luminosity (e.g., Hendel & Johnston, 2015). The observed
properties of substructure can be associated with fundamental physical
quantities: the frequency of tidal debris reflects the recent accretion rate;
the physical scales and surface brightnesses reflect the mass and luminosity
functions of infalling objects; and the morphology reflects the orbits. Thus,
substructure in halos offers a direct constraint on the history and nature of
baryonic and dark matter assembly (Johnston et al., 2008).

In addition to formation processes, tidal debris probes the dark matter
properties and distribution around the Milky Way (e.g., Price-Whelan & Bonaca,
2018a; Koposov et al., 2010; Küpper et al., 2015) and external galaxies (e.g.,
Fardal et al., 2013; Pearson et al., 2022b). Complexity arises beyond the
galaxy accretion history because the morphology and frequency of debris
structures can be affected by the three dimensional shape of dark matter halos
(certain orbit families can cause “fanning” of thin tidal streams, see Pearson
et al., 2015; Fardal et al., 2015; Price-Whelan et al., 2016; Yavetz et al.,
2021). These “complications” leave observable signatures in the morphology of
streams alone and hence offer the additional possibilities of measuring the
orbit distribution within dark matter halos, and possibly the halos’
triaxiality. Additionally, because gaps can form in streams as they interact
with dark matter subhalos (e.g., Ibata et al., 2002; Johnston et al., 2002;
Yoon et al., 2011; Carlberg, 2012), particularly thin streams, emerging from
globular clusters, are sensitive to low mass subhalos and can be used to
indirectly probe the nature of dark matter (e.g., Bovy et al., 2017; Price-
Whelan & Bonaca, 2018b; Bonaca et al., 2019). Pearson et al. (2019, 2022a)
showed that Roman will be able to detect such thin streams in galaxies out to
distances beyond 3.5 Mpc. This provides exciting prospects for future searches
for gaps in streams orbiting galaxies that do not host molecular clouds,
galactic bars or spiral arms which can contaminate the gap signatures from
dark matter subhalos (Amorisco et al., 2016; Erkal et al., 2017; Pearson et
al., 2017; Banik & Bovy, 2019).

###  1.3 This Work

Capitalizing on these capabilities will require the community to carefully
plan observations to efficiently attack the scientific goals of interest. With
the aim of providing better tools for planning observations, we develop a
general formalism for calculating the number of detected stars per unit sky
area in a given observation, and at what point that observation will become
crowding limited. This formalism simplifies the estimation of observational
sensitivity to surface brightness and stellar population parameters. The
formalism itself is also entirely general, and applicable to any observation
aiming to resolve a population of stars, not necessarily using Roman.

For the convenience of the future use of this formalism, herein we describe
and provide access and installation instructions for walter (named in honor of
Walter Baade, the first astronomer to resolve M31 in to stars (Baade, 1944)),
a code to calculate quantities necessary for planning stellar populations
surveys. These quantities include the number of stars an observation will
detect in a pointing, covering objects from nearby dwarf galaxies that fit
entirely within a field to very extended and faint stellar halos of large
galaxies. The user can make calculations for populations of a wide range of
ages and metallicities. The code is available on GitHub, and only depends on
numpy, matplotlib, iPython, and scipy (Harris et al., 2020; Hunter, 2007;
Perez & Granger, 2007; Virtanen et al., 2020). A faster version of the code
used to compute the quantities laid out in this paper also requires Cython,
though this is not necessary for simpler applications (Behnel et al., 2011).

The paper is structured as follows: in Section 2, we describe our mathematical
formalism. In Section 3, we provide example calculations of the quantities
laid out in Section 2. These calculations are also carried out and described
in the accompanying code. In Section 4 we give a comparison of the predictions
of our code against observational data. Finally, in Section 5, we provide
concrete examples of how our code could be used to help plan observational
campaigns and we give a brief conclusion in Section 6.

##  2 Formalism

In this Section we explain our approach to calculating the number of stars
that are expected to be resolved in a given observation. Additionally, we
calculate the point at which an observation would become too crowded to
accurately measure the magnitude of all stars that we would like to resolve.
To simplify the discussion in this section, we restrict ourselves to single
values for the following quantities, which will be the key variables
determining an observation:

  * $\tau$

\- The stellar age of the population.

  * ${\rm[Fe/H]}$

\- The metallicity of the population, defined relative to solar quantities.
That is, ${\rm[Fe/H]}=0$ implies solar iron abundance.

  * $d$

\- The luminosity distance to the population.

  * $t_{\rm exp}$

\- The exposure time of the observation.

  * $B$

\- The bandpass of the observation, which is a property of the instrument.

  * $\Sigma_{B}$

\- The surface brightness of the population in the given bandpass.

  * $B_{5\sigma}$

\- The 5$\sigma$ limiting apparent magnitude in band $B$ for (isolated) point
source detection at an exposure time of 1 hour. This is a property of the
telescope/instrument being used.

This approach allows us to keep the discussion general and therefore apply the
same formalism to any number of different types of resolved stellar population
observations, from Milky Way globular clusters to stellar halos of distant
galaxies. With this general structure in mind, we proceed by first calculating
the expected density of resolved stars per unit sky area for a given
observation in Section 2.1. We then calculate the regime in which an
observation will become crowding limited in Section 2.2. Finally, we discuss
some of the caveats of this work in Section 2.3.

###  2.1 Density of Detected Stars

We calculate the number of resolved/detected stars per unit sky area, $n_{\rm
det}$, in a given observation defined by the variables specified above:
$\tau$, ${\rm[Fe/H]}$, $d$, $t_{\rm exp}$, $B$, $\Sigma_{B}$, and
$B_{5\sigma}$ (a parameter of the instrument). We do this by separately
calculating (i) the total number-density of stars per unit sky area (detected
and undetected), $n_{\rm tot}$, and (ii) the number fraction of stars that are
detected, $f_{\rm det}$. We can then calculate $n_{\rm det}$ as $n_{\rm
det}=n_{\rm tot}f_{\rm det}$.

These quantities are intrinsically stochastic, via the stochastic process of
star formation. We parameterize this stochasticity by the initial mass
function (IMF) of the population, which we denote by $\xi(m)$. We assume that
the IMF is fully sampled and use $\xi(m)$ to calculate expectation values for
the quantities of interest. We assume that $\xi(m)$ is normalized so that it
integrates to one, this assumption is important for the correctness of our
formulae below. The IMF can be thought of as an independent characteristic of
the population. In our applications below we make the assumption of a Kroupa
IMF (Kroupa, 2001), but for now we keep the discussion general. We note that
throughout this formalism we refer to the mass $m$ of a star, by which we
always mean its initial mass, as it is on the Zero-Age Main Sequence (ZAMS).

We first aim to calculate the total number density of stars (detected and
undetected) in a given observation, $n_{\rm tot}$, which depends on all
quantities except for the exposure time. First, we translate the IMF in to a
luminosity function for the population, $\Phi(L)$, using an isochrone, for a
given age and metallicity, taken from a stellar evolution code. We denote the
mapping of an initial mass to its luminosity in a given band, $B$, for a given
age and metallicity, $\tau$ and ${\rm[Fe/H]}$, as $L_{B,\tau,{\rm[Fe/H]}}(m)$.
For brevity of notation we simply write this function as $L_{B}$, where the
dependence of the population parameters is implicit.

The fact that this mapping ($m\to L_{B}$) is not unique (stars at different
masses can have the same luminosity) and therefore non-invertible is where
most of the difficulty of calculating $n_{\rm det}$ comes from. This
complexity means that we cannot write down a simple expression for the
luminosity function, even if our expression for the IMF is quite
simple222Under certain assumptions, simple expressions can be written down for
$\Phi(L)$ that are reasonably accurate (Olsen et al., 2003)..

To calculate $n_{\rm tot}$ we only need $\Sigma_{B}$, $d$, and the average
luminosity of the population in band $B$, $\left\langle L_{B}\right\rangle$,
which can be written as:

$\left\langle L_{B}\right\rangle=\int L_{B}(m)\xi(m)\mathrm{d}m\,.$ (1)

Again, the dependence of this quantity on population parameters is implicit.
This quantity is the expectation value of the $L_{B}$ map on the space of
initial masses. If we first define the distance modulus of the population
$\mu\equiv 25+5\log_{10}\left(d/1\,{\rm Mpc}\right)$ then we can write $n_{\rm
tot}$ as:

$n_{\rm tot}=\frac{10^{\frac{\Sigma_{B}-\mu}{-2.5}}}{\left\langle
L_{B}\right\rangle}\,.$ (2)

Next we wish to calculate the number fraction of the population that we
actually observe, $f_{\rm det}$. The distance to the population and the
exposure time of the observation only contribute to the calculation of $f_{\rm
det}$ by determining the absolute magnitude at which we can no longer resolve
stars, which we write as $B_{\rm cut}$ (for an observation in band $B$),

$B_{\rm cut}=B_{5\sigma}-\mu+1.25\log_{10}\left(\frac{t_{\rm exp}}{3600\,{\rm
sec}}\right)$ (3)

where $\mu$ is again the distance modulus and $B_{5\sigma}$ is the apparent
magnitude limit for a 1 hour exposure, as defined above. Reference values for
$B_{5\sigma}$ in each Roman band were obtained from the Roman Wide Field
Instrument technical specifications
webpage333https://roman.gsfc.nasa.gov/science/WFI_technical.html and are
listed in Table 1.

We then define the set of all luminosities brighter than $B_{\rm cut}$ as
$\mathcal{L}_{B_{\rm cut}}$. With these definitions in mind $f_{\rm det}$ can
be calculated as:

$f_{\rm det}=\int_{L_{B}^{-1}(\mathcal{L}_{B_{\rm cut}})}\xi(m)\mathrm{d}m$
(4)

where $L_{B}^{-1}(\mathcal{L}_{B_{\rm cut}})$ is the set of all initial
stellar masses $m$ that are brighter than $B_{\rm cut}$ at age $\tau$ and
metallicity ${\rm[Fe/H]}$444I.e. the pre-image of the map $L_{B}$ on the set
$\mathcal{L}_{B_{\rm cut}}$.. To be explicit with the dependencies of the
$f_{\rm det}$ calculation, we write $f_{\rm det}(B,\tau,{\rm[Fe/H]},B_{\rm
cut})$, and $B_{\rm cut}(d,t_{\rm exp})$. This is the way that we calculate
$f_{\rm det}$ as well (in terms of the limiting absolute magnitude) which we
then translate in to dependencies on $d$ and $t_{\rm exp}$ using Equation 3
for our calculations.

Putting Equation 2 and Equation 4 together, we then have the formula for the
number of detected stars per unit sky area, $n_{\rm det}$, as:

$n_{\rm det}=\frac{10^{\frac{\Sigma_{B}-\mu}{-2.5}}}{\left\langle
L_{B}\right\rangle}f_{\rm det}(d,\tau,{\rm[Fe/H]},t_{\rm exp})\,,$ (5)

where all of the complexity of stellar populations is now folded in to the
quantities $\left\langle L_{B}\right\rangle$ and $f_{\rm det}$.

Below, we review how $f_{\rm det}$ and $\left\langle L_{B}\right\rangle$
depend on their various parameters for the Roman bands. However, first, we
will include the effects of crowding in this formalism.

Figure 1: The conversion factors between surface brightness in the $F158$ band
and several other bands, indicated by color, as a function of metallicity of
the population being observed. We show the conversion factors at an age of
$\tau=2.8$ and $11.2\,{\rm Gyr}$ as dashed and solid lines respectively. These
conversion factors can be strong functions of metallicity but are relatively
independent of age, especially for the redder bands. Figure 2: The evolution
of the fraction of the stellar population that is detected in the $F158$ band
as a function of distance for a $t_{\rm exp}=10^{3}\,$seconds (solid lines)
and $t_{\rm exp}=10^{4}\,$seconds (dashed lines) exposures with Roman and how
this varies with the stellar population parameters ($\tau$ in top panels and
${\rm[Fe/H]}$ in bottom panels). For each panel we also indicate the Main
Sequence Turn Off (MSTO), Horizontal Branch (HB), and Tip of the Red Giant
Branch (TRGB) according to the point at which they fall below the 5$\sigma$
point source detection apparent magnitude. These each correspond to noticeable
drops in $f_{\rm det}$. Some main take-aways that are apparent in this figure:
(i) as a population ages, it dims and, even at fixed surface brightness, we
detect a smaller fraction of the populations, (ii) the TRGB can be seen out to
$35\,{\rm Mpc}$ for $10^{4}\,$s exposures and populations of interest to halo
studies, and (iii) metallicity mainly has an effect on the observability of
the RGB, not other parts of the population.

Figure 3: The evolution of the total number density of stars, both detected
and undetected, with distance. The panels correspond to two different Roman
bands which are indicated in the bottom right corner of each panel. We pick
three assumed surface brightnesses, spanning from values typical of the outer
disks of galaxies, where crowding can begin to dominate ($24\,{\rm
mag/arcsec}^{2}$) to the predicted values for faint streams in galaxy halos
($32\,{\rm mag/arcsec}^{2}$, see Figure 6). The number density is most
strongly dependent on the surface brightness of the population, which is
indicated by numbers at the right hand side of each panel in units of AB
magnitudes per square arcsecond. The number density is also dependent on the
metallicity of the population being considered (which is indicated by the
curve colors) and the age of the population, the solid lines indicate an 11
Gyr old population while the dot-dashed lines indicate a 4 Gyr old population.
We emphasize the bluest ($R062$) and reddest ($F184$) bands to show the
extreme ends of this evolution. Generally, $n_{\rm tot}\propto d^{2}$ and
increases with age as a population dims (since $n_{\rm tot}\propto\left\langle
L_{B}\right\rangle^{-1}$).

Figure 4: The evolution of the number density of detected stars with distance
for a $10^{3}\,{\rm s}$ (solid lines) and $10^{4}\,{\rm s}$ (dashed lines)
exposures using the Padova isochrones. We stop plotting the curves once
$f_{\rm det}<10^{-6}$. As in Figure 3, the panels correspond to different
Roman bands which are indicated in the top right corner of each panel. The
number density is most strongly dependent on the surface brightness of the
population, which is indicated by numbers at the left hand side of each panel
in units of AB magnitudes per square arcsecond. The density is also dependent
on the metallicity of the population being considered (which is indicated by
the curve colors), and slightly with the age of the population, though we only
show a $\tau=11\,{\rm Gyr}$ old population here. There are two interesting
summary points: (i) The number of detected stars per unit sky area is roughly
constant once the Horizontal Branch is no longer detectable as $n_{\rm
tot}\propto d^{2}$ and $f_{\rm det}\propto d^{-2}$ (ii) the redder bands, such
as $F184$ here, are extremely helpful in detecting parts of the RGB out to
very great distances. Figure 5: The evolution of the number density of
detected stars with exposure time, $t_{\rm exp}$, for a theoretical
observation of a population with a surface brightness $\Sigma=32\,{\rm
mag}\,{\rm arcesec}^{-2}$, an age of $\tau=11.2\,{\rm Gyr}$, and a metallicity
of ${\rm[Fe/H]}=-2$, at a distance of $d=10\,{\rm Mpc}$. Note, realistically,
the same population would not have the same surface brightness in each band.
We plot each curve up until the crowding limit is reached for the individual
bands, indicated by the circular points. We can see that, for such a low
surface brightness, this crowding limit is only reached after a very long
integration in most bands. Figures such as this can be very helpful when
deciding how to effectively use exposure time. For example, we can see a
drastic increase in $n_{\rm det}$ for the $F062$ band between 200 and 1000
seconds, with not nearly as much return on invested exposure time afterwards.

###  2.2 Crowding Limits

Another important aspect to consider for resolved stellar populations is the
crowding limit. This is the surface brightness at which the density of stars
on the sky is high enough that it affects the ability to precisely measure the
photometry of individual stars. To quantify the effects of the various
parameters introduced in the previous section we follow the formalism of Olsen
et al. (2003). For a given photometric band $B$, this work calculates the
surface brightness at which stars of magnitude $M_{\rm lim}$ can no longer be
measured with photometric precision $\sigma_{m}$ (measured in magnitudes) as:

$\Sigma_{m}=2M_{\rm lim}+\mu-2.5\log_{10}\left[\frac{1}{A_{\rm
res}}\left(\frac{\sigma_{m}}{1.086}\right)^{2}\frac{\left\langle
L_{B}\right\rangle}{\left\langle L_{B}^{2}\right\rangle_{L<L_{\rm
lim}}}\right]$ (6)

where $\Sigma_{m}$ is the apparent surface brightness of the population in
magnitudes per square arcesecond, $L_{\rm lim}$ is the luminosity
corresponding to $M_{\rm lim}$, $\mu$ is the distance modulus, $A_{\rm res}$
is the angular scale of the resolution element or PSF in square arceseconds,
and $\left\langle L_{B}^{2}\right\rangle_{L<L_{\rm lim}}$ is the expectation
value of the square of the luminosity over stars less luminous than $L_{\rm
lim}$ defined as:

$\left\langle L_{B}^{2}\right\rangle_{L<L_{\rm
lim}}\equiv\int_{L_{B}^{-1}(\mathfrak{L}_{L_{\rm
lim}})}L_{B}^{2}(m)\xi(m)\mathrm{d}m\,,$ (7)

where $\mathfrak{L}_{L_{\rm lim}}$ denotes the set of luminosities dimmer than
$L_{\rm lim}$ and $L_{B}^{-1}(\mathfrak{L}_{L_{\rm lim}})$ denotes the set of
all initial stellar masses $m$ that are dimmer than $M_{\rm lim}$ at age
$\tau$ and metallicity ${\rm[Fe/H]}$555I.e. the pre-image of the map
$L_{B}(m)$ on $\mathfrak{L}_{L_{\rm lim}}$.. Note that we have changed the
formalism of Olsen et al. (2003) to work in terms of the IMF, $\xi(m)$ instead
of the luminosity function $\Phi(L)$.

Since we hope to resolve stars up to some limiting magnitude, which we
described in the last section as $B_{\rm cut}$, for the photometric band $B$,
it is natural to set $M_{\rm lim}=B_{\rm cut}$ to calculate the crowding
limited surface brightness of most interest.

We note that this gives a single surface brightness value at which an
observation becomes crowding limited. In reality, a single observation has
varying surface brightness over the field of view. This means that some parts
of an observation may be crowding limited while others might not.

###  2.3 Caveats of our Formalism

While the formalism laid out above allows the treatment to remain general, it
also means that the formalism does not apply to any real observation. For
example, we assume that the stellar population being observed has a single age
and metallicity. In principle, this can be extended by taking a linear
combination of the results from single populations in terms of some
metallicity/age distribution. However, given our formalism as stated above,
this would require knowing the surface brightness of each single-age, single-
metallicity component of the distribution. The simpler quantity to work with
here would be stellar mass surface density $\Sigma_{*}$, which could then be
straightforwardly and self-consistently translated in to a surface brightness
of each component of that age and metallicity. We leave the implementation of
this functionality to later updates of the code.

Another side-effect of taking $\Sigma_{B}$ as our fundamental parameter is
that, when performing calculations for multiple bands, it is left up to the
user to make sure that the surface brightness in the bands are consistent with
one another. As a guide for the case of the Roman bands, we provide the
necessary conversions between the surface brightness in the $F158$ band and
any other band as a function of metallicity in Figure 1 for two different
ages. We also give numeric values in Table 1 for a population of age
$\tau=11.2\,{\rm Gyr}$ and metallicity $[{\rm Fe/H}]=-2$. Though, as we show
in Figure 1, these conversion factors can be strongly dependent on the
metallicity of the population being observed. However, they are less sensitive
to the age (at least for not-newly-born populations), especially in the redder
bands. The conversion factor between two arbitrary bands $B$ and $C$ is
straightforward to calculate from our code as

$M_{B}-M_{C}=-2.5\log_{10}\left(\frac{\left\langle
L_{B}\right\rangle}{\left\langle L_{C}\right\rangle}\right)$ (8)

where $\left\langle L_{B}\right\rangle$ is given by Equation 1 for an assumed
population age and metallicity. This should be useful for the further
application of this code to convert between surface brightnesses observed from
ground based observatories to other bands in which one is hoping to resolve
the stellar population.

Additionally, our approach is analytic, assuming that the underlying stellar
population being observed exactly follows a continuous distribution in mass,
$\xi(m)$. This should produce accurate results when the full population being
observed fully samples the relevant mass range of the IMF. However, what this
mass range is depends on the stellar population properties themselves666For
example, at old stellar population ages, only initial stellar masses $\lesssim
2\,M_{\odot}$ contribute to the luminosity of the population. Generally this
will be true if the inferred total number of stars in the population $N_{\rm
tot}=n_{\rm tot}\Delta\Omega$ (where $\Delta\Omega$ is the area over which the
observation is carried out) is large ($\gtrsim 10^{4}$). $N_{\rm tot}$ can be
directly calculated from our code and used as a guide on this front.

There is an additional source of stochasticity when it comes to only detecting
the very brightest members of a stellar population. For most reasonable
$\xi(m)$, there are only a few stars at the very brightest magnitudes at any
age, representing a very small range in mass and thus a very small fraction of
the population. This means that while $N_{\rm tot}$ may be large $f_{\rm det}$
is very small when only considering the very brightest stars (see Figure 2) so
that the total number of detected stars $N_{\rm det}=N_{\rm tot}f_{\rm det}$
is still small. This is especially worrisome since different stellar evolution
codes will give slightly different predictions for $f_{\rm det}$ at these very
low values, meaning that $N_{\rm det}$ can easily go from $10$ to $2$ when
using different codes. In general, if the predicted $N_{\rm det}$ of walter is
$\lesssim 100$, we advise caution on the strict interpretation of the results.

Taking in to account the assumption of a constant surface brightness is more
subtle. In principle, one should be able to break any real observation in to
chunks of approximately constant surface brightness, and apply these results
individually to each chunk. However, this can be difficult when the surface
brightness varies greatly (as in the presence of star clusters) or when the
scale on which the surface brightness is constant becomes comparable to the
scale on which the IMF is poorly sampled (where our population-averaged
formalism would not robustly apply). We do not address this issue here, though
it should only be a problem for particularly close-by populations, where the
total stellar mass is $\lesssim 10^{3}\,M_{\odot}$ over several pixels.

Our formalism does not take in to account crowding by Milky Way foreground
stars and background galaxies. As discussed in Appendix A of Jang et al.
(2020) this can result in a number density of spurious sources of $\sim
3\times 10^{-4}\,{\rm arcsec}^{-2}$ for color-magnitude cuts typical of metal-
poor RGB stars; somewhat higher background densities, up to $\times
10^{-3}\,{\rm arcsec}^{-2}$, are possible if somewhat wider color and
magnitude ranges are considered. The observations of Jang et al. (2020) had
$t_{\rm exp}=10^{3}-10^{4}\,{\rm secs}$ and were made with the Hubble Space
Telescope (HST). As we will show below, this can dominate over the expected
number density of detected stars for surface brightness values of interest.
This will also effect the crowding and photometric reduction. Therefore, the
effect of background sources is an important factor that needs to be taken in
to account when applying this formalism to real observations. We leave this
for future work.

There are other effects that we do not account for here. For example, the
effects of interstellar extinction, which should be small for the infrared
wavelengths probed by Roman, could be important for the application of our
formalism to other observations. Our formalism also does not address the
presence of binary star systems in a population, or binary evolution. This
should affect the predictions of this formalism, though likely only by a small
factor. Finally, we treat the completeness in detection as going from 100% at
magnitudes brighter than $B_{\rm cut}$ to 0% at magnitudes fainter than
$B_{\rm cut}$. In reality this will be a smooth transition and could be an
important effect in amplifying the number of stars we expect to detect. We
leave addressing these issues to future work. Finally, we assume that the
distance, $d$, to the stellar population being observed is constant over the
observation. While this is usually a safe assumption for extra-galactic
observations, it may not be when considering populations in the nearby
universe. In principle, this could be addressed in the same way as age and
metallicity, using some distribution in distance.

##  3 Example Calculations: Resolving Populations with Roman

For the convenience of the future use of this formalism, walter is accompanied
by example notebooks to walk through the use of the code and how to plot
certain quantities. In this section, we explain some of the examples given in
the code. These calculations are intended to give the reader an intuitive
understanding of the basic dependencies and the order of magnitude values,
they are not meant to be exhaustive. For all presented examples, we work under
the assumption that our observing instrument is the upcoming Roman Space
Telescope. In the code, we point out where changes would need to be made if
the code were to be applied more broadly.

To apply the formalism developed in Section 2 we must choose a mapping from
initial stellar mass to luminosity in a given band and for given population
parameters, or $L_{B}(m)$, which can be provided by any stellar evolution
code. We use two different stellar evolution codes both to give an idea of the
uncertainties associated with differences in stellar evolution calculations
and because each code has its own benefits and drawbacks. The first code we
use is the Modules for Experiments in Stellar Astrophysics (MESA) Isochrones
and Stellar Tracks (MIST) code (Dotter, 2016; Choi et al., 2016) and the
second is the PARSEC set of isochrones (Bressan et al., 2012; Marigo et al.,
2017).

Specifically, we download isochrones for stellar populations from metallicity
of $0.5$ to $-3.25$ in increments of $0.25\,$dex and ages from
$\log_{10}\left(\tau/{\rm yrs}\right)=8.95$ to $10.1$ in increments of
$0.05\,$dex777We use old stellar ages as we were originally most interested in
the stellar halos of galaxies. This can be straightforwardly extended to young
stellar populations by downloading isochrones for this parameter regime and
using the provided code to calculate the quantities of interest.. Each
isochrone spans a range of initial masses from roughly $0.1M_{\odot}$ to
$300M_{\odot}$ and provides a numerical mapping between these initial masses
in each photometric band of interest. The photometric bands of interest to us
here are the proposed bands for Roman, namely $F062$, $F087$, $F106$, $F129$,
$F146$, $F158$, and $F184$. The Padova isochrones also provide predictions for
the most recently added filter to the Roman mission, $F213$. Some general
information on these bands can be found in Table 1. One thing to keep in mind
is that all of our formalism is in terms of AB magnitudes whereas the
isochrones compute all quantities in Vega magnitudes. For this reason we
provide the conversion between the two for each band in Table 1.

Table 1: Roman Band Specifications

Band | $B_{5\sigma}$ | $m_{\rm AB}-m_{\rm Vega}$ | $\Sigma_{B}-\Sigma_{F158}$ | $\Delta\lambda\,[\mu{\rm m}]$
---|---|---|---|---
$F062$ | 28.5 | 0.147 | 0.43 | 0.280
$F087$ | 28.2 | 0.485 | 0.13 | 0.217
$F106$ | 28.1 | 0.647 | 0.05 | 0.265
$F129$ | 28.0 | 0.950 | 0.02 | 0.323
$F146$ | 28.4 | 1.012 | 0.05 | 1.464
$F158$ | 28.0 | 1.281 | 0.00 | 0.394
$F184$ | 27.4 | 1.546 | 0.15 | 0.317
$F213$ | 26.2 | 1.819 | 0.40 | 0.350

Note. — Columns are (i) name of the band, (ii) 5$\sigma$ point source
detection limiting magnitude for a 1 hour exposure, (iii) conversions between
Vega and AB magnitudes, (iv) conversion between surface brightness in $F158$
to a given band for $\tau=11.2\,{\rm Gyr}$ and $[{\rm Fe/H}]=-2$, and (v) the
width of each filter in $\mu$m.

To perform all integrals related to Equations 1, 4, and 7, we use the mass
samples of the isochrones to integrate over, linearly interpolating between
these samples where appropriate cuts must be made. As mentioned earlier, we
use a Kroupa IMF with masses limited to being between $0.08M_{\odot}$ and
$120M_{\odot}$ with $\xi\propto m^{-1.3}$ for $0.08M_{\odot}\leq m\leq
0.5M_{\odot}$ and $\xi\propto m^{-2.3}$ for $0.5M_{\odot}\leq m\leq
120M_{\odot}$. The code to do all of these integrals is provided with the
GitHub repository. We also provide an implementation of these integrals in
Cython, which considerably speeds up their calculation.

###  3.1 Calculating $f_{\rm det}$

We begin by illustrating the fraction of all stars in a specified stellar
population detectable with a given observation, $f_{\rm det}$, and its
dependence on the parameters of the observation. As stellar populations
generally dim as they age, we expect $f_{\rm det}$ to decrease with age, and
the dependence on $t_{\rm exp}$ and $d$ are given through the limiting
magnitude as stated in Equation 3, however the dependence on metallicity is
less clear. To make $f_{\rm det}$ more transparent we illustrate its evolution
in distance and for several different values of metallicity and age of the
observed stellar population in Figure 2 for exposure times of $t_{\rm
exp}=10^{3}\,$ and $10^{4}~{}{\rm seconds}$ using the MIST isochrones. We
additionally indicate several evolutionary stages in Figure 2 by associating
each stage with the distance at which they are just barely detectable. We do
this by associating an absolute magnitude to each stage by evaluating the
brightest magnitude within ranges of Equivalent Evolutionary Phase (EEP)
provided by the MIST code (Dotter, 2016; Choi et al., 2016). The ranges in EEP
considered for each phase are EEP $\leq 495$ for the Main Sequence Turn Off
(MTSO), $630<$ EEP $<640$ for the Horizontal Branch (HB) of Rec Clump (RC),
and $560<$ EEP $<580$ for the Tip of the Red Giant Branch (TRGB). These EEP
ranges are not the default delineations between each phase of evolution given
by the MIST team, but we found these choices to more closely match the
corresponding drops in $f_{\rm det}$ in Figure 2.

In Figure 2, we additionally see the expected trend with population age
(decreasing $f_{\rm det}$ with age) and that the metallicity most noticeably
affects the tail-end of the $f_{\rm det}$ evolution in distance, indicative of
its effect on the luminosity of the RGB. Figure 2 shows that a $10^{3}\,{\rm
seconds}$ exposure with Roman will be able to resolve (detect at $5\sigma$
significance as an isolated source) horizontal branch stars out to a distance
of 5 Mpc in the F158 band, and TRGB stars out to about 20 Mpc. Figure 2 also
nicely illustrates why $10\,{\rm Mpc}$ is usually thought of as a reference
distance for resolved star studies with Roman, as it is past this rough
distance that one can no longer easily observe most of the RGB over a large
fraction of the parameter space (Spergel et al., 2015). It is important to
note that $10\,{\rm Mpc}$ is not an absolute limit, Roman will be able to see
resolved populations much further with longer exposures (subject to crowding
limits, discussed further below). Though $10\,{\rm Mpc}$ can be thought of as
a reference distance, especially for studies aiming to observe population
features like the Horizontal Branch.

###  3.2 Calculating $n_{\rm tot}$

Now that we have provided a detailed look at the evolution of $f_{\rm det}$
with various parameters of the population, we would like to provide some
references for the parts of the observation that are independent of the
particulars of what is detected. More precisely, for a given surface
brightness (which is band dependent) and population, we ask what is the total
density of stars that would be expected, both detected and undetected. The
real quantity of interest will be a combination of this quantity with $f_{\rm
det}$, but it is useful to have numbers in mind for the total density of
stars. This is given by Equation 2 and its distance evolution is only
dependent on the smooth, analytic evolution of the distance modulus so that
($n_{\rm tot}\propto d^{2}$ at constant $\Sigma_{B}$). The exact
normalization, however, will depend on the band and population parameters.

To give reference values for these normalizations, we present Figure 3 where
we show $n_{\rm tot}$ for several different values of metallicity (indicated
by color), bands ($F062$ and $F184$ as indicated in the bottom right corner of
each panel), surface brightness in those bands (indicated by the text adjacent
to the curves in each panel), and population ages (indicated by line style)
for the Padova isochrones. We see that, as one would expect, the surface
brightness of the observed population most strongly determines $n_{\rm tot}$.
We can also see the relative differences between the bluest ($F062$) and
second reddest ($F184$) Roman bands, because the populations under
consideration are generally dimmer in the bluer bands than the red bands (the
average brightness is dominated by the reddest stars) it takes more stars per
unit area in the $F062$ band to reach the same surface brightness. This trend
is also reflected in the ages, where the younger populations (dot-dashed
lines) have fewer stars at fixed surface brightness, since their stars are (on
average) brighter.

###  3.3 Calculating $n_{\rm det}$

Finally, the quantity of greatest interest to the observer is the density of
stars that are detected, described in full by Equation 5. This quantity is
essentially the ‘product’ of the quantities laid out in Figures 2, and 3. In
Figure 4 we present $n_{\rm det}$ in a similar format to that shown in Figure
3, where the calculations here have been performed using the Padova
Isochrones.

We see that the $n_{\rm tot}\propto d^{2}$ growth nearly compensates for the
drop in $f_{\rm det}$ over a large range in distance for a given surface
brightness, leading to $n_{\rm det}$ being a roughly constant function of
distance over quite a large range. We also see the large differences between
the $F062$ band and the $F184$ band, where the bluer band ($F062$) detects a
much larger number of stars at a fixed surface brightness, and its detection
at large distances is much reduced compared to the redder band ($F184$).

Additionally, we see that, in the redder bands, lower metallicity populations
generally have larger $n_{\rm tot}$ at fixed surface brightness (as shown in
Figure 3). They generally have a much larger proportion of these stars below
the detection threshold at most exposure times/distances, leading to the lower
metallicity populations having slightly larger $n_{\rm det}$ at nearby
distances, but falling off much earlier than the high metallicity populations.
However, this trend is reversed in the bluer band $F062$.

We have thus far shown everything as a function of distance, but the observer
will be mainly concerned with picking the correct exposure time for a given
observation. In Figure 5, we give an example of this sort of calculation. We
provide a sample of what $n_{\rm det}$ would look like for a proposed
observation of a $\Sigma=32\,{\rm mag}\,{\rm arcsec}^{-2}$ (in each band),
$\tau=11.2\,{\rm Gyr}$, and ${\rm[Fe/H]}=-2$ population at a distance of
$d=10\,{\rm Mpc}$. In Figure 5, we indicate the point in exposure time at
which the observation becomes crowding limited by the points at the end of
each curve. These sorts of plots will be extremely useful in making decisions
about how to invest exposure time. For example, we see that the most
significant return for the observation proposed in Figure 5 is after $t_{\rm
exp}=500\,{\rm seconds}$ in virtually all bands, after which the slope of each
curve becomes significantly less positive. It is also striking that we have
any stars at all detected for a 10 seconds exposure, even if it is $\sim 1$
for every million square arcseconds. What we are seeing here is the tail of
the asymptotic giant branch (AGB) combined with the fact that these stars are
much brighter in the red Roman bands than one would typically expect in
comparison to, for example, the optical bands of HST.

##  4 Test Against Observations

In this section we provide a test of our formalism against observations of
resolved stellar populations in external galaxies from the ACS Nearby Galaxy
Survey Treasury (ANGST) (Dalcanton et al., 2009; Weisz et al., 2011). To
provide the simplest check of the code in its current state we wish to compare
against an object of nearly constant surface brightness with as close to a
single-metallicity, single-age stellar population as possible. We therefore
choose the galaxy FM1 (a.k.a. F6D1) which has a nearly uniformly old ($\sim
11\,{\rm Gyr}$) and metal-poor (${\rm[Fe/H]}\sim-1.25$) stellar population as
inferred from its resolved CMD (Weisz et al., 2011).

Dalcanton et al. (2009) report 19,390 stars jointly detected in the F606W and
F814W filters of the Hubble Space Telescope’s Advanced Camera for Surveys
(ACS) with a 50% completeness limiting magnitude of 28.92 and 27.85
magnitudes, respectively (in the Vega system). Detection in both bands is
necessary for removal of contamination from background galaxies (e.g. Muzzin
et al., 2013).

In order to make our prediction for the number of stars that should be
detected in these observations we take the global surface brightness and size
of FM1 from the Karachentsev et al. (2013) catalog. Specifically, it is
reported that FM1 has an average surface brightness in the $B$ band888This is
the actual Johnson-Cousins $B$ band, not our generic labeling of an arbitrary
band $B$ used throughout the rest of the paper. of $25.8\,{\rm mag}\,{\rm
arcsec}^{-2}$ and an angular diameter of $0.89^{\prime}$. We also use the
distance to the FM1 reported by Dalcanton et al. (2009) as $d=3.4\,{\rm Mpc}$.
In order to calculate the number of expected stars detected in the F814W band
we calculate the population-averaged magnitude correction between the F435W
(approximately $B$ band) and F814W bands for a stellar population with age
$\log_{10}(\tau/{\rm yr})=10.05$ and metallicity ${\rm[Fe/H]}=-1.25$ which we
find to be $M_{F435W}-M_{F814W}=1.7$ so that our inferred average surface
brightness for FM1 in the $F814W$ band is $24.1\,{\rm mag}\,{\rm
arcsec}^{-2}$.

Using the 50% completeness limiting magnitude of 27.85 in the $F814W$ band as
our $B_{5\sigma}$, and the same age and metallicity population used for the
correction above we find $f_{\rm det}=4.2\times 10^{-4}$. With the apparent
surface brightness of $\Sigma_{F814W}=24.1\,{\rm mag}\,{\rm arcsec}^{-2}$ and
$d=3.4\,{\rm Mpc}$ for the same stellar population we find the total number
density of stars (detected and undetected) to be $n_{\rm tot}=5884\,{\rm
arcsec}^{-2}$. Taking the angular diameter reported by Karachentsev et al.
(2013) this implies a total number of detected stars of $10,795$. If we
restrict detected stars reported in Dalcanton et al. (2009) to this same
assumed footprint we find $N_{\rm det}=5162$. These numbers are not exactly
comparable but in the calculation so far we have ignored the effects of
extinction and we have assumed 100% completeness at the 50% completeness
limiting magnitude, both of which would bias us to infer a larger number of
stars than are actually detected. If we accept a limiting magnitude that is
0.5 magnitudes smaller (reasonable considering the $0.12\,{\rm mag}$ estimated
extinction in the $F814W$ band; Schlafly & Finkbeiner, 2011, and the lack of
full completeness) we find a predicted number of detected stars of $5534$.
Given the assumptions of the calculation provided here and the fact that the
Red Clump lies near the edge of the detection limit for FM1 (Dalcanton et al.,
2009) we believe the agreement of the observed $5162$ stars with the predicted
$5534$ stars is a successful test of this framework.

##  5 Discussion of Applications

Now that we have produced the tools necessary to determine the sensitivity of
observations to a wide range of resolved stellar populations at any distance
and surface brightness, we can apply the tools to optimize observing
efficiency for observations of nearby galaxies with Roman. Below we provide a
few examples of how one might perform such optimizations. In Section 5.1, we
start with optimizing filters for the number of stars detected in a given
amount of observing time. In Section 5.2 we then discuss optimizing
observations that wish to detect a given population feature. Lastly, in
Section 5.3 we discuss the example of large halos where we would only cover a
fraction of the structures in a single pointing.

###  5.1 Filter Choices - One Example

Generally speaking, the choice of filters will depend strongly on the specific
science case under consideration or comparability with past measurements (and
therefore similarity between filters that have been used in the past). With
that in mind, we provide here an example of how one might go about calculating
the best filters to use in the case that one is trying to create a color-
magnitude diagram (CMD) of an observed population, with no particular interest
in any specific part of the CMD. The main considerations in this case would be
(i) maximizing the number of stars (probably applicable to many other science
goals) and (ii) maximizing the difference in color between the filters used.
In this case one will generally have a choice of one redder and one bluer
band.

We can then apply our software to determine the optimal exposure time ratios
between filters for a given population, and which filters will be best to use
within the time constraints. In Figure 5, we can see that the $F062$ and
$F158$ filters reach the highest $n_{\rm det}$ in the range $t_{\rm
exp}=10^{3}-10^{4}\,{\rm seconds}$999We exclude the $F146$ band due to its
wide wavelength range, which prevents it from providing useful color
information., which additionally allows for a large color spread. This large
color spread is especially important for the creation of CMDs from
observations due to the better discerning power on stellar temperatures.
Moreover, we can see that at exposure times of roughly $\sim 10^{3}$ seconds
the science return of number of stars per unit exposure time diminishes,
indicated by the flattening of each curve. Thus in the case of the observation
parameters given in Figure 5, the most efficient observing plan would be one
that exposes $F062$ and $F158$ for $\sim 10^{3}$ seconds.

While the best filters to use should generally be a function of the population
being considered, we would expect the $F062$ and $F158$ filters to generally
be good choices for observations aiming to create a CMD, given considerations
for depth and color differences. The $F087$ filter could also be a good
replacement for the $F062$ filter at shorter exposure times, since it is also
a bluer band and reaches larger $n_{\rm det}$ at slightly shorter $t_{\rm
exp}$.

###  5.2 Detecting a Given Population Feature

Another possibility is that the observing program requires that some feature
of the stellar population, like the horizontal branch/red clump or TRGB, be
detected in at least 4 bands (e.g., to allow for optimal background galaxy
separation). This kind of optimization can be determined by producing plots
similar to those shown in Figure 2, which shows the number fraction of the
population that is detected as a function of distance at fixed exposure time.
In a similar vein, we can also isolate individual population features and
calculate the exposure time needed to detect them for a given distance. We
give an example of this in the time_to_feature jupyter notebook provided in
the code accompanying this paper. As an example, for a population with
${\rm[Fe/H]}=-2$ and $\tau=10\,{\rm Gyr}$ at 10 Mpc, we can reach one
magnitude below the TRGB in 4 bands the fastest if we choose $F106$, $F129$,
$F168$, and $F184$, and exposure times of $1777$, $1001$, $451$, $866$ seconds
respectively. Given the lack of color information provided by the $F146$ band,
we have excluded it from consideration here.

Figure 6: Left: A surface brightness map of the Number 2 Bullock & Johnston
(2005) halo in the $F062$ filter, created as described in the text. The
surface brightness is indicated by the color bar. This mock observation
assumes that the galaxy is at a distance of 4 Mpc, which sets the scale of the
axes in degrees and the size of the RST footprints (shown as light blue and
light green tilings, chosen to lie at disjoint locations at different
representative galactic radii). We additionally show a red bar that is 50 kpc
in length at the upper left, for reference. Right: The number of detected
stars, $N_{\rm det}$ (solid lines), and the fraction of the observation that
is crowded, $f_{\rm crowd}$ (dashed lines), for the two different locations of
observations indicated in the left-hand panel. The dotted green line
represents the number of detected stars in a giant stream that overlaps the
Location 2 field of view.

###  5.3 Application to Galaxy Halos

As a final example, we explore the possibility of mapping a portion of the
halo of a nearby galaxy to search for streams. We start with a model halo from
Bullock & Johnston (2005). These simulations consist of stellar tracer
particles created by tagging dark matter particles in the simulation and
following them as they accrete on to the model halo. We create surface
brightness maps from these simulations by projecting the particles along a
given axis and binning them on a grid in the other two (non-projected)
dimensions. We then calculate the total luminosity in a given band, $B$, from
each of these particles by multiplying their masses by $L_{B}/\overline{m}$,
where $\overline{m}$ is the average stellar mass of the IMF101010This assumes
that each stellar tracer particle is massive enough to fully sample the IMF,
which is not truly the case in general.. We then sum the luminosities in each
grid cell (pixel), convert this to a magnitude and finally to a surface
brightness by adding in the distance modulus and factor accounting for the sky
area of each pixel. Since surface brightness is a constant function of
distance, a distance is not needed to get the surface brightness map. However,
one does need a distance to assign an angular scale to the pixels.

In the left panel of Figure 6 we show one of our surface brightness maps in
the $F062$ band. Several of the streams have surface brightness $\sim
32~{}{\rm mag/arcsec}^{2}$, superimposed on a halo background of surface
brightness $\sim 37~{}{\rm mag/arcsec}^{2}$. This map does not include the
surface brightness of background galaxies. As we noted in Section 2.3, our
formalism generally ignores the crowding effects of foreground MW stars and
background galaxies. The number density of the background galaxies could be as
high or higher than the number density of stars detected from a stellar
stream, as we will see below.

Subsequently, we perform mock observations of this halo (as carried out in the
code provided with this work) by placing a synthetic Roman field of view on
the image and predicting the number of stars that would be observed in each
RST detector for a given exposure time and two different placements of the
detector. These detector placements were chosen to be physically disjoint from
one another, in representative areas of the observed halo at different
galactic radii. The Location 2 placement was also chosen to lie on top of a
giant stream in the simulated halo. For this calculation we have assumed that
the halo is at a distance of 4 Mpc. This calculation assumes a single stellar
population, which is not true of the actual simulated halo, though this could
be easily extended within walter.

Furthermore, these stellar surface densities allow us to measure the expected
amount of crowding, assuming that the crowding limit occurs according to the
formalism laid out in Section 2.2. We show both the number density of expected
stars, and the fraction of the observation that is crowded in the right panel
of Figure 6.

Finally, we can break these numbers down into the number of stars that will be
from a feature of interest vs. from the surrounding ambient halo. When
interpreting these numbers, it is important to keep in mind that we do not
take in to account background sources (as noted in Section 2.3), which would
seriously affect the contrast here. For example, there is a stream with
surface brightness $\sim 34~{}{\rm mag/arcsec}^{2}$ that crosses Location 2,
where the ambient background has a surface brightness of $\sim 35~{}{\rm
mag/arcsec}^{2}$. In a detector that contains the stream, a total of 39,400
stars will be detected in a 1 hour exposure in $F062$. 331 of these stars will
belong to the stream. This may not seem like many stars relative to all of the
stars collected in the observation, but the stream and stellar halo will be
distinct in their spatial and color distribution in ways that are not
illustrated by this simple comparison. We anticipate this code being used in
future work to provide more quantitative constraints on the ability to detect
these tidal features.

##  6 Conclusion

We have developed an open source public software package designed to optimize
observing programs aimed at studying resolved stellar structures and resolved
stellar populations. The software package can quickly calculate the number of
stars one will detect in an observation if given the population age and
metallicity along with the surface brightness, filter and exposure time. While
this number will be useful for many planning purposes, observers must also
keep in mind that in addition to the detected stars, which our software can
predict, there will be background galaxies that will need to be filtered and
taken into account for detection of features. The code is available on GitHub,
has minimal dependencies, and is laid out with specific applications to the
Roman Space Telescope.

We have shown how this software can be used to optimize observing efficiency
for a few example programs that one might consider, including determining the
best filter choices for a particular science case, detecting dwarf galaxies,
and searching for stellar streams to a specific surface brightness limit.
There will likely be many other cases for which this package will be useful,
and we hope that it encourages the community to get involved in planning
potential General Astrophysics Observations with the Nancy Grace Roman Space
Telescope.

LL thanks David Sand, Johnny Greco, Scott Carlsten, and Rachael Beaton for
helpful discussions. The authors thank Leo Girardi for providing access to the
low metallicity and $F213$ predictions for the Padova isochrones. Support for
SP was provided by NASA through the NASA Hubble Fellowship grant #HST-
HF2-51466.001-A awarded by the Space Telescope Science Institute, which is
operated by the Association of Universities for Research in Astronomy,
Incorporated, under NASA contract NAS5-26555. The Flatiron Institute is
supported by the Simons Foundation. Support for BFW, KVJ, and AS was provided
through NASA contract NNG16PJ28C as part of the Roman Science Investigation
Team funded through ROSES call NNH15ZDA001N-WFIRST.

## References

  * Akeson et al. (2019) Akeson, R., Armus, L., Bachelet, E., et al. 2019, arXiv e-prints, arXiv:1902.05569.  https://arxiv.org/abs/1902.05569
  * Amorisco et al. (2016) Amorisco, N. C., Gómez, F. A., Vegetti, S., & White, S. D. M. 2016, MNRAS, 463, L17, doi: 10.1093/mnrasl/slw148
  * Baade (1944) Baade, W. 1944, ApJ, 100, 137, doi: 10.1086/144650
  * Banik & Bovy (2019) Banik, N., & Bovy, J. 2019, MNRAS, 484, 2009, doi: 10.1093/mnras/stz142
  * Behnel et al. (2011) Behnel, S., Bradshaw, R., Citro, C., et al. 2011, Computing in Science and Engineering, 13, 31, doi: 10.1109/MCSE.2010.118
  * Bell et al. (2008) Bell, E. F., Zucker, D. B., Belokurov, V., et al. 2008, ApJ, 680, 295, doi: 10.1086/588032
  * Belokurov et al. (2018) Belokurov, V., Erkal, D., Evans, N. W., Koposov, S. E., & Deason, A. J. 2018, MNRAS, 478, 611, doi: 10.1093/mnras/sty982
  * Bennet et al. (2019) Bennet, P., Sand, D. J., Crnojević, D., et al. 2019, ApJ, 885, 153, doi: 10.3847/1538-4357/ab46ab
  * Bonaca et al. (2019) Bonaca, A., Hogg, D. W., Price-Whelan, A. M., & Conroy, C. 2019, ApJ, 880, 38, doi: 10.3847/1538-4357/ab2873
  * Bovy et al. (2017) Bovy, J., Erkal, D., & Sanders, J. L. 2017, MNRAS, 466, 628, doi: 10.1093/mnras/stw3067
  * Bressan et al. (2012) Bressan, A., Marigo, P., Girardi, L., et al. 2012, MNRAS, 427, 127, doi: 10.1111/j.1365-2966.2012.21948.x
  * Buck et al. (2019) Buck, T., Macciò, A. V., Dutton, A. A., Obreja, A., & Frings, J. 2019, MNRAS, 483, 1314, doi: 10.1093/mnras/sty2913
  * Bullock & Johnston (2005) Bullock, J. S., & Johnston, K. V. 2005, ApJ, 635, 931, doi: 10.1086/497422
  * Bullock et al. (2000) Bullock, J. S., Kravtsov, A. V., & Weinberg, D. H. 2000, ApJ, 539, 517, doi: 10.1086/309279
  * Calchi Novati et al. (2005) Calchi Novati, S., Paulin-Henriksson, S., An, J., et al. 2005, A&A, 443, 911, doi: 10.1051/0004-6361:20053135
  * Carlberg (2009) Carlberg, R. G. 2009, ApJ, 705, L223, doi: 10.1088/0004-637X/705/2/L223
  * Carlberg (2012) —. 2012, ApJ, 748, 20, doi: 10.1088/0004-637X/748/1/20
  * Carlin et al. (2016a) Carlin, J. L., Sand, D. J., Price, P., et al. 2016a, ApJ, 828, L5, doi: 10.3847/2041-8205/828/1/L5
  * Carlin et al. (2016b) —. 2016b, ApJ, 828, L5, doi: 10.3847/2041-8205/828/1/L5
  * Carlin et al. (2020) Carlin, J. L., Mutlu-Pakdil, B., Crnojevic, D., et al. 2020, arXiv e-prints, arXiv:2012.09174.  https://arxiv.org/abs/2012.09174
  * Choi et al. (2016) Choi, J., Dotter, A., Conroy, C., et al. 2016, ApJ, 823, 102, doi: 10.3847/0004-637X/823/2/102
  * Cooper et al. (2010) Cooper, A. P., Cole, S., Frenk, C. S., et al. 2010, MNRAS, 406, 744, doi: 10.1111/j.1365-2966.2010.16740.x
  * Crnojević et al. (2016) Crnojević, D., Sand, D. J., Spekkens, K., et al. 2016, ApJ, 823, 19, doi: 10.3847/0004-637X/823/1/19
  * Crnojević et al. (2019) Crnojević, D., Sand, D. J., Bennet, P., et al. 2019, ApJ, 872, 80, doi: 10.3847/1538-4357/aafbe7
  * Dalcanton et al. (2009) Dalcanton, J. J., Williams, B. F., Seth, A. C., et al. 2009, ApJS, 183, 67, doi: 10.1088/0067-0049/183/1/67
  * Dalcanton et al. (2012) Dalcanton, J. J., Williams, B. F., Lang, D., et al. 2012, ApJS, 200, 18, doi: 10.1088/0067-0049/200/2/18
  * Dotter (2016) Dotter, A. 2016, ApJS, 222, 8, doi: 10.3847/0067-0049/222/1/8
  * D’Souza & Bell (2018) D’Souza, R., & Bell, E. F. 2018, MNRAS, 474, 5300, doi: 10.1093/mnras/stx3081
  * Erkal et al. (2017) Erkal, D., Koposov, S. E., & Belokurov, V. 2017, MNRAS, 470, 60, doi: 10.1093/mnras/stx1208
  * Fardal et al. (2015) Fardal, M. A., Huang, S., & Weinberg, M. D. 2015, MNRAS, 452, 301, doi: 10.1093/mnras/stv1198
  * Fardal et al. (2013) Fardal, M. A., Weinberg, M. D., Babul, A., et al. 2013, MNRAS, 434, 2779, doi: 10.1093/mnras/stt1121
  * Fillingham et al. (2018) Fillingham, S. P., Cooper, M. C., Boylan-Kolchin, M., et al. 2018, MNRAS, 477, 4491, doi: 10.1093/mnras/sty958
  * Font et al. (2021) Font, A. S., McCarthy, I. G., & Belokurov, V. 2021, MNRAS, 505, 783, doi: 10.1093/mnras/stab1332
  * Gao et al. (2004) Gao, L., White, S. D. M., Jenkins, A., Stoehr, F., & Springel, V. 2004, MNRAS, 355, 819, doi: 10.1111/j.1365-2966.2004.08360.x
  * Garrison-Kimmel et al. (2014) Garrison-Kimmel, S., Boylan-Kolchin, M., Bullock, J. S., & Lee, K. 2014, MNRAS, 438, 2578, doi: 10.1093/mnras/stt2377
  * Graus et al. (2016) Graus, A. S., Bullock, J. S., Boylan-Kolchin, M., & Weisz, D. R. 2016, MNRAS, 456, 477, doi: 10.1093/mnras/stv2728
  * Harris et al. (2020) Harris, C. R., Jarrod Millman, K., van der Walt, S. J., et al. 2020, arXiv e-prints, arXiv:2006.10256.  https://arxiv.org/abs/2006.10256
  * Helmi et al. (2018) Helmi, A., Babusiaux, C., Koppelman, H. H., et al. 2018, Nature, 563, 85, doi: 10.1038/s41586-018-0625-x
  * Hendel & Johnston (2015) Hendel, D., & Johnston, K. V. 2015, ArXiv:1509.06369.  https://arxiv.org/abs/1509.06369
  * Hunter (2007) Hunter, J. D. 2007, Computing in Science and Engineering, 9, 90, doi: 10.1109/MCSE.2007.55
  * Ibata et al. (2007) Ibata, R., Martin, N. F., Irwin, M., et al. 2007, ApJ, 671, 1591, doi: 10.1086/522574
  * Ibata et al. (2002) Ibata, R. A., Lewis, G. F., Irwin, M. J., & Quinn, T. 2002, MNRAS, 332, 915, doi: 10.1046/j.1365-8711.2002.05358.x
  * Jang et al. (2020) Jang, I. S., de Jong, R. S., Holwerda, B. W., et al. 2020, A&A, 637, A8, doi: 10.1051/0004-6361/201936994
  * Jiang et al. (2021) Jiang, F., Dekel, A., Freundlich, J., et al. 2021, MNRAS, 502, 621, doi: 10.1093/mnras/staa4034
  * Johnson et al. (2016) Johnson, L. C., Seth, A. C., Dalcanton, J. J., et al. 2016, ApJ, 827, 33, doi: 10.3847/0004-637X/827/1/33
  * Johnston et al. (2008) Johnston, K. V., Bullock, J. S., Sharma, S., et al. 2008, ApJ, 689, 936, doi: 10.1086/592228
  * Johnston et al. (2002) Johnston, K. V., Choi, P. I., & Guhathakurta, P. 2002, AJ, 124, 127, doi: 10.1086/341040
  * Johnston et al. (1999) Johnston, K. V., Sigurdsson, S., & Hernquist, L. 1999, MNRAS, 302, 771
  * Karachentsev et al. (2013) Karachentsev, I. D., Makarov, D. I., & Kaisina, E. I. 2013, AJ, 145, 101, doi: 10.1088/0004-6256/145/4/101
  * Kelley et al. (2019) Kelley, T., Bullock, J. S., Garrison-Kimmel, S., et al. 2019, MNRAS, 487, 4409, doi: 10.1093/mnras/stz1553
  * Koposov et al. (2010) Koposov, S. E., Rix, H.-W., & Hogg, D. W. 2010, ApJ, 712, 260, doi: 10.1088/0004-637X/712/1/260
  * Kroupa (2001) Kroupa, P. 2001, MNRAS, 322, 231, doi: 10.1046/j.1365-8711.2001.04022.x
  * Küpper et al. (2015) Küpper, A. H. W., Balbinot, E., Bonaca, A., et al. 2015, ApJ, 803, 80, doi: 10.1088/0004-637X/803/2/80
  * Lancaster et al. (2019) Lancaster, L., Belokurov, V., & Evans, N. W. 2019, MNRAS, 484, 2556, doi: 10.1093/mnras/stz124
  * Lewis et al. (2015) Lewis, A. R., Dolphin, A. E., Dalcanton, J. J., et al. 2015, ApJ, 805, 183, doi: 10.1088/0004-637X/805/2/183
  * Majewski et al. (2003) Majewski, S. R., Skrutskie, M. F., Weinberg, M. D., & Ostheimer, J. C. 2003, ApJ, 599, 1082, doi: 10.1086/379504
  * Malhan et al. (2018) Malhan, K., Ibata, R. A., & Martin, N. F. 2018, MNRAS, 481, 3442, doi: 10.1093/mnras/sty2474
  * Mao et al. (2021) Mao, Y.-Y., Geha, M., Wechsler, R. H., et al. 2021, ApJ, 907, 85, doi: 10.3847/1538-4357/abce58
  * Marigo et al. (2017) Marigo, P., Girardi, L., Bressan, A., et al. 2017, ApJ, 835, 77, doi: 10.3847/1538-4357/835/1/77
  * Martin et al. (2013) Martin, N. F., Ibata, R. A., McConnachie, A. W., et al. 2013, ApJ, 776, 80, doi: 10.1088/0004-637X/776/2/80
  * Martínez-Delgado et al. (2010) Martínez-Delgado, D., Gabany, R. J., Crawford, K., et al. 2010, AJ, 140, 962, doi: 10.1088/0004-6256/140/4/962
  * Martínez-Delgado et al. (2012) Martínez-Delgado, D., Romanowsky, A. J., Gabany, R. J., et al. 2012, ApJ, 748, L24, doi: 10.1088/2041-8205/748/2/L24
  * McConnachie et al. (2009) McConnachie, A. W., Irwin, M. J., Ibata, R. A., et al. 2009, Nature, 461, 66, doi: 10.1038/nature08327
  * McConnachie et al. (2018) McConnachie, A. W., Ibata, R., Martin, N., et al. 2018, ApJ, 868, 55, doi: 10.3847/1538-4357/aae8e7
  * Muzzin et al. (2013) Muzzin, A., Marchesini, D., Stefanon, M., et al. 2013, ApJ, 777, 18, doi: 10.1088/0004-637X/777/1/18
  * Newberg et al. (2002) Newberg, H. J., Yanny, B., Rockosi, C., et al. 2002, ApJ, 569, 245, doi: 10.1086/338983
  * Olsen et al. (2003) Olsen, K. A. G., Blum, R. D., & Rigaut, F. 2003, AJ, 126, 452, doi: 10.1086/375648
  * Pardy et al. (2020) Pardy, S. A., D’Onghia, E., Navarro, J. F., et al. 2020, MNRAS, 492, 1543, doi: 10.1093/mnras/stz3192
  * Pearson et al. (2022a) Pearson, S., Clark, S. E., Demirjian, A. J., et al. 2022a, ApJ, 926, 166, doi: 10.3847/1538-4357/ac4496
  * Pearson et al. (2015) Pearson, S., Küpper, A. H. W., Johnston, K. V., & Price-Whelan, A. M. 2015, ApJ, 799, 28, doi: 10.1088/0004-637X/799/1/28
  * Pearson et al. (2022b) Pearson, S., Price-Whelan, A. M., Hogg, D. W., et al. 2022b, arXiv e-prints, arXiv:2205.12277.  https://arxiv.org/abs/2205.12277
  * Pearson et al. (2017) Pearson, S., Price-Whelan, A. M., & Johnston, K. V. 2017, Nature Astronomy, 1, 633, doi: 10.1038/s41550-017-0220-3
  * Pearson et al. (2019) Pearson, S., Starkenburg, T. K., Johnston, K. V., et al. 2019, ApJ, 883, 87, doi: 10.3847/1538-4357/ab3e06
  * Perez & Granger (2007) Perez, F., & Granger, B. E. 2007, Computing in Science and Engineering, 9, 21, doi: 10.1109/MCSE.2007.53
  * Pillepich et al. (2014) Pillepich, A., Vogelsberger, M., Deason, A., et al. 2014, MNRAS, 444, 237, doi: 10.1093/mnras/stu1408
  * Price-Whelan & Bonaca (2018a) Price-Whelan, A. M., & Bonaca, A. 2018a, ApJ, 863, L20, doi: 10.3847/2041-8213/aad7b5
  * Price-Whelan & Bonaca (2018b) —. 2018b, ApJ, 863, L20, doi: 10.3847/2041-8213/aad7b5
  * Price-Whelan et al. (2014) Price-Whelan, A. M., Hogg, D. W., Johnston, K. V., & Hendel, D. 2014, ApJ, 794, 4, doi: 10.1088/0004-637X/794/1/4
  * Price-Whelan et al. (2016) Price-Whelan, A. M., Johnston, K. V., Valluri, M., et al. 2016, MNRAS, 455, 1079, doi: 10.1093/mnras/stv2383
  * Reino et al. (2020) Reino, S., Rossi, E. M., Sanderson, R. E., et al. 2020, arXiv e-prints, arXiv:2007.00356.  https://arxiv.org/abs/2007.00356
  * Rosenfield et al. (2012) Rosenfield, P., Johnson, L. C., Girardi, L., et al. 2012, ApJ, 755, 131, doi: 10.1088/0004-637X/755/2/131
  * Sacchi et al. (2021) Sacchi, E., Aloisi, A., Correnti, M., et al. 2021, ApJ, 911, 62, doi: 10.3847/1538-4357/abea16
  * Sales et al. (2013) Sales, L. V., Wang, W., White, S. D. M., & Navarro, J. F. 2013, MNRAS, 428, 573, doi: 10.1093/mnras/sts054
  * Sand et al. (2014) Sand, D. J., Crnojević, D., Strader, J., et al. 2014, ApJ, 793, L7, doi: 10.1088/2041-8205/793/1/L7
  * Sanderson et al. (2015) Sanderson, R. E., Helmi, A., & Hogg, D. W. 2015, ApJ, 801, 98, doi: 10.1088/0004-637X/801/2/98
  * Schlafly & Finkbeiner (2011) Schlafly, E. F., & Finkbeiner, D. P. 2011, ApJ, 737, 103, doi: 10.1088/0004-637X/737/2/103
  * Simon et al. (2021) Simon, J. D., Brown, T. M., Drlica-Wagner, A., et al. 2021, ApJ, 908, 18, doi: 10.3847/1538-4357/abd31b
  * Smercina et al. (2020) Smercina, A., Bell, E. F., Price, P. A., et al. 2020, ApJ, 905, 60, doi: 10.3847/1538-4357/abc485
  * Spergel et al. (2015) Spergel, D., Gehrels, N., Baltay, C., et al. 2015, ArXiv e-prints.  https://arxiv.org/abs/1503.03757
  * The DES Collaboration et al. (2015) The DES Collaboration, Drlica-Wagner, A., Bechtol, K., et al. 2015, ArXiv:1508.03622.  https://arxiv.org/abs/1508.03622
  * van Dokkum et al. (2014) van Dokkum, P. G., Abraham, R., & Merritt, A. 2014, ApJ, 782, L24, doi: 10.1088/2041-8205/782/2/L24
  * Virtanen et al. (2020) Virtanen, P., Gommers, R., Oliphant, T. E., et al. 2020, Nature Methods, 17, 261, doi: 10.1038/s41592-019-0686-2
  * Weisz et al. (2015) Weisz, D. R., Dolphin, A. E., Skillman, E. D., et al. 2015, ApJ, 804, 136, doi: 10.1088/0004-637X/804/2/136
  * Weisz et al. (2011) Weisz, D. R., Dalcanton, J. J., Williams, B. F., et al. 2011, ApJ, 739, 5, doi: 10.1088/0004-637X/739/1/5
  * Wheeler et al. (2015) Wheeler, C., Oñorbe, J., Bullock, J. S., et al. 2015, MNRAS, 453, 1305, doi: 10.1093/mnras/stv1691
  * Williams et al. (2012) Williams, B. F., Dalcanton, J. J., Bell, E. F., et al. 2012, ApJ, 759, 46, doi: 10.1088/0004-637X/759/1/46
  * Williams et al. (2014) Williams, B. F., Lang, D., Dalcanton, J. J., et al. 2014, ApJS, 215, 9, doi: 10.1088/0067-0049/215/1/9
  * Williams et al. (2017) Williams, B. F., Dolphin, A. E., Dalcanton, J. J., et al. 2017, ApJ, 846, 145, doi: 10.3847/1538-4357/aa862a
  * Yavetz et al. (2021) Yavetz, T. D., Johnston, K. V., Pearson, S., Price-Whelan, A. M., & Weinberg, M. D. 2021, MNRAS, 501, 1791, doi: 10.1093/mnras/staa3687
  * Yoon et al. (2011) Yoon, J. H., Johnston, K. V., & Hogg, D. W. 2011, ApJ, 731, 58, doi: 10.1088/0004-637X/731/1/58


Software solutions for form-based collection of data and the semantic enrichment of form data
Markus Steinberg

CHAPTER: INTRODUCTION

Data collection is an important part of many citizen science projects as well as other fields of research, particularly in life sciences.
Mobile applications with form-based surveys are increasingly used to support this, due to the large number of mobile devices and their growing number of built-in sensors.
Since the composition of form-based surveys from scratch can be a tedious task, multiple tools have been published that can help with their design and distribution as well as the data collection via mobile devices and the data storage.
Some even support simple data analysis.
With this increasing number of software options project leaders will often face the question, which tool is most suitable for their current use case.

With that in mind, this student project pursues two main objectives:

* To present an overview of a selection of survey design tools and their capabilities in order to provide a clear foundation for such a decision.

* To examine if any tool provides the capability to collect and export data in a way that can easily be used and interpreted by other applications or persons.
This aspect includes the supply of metadata about the data collection process and the data itself, information about the meaning of the data as well as an export format that can easily be processed.
This objective is directly aiming towards a planned follow-up project.

Chapter <ref> briefly covers the technical background by describing two form description standards that are relevant for the examined software tools.
In order to accomplish the stated goals, all of the tools were tested with respect to different aspects relevant to their usage.
First, a list of such aspects was compiled by comparing the features that are advertised by the tools themselves.
The coverage and usage of these features was then determined by thoroughly testing each of the tools:
First, general information about the tool like its open source repository or its license were identified by consulting its website and documentation.
Then, if no web-based version was offered, the tool was installed.
Afterwards a typical project's workflow was executed:
A form was designed, examining all available form-elements and form-building features like skip-logic or localization.
The survey was deployed to the mobile app, sample data was collected, submitted to the server and then exported.
In the end, additional features like visualization or data encryption were examined.
In cases where the availability of features was not obvious, the tool's community or its support were consulted for clarification.
The results for most of the examined aspects are illustrated in the form of feature-tables in chapter <ref>.
Since some aspects are hard to cover in such feature-tables and require some ellaboration, chapter <ref> provides descriptions of the examined tools with regards to facets like general user-friendliness or required technical knowledge.

Of course, such a project will never be able to cover all published tools, especially since the number is evergrowing.
The tools that are examined here were selected because of
their rapid recent development (EpiCollect5[<https://five.epicollect.net>]),
their large community (Open Data Kit 1 & 2[<https://opendatakit.org/software/>]),
explicit recommendations by the tool's users (Ohmage[<http://ohmage.org>]),
their extensive feature repertoir (Kobo[<https://www.kobotoolbox.org>])
or their professional design (SurveyCTO[<https://www.surveycto.com>] and Magpi[<https://home.magpi.com>]).
Other tools that are not covered here can of course be compared by examining the same aspects that are presented in this project.

CHAPTER: FORM DESCRIPTION STANDARDS

This chapter offers brief descriptions of the two most important form-description standards:
The W3C[<https://www.w3.org/>] standard XForms (Section <ref>) and the XLSForm specification (Section <ref>).
XLSForms are used for form-authoring by many major data collection platforms while XForms is usually used as an internal format for the created forms.
Other standards like the old XHTML standard defined in <cit.> are not covered here, since they are not relevant to any of the examined data collection tools.

§ XFORM

XForms is a standard that was published by the W3C.
Its current version, XForms 1.1, was published in <cit.> in 2009.
The standard describes a markup language to be used for platform-independent form descriptions as well as an abstract processing model that should be implemented by applications that handle such descriptions.
While the technical details of the standard are out of scope for this project, the following aspects are especially relevant for mobile data collection:
XForms provides an explicit distinction between presentation, purpose and content of web forms, leading to a clear separation of the definition of control-elements and the data that is being collected <cit.>.
Furthermore, the way in which a form control is rendered on a device or in a browser is not fixed <cit.>.
This implies, that a mobile device might render a certain form element different from a browser, specifically in a way that is more suitable for a small screen.

Even with XForms defining a clearly separated structure the resulting form descriptions are rather complicated and technical.
An example, extracted from <cit.>, is shown in Listing <ref>:
It illustrates the XForms model necessary to describe the simple web form shown in Figure <ref>.
The input-controls for this form have to be defined separately in a markup language.
Listing <ref> shows such controls described in XHTML.

Example Web Form

[label=lst:xformsModel,caption=XForms model]
<ecommerce xmlns="">
<xforms:submission action="http://example.com/submit" method="post"
id="submit" includenamespaceprefixes=""/>

[label=lst:xhtmlControls,caption=XHTML controls  bound to the model]
<select1 ref="method">
Select Payment Method:
<input ref="number">
Credit Card Number:
<input ref="expiry">
Expiration Date:
<submit submission="submit">

While designing an XForms compatible XML-description of a form is possible, it would be a tedious undertaking since the descriptions quickly get longer and more complex the more features like validation or skip logic are used.
That is the reason why XLSForm, described in the next section, was developed.

§ XLSFORM

XLSForm is a form description standard "created to simplify the authoring of forms in Excel"<cit.>.
This goal is accomplished by providing a tool that can transform a Microsoft Excel file with a specific structure into an XForms compatible form description.
These Excel files have an intuitive structure so a form description can easily be built without any technical knowledge about XML or the XForms standard in particular.
The desired form elements are described in one worksheet while options for elements like single-choice-questions are defined in a separate worksheet.
This has two main advantages:
First, it provides a clear structure so the form author knows exactly where to look for which piece of information.
Secondly, it allows to refer to a certain set of possible answers multiple times; for example the option-set for "yes-or-no"-questions only has to be defined once.
An additional worksheet can be used to provide some general information about the form itself, like a title or a version number.

Figures <ref>, <ref> and <ref> show the three worksheets that describe the web form in Figure <ref>.
These worksheets are evidently more human readable and easier to modify than the corresponding XForms description.

XLSForm Example - Survey worksheet

XLSForm Example - Choices worksheet

XLSForm Example - Settings worksheet

XLSForms does not provide support for the full XForms standard, it is only compatible with a subset of its features.
This subset was defined by the Javarosa project[<https://bitbucket.org/javarosa/javarosa/wiki/Home>].
Since the project has been inactive, the original server that was hosting most of its information, including the subset definition, has been shut down.
However, the XLSForms standard, and with it the XForms subset, has been adopted by the Open Data Kit community in their ODK XForms Specification[<http://opendatakit.github.io/xforms-spec/>].
XLSForms has since become a widely accepted form description standard and is used by multiple data collection platforms.

CHAPTER: COMPARISON

This chapter provides an assessment of different aspects of interest offered by the examined tools.
First, brief explanations are given for each aspect.
Afterwards, tables illustrate which tools include which features.
To give a better overview, these tables are separated into multiple categories:
Table <ref> contains information about form-elements that are available to build a survey.
Multiple tables then display different examined features:
Steps of a data collection workflow that are supported by the tools (Table <ref>), Features enhancing the survey design (Table <ref>), the form description standard compliance (Table <ref>), data export formats (Table <ref>), development related information (Table <ref>) and other features of interest (Table <ref>).
At the end of this chapter, one last table presents the metadata that can be collected with each of the tools (Table <ref>).

§ FORM-ELEMENTS

This section provides an overview of the different form-elements that can be used to build a survey.

* Text: Simple text input.

* Integer: Whole number input.

* Double: Decimal number input.

* Date: Selection of a date, typically using a calendar or spinners.

* Time: Selection of a time of day, typically using spinners.

* Single-choice-question: Selection of a single option from a defined set of options. Typically using radio buttons or a dropdown-list.

* Multiple-choice-question: Selection of one or more options from a defined set of options. Typically using checkboxes.

* Readme: Display of arbitrary text to the user. No input.

* Location (Manually): Manual input of geographical information. Typically by placing a pointer on a map or explicitly stating latitude, longitude, altitude and accuracy.

* Location (Auto): Automated detection of the current location, typically using GPS or GSM.

* Path: Input of multiple geolocations connected via a path.

* Area: Input of a geographical area, typically defined by a polygon or a bounding box.

* Image: Upload an image from device storage or take a new picture using the collection devices camera.

* Audio: Upload or record an audio signal.

* Video: Upload or record a video.

* Barcode: Scan a barcode and collect the encoded information.

* Rating: Assign defined categories (e.g. "good", "neutral" and "bad") to a defined set of options.

* Ranking: Rank a defined set of options by assigning an order.

* NFC: Read information via Near-Field Communication[<http://nearfieldcommunication.org/about-nfc.html>].

The form elements included in the examined tools.

(…element included; …element partially included; …element not included)

§ FEATURES

*Workflow steps

This section provides an overview of the project workflow steps that are supported by the different data collection tools.

* Form design: Is the design of a data collection survey supported by the tool?

* Data collection: Is data collection supported by the tool?

* Visualization: Which visualization types are provided by the tool?

* Analysis: Does the tool provide support for basic data analysis?

* Publication: Which cloud platforms and tools can data be published to directly?

*Survey design

This section illustrates different features that simplify form-authoring or allow to build more sophisticated and user-friendly surveys.

* Form Designer: Build a survey in a user interface, typically using drag and drop.

* Skip Logic: Skip certain parts of a survey, depending on previous answers.

* Localization: Define labels for questions in multiple languages so the survey can automatically be translated to a user's preferred language.

* Calculations: Evaluate mathematical or logical expressions referencing previous answers during the survey and use the results in skip logic, readmes, ...

* Queries[Detailed usage description: <https://docs.opendatakit.org/odk2/xlsx-converter-using/#using-queries> ]: Read data from a structured source (e.g. CSV files) and use the results for skip logic, as answer-options, ...

* Linked Tables[Detailed usage description: <https://docs.opendatakit.org/odk2/xlsx-converter-using/#linked-tables>]: Launch subforms that store data in different tables.

* Required & Optional fields: Mark a question as required or optional to indicate if the survey can be finished without providing an answer.

* Validation: Define validity constrains for form-fields, e.g. a range of valid values for a number input.

*Form description standards

This section presents which of the form description standards mentioned in chapter <ref> are supported when trying to import or export designed forms.

* XForms Export: Export forms compatible with the XForms standard.

* XForms Import: Import forms compatible with the XForms standard.

* XLSForm Export: Export forms in the XLSForm format.

* XLSForm Import: Import forms in the XLSForm format.

*Data export formats

This section lists the different file formats in which collected data can be exported.
This refers only to file export, not to the publication on cloud platform mentioned in Table <ref>.

* CSV Export: Export collected data in CSV format.

* JSON Export: Export collected data in JSON format.

* XLS Export: Export collected data in XLS format.

* XML Export: Export collected data in XML format.

* XML/KML Export: Export collected geographical data in KML format.

* RDF Export: Export collected data in RDF format.

*Development related

This section contains aspects that are most relevant to developers who want to extend the existing tools and to projects leaders who want to set up their own instance of one of the tools.

* Active Development: Is the software currently under active development? This is judged, if possible, by Git-commits in the past six months, otherwise by activity on social media or in forums.

* License: License under which the software is provided.

* Open Source: Is the full software provided open source? This includes all parts that are required to build and deploy a survey, collect data with a mobile device and store the data on a server.

* Programming language: Programming languages that are used for the tool's development.

* Self-hosting: Is it possible to host the software yourself so the collected data is stored on your own server?

*Miscellaneous features

This section consists of different aspects that are potentially important to evaluate the fitness for use of the tools but don't fit into any of the previous categories.

* Data Encryption: Can submitted data be encrypted and stay encrypted while stored on the server? This requires the form author to provide a public key and to later decrypt the data using a private key. This feature does not only refer to the data transport, so SSL support for data submission is not sufficient.

* Semantic Enrichment: Does the software allow to provide some kind of semantic enrichment (e.g. mapping certain form-fields to ontology terms) or does it provide semantic enrichtment out-of-the-box?

* HXL support: Map form-fields to tags and attributes of the Humanitarian Exchange Language (HXL), which is a data standard "designed to improve information sharing during a humanitarian crisis"<cit.>.

* Building custom prompts: Build prompts with custom functionality, typically using a markup language like HTML for the presentation and a programming language to define the functionality.

* Visualization & Data management on mobile device: Visualize (e.g. show on a map) and edit data entries on the mobile device.

* Offline-Collection: Can data be collected without active internet access? Data can be uploaded to a server at a later point in time.

* Mobile OS support: Which operating systems are supported by the mobile app and, for open source tools, whether the app was developed natively or platform independent.

The workflow steps supported by the examined tools.

(…step supported; …step partially supported; …step not supported)

The survey design features provided by the examined tools.

(…feature included; …feature partially included; …feature not included)

The form description formats supported by the examined tools.

(…feature included; …feature partially included; …feature not included)

The data export formats supported by the examined tools.

(…feature included; …feature not included)

The development related features provided by the examined tools.

(…feature included; …feature not included)

Other features provided by the examined tools.

(…feature included; …feature partially included; …feature not included)

§ METADATA

This section describes the different kinds of metadata that can be gathered by the data collection tools

* Start: Timestamp or date when an instance of the survey was started on the collection device.

* End: Timestamp or date when an instance of the survey was finalized on the collection device.

* Today: Timestamp or date when an instance of the survey was submitted to the data server.

* Device-ID: International Mobile Equipment Identity (IMEI) - Unique identifier for mobile phones.

* SIM serial: Identifier of the Subscriber Identity Module (SIM) used in the collection device.

* Subscriber-ID: International Mobile Subscriber Identity (IMSI) - Unique identifier for mobile network users, usually stored on the SIM card.

* Phone number: Phone number of the collection device.

* Username: Name of the user account, registered on the data collection platform.

* Email: Email-address used for the account registered on the data collection platform.

* Duration: Duration from starting the survey to finalizing.

The metadata collection features provided by the examined tools.

(…feature included; …feature not included)

CHAPTER: TOOL DESCRIPTIONS

This chapter provides short descriptions for all examined tools.
These descriptions focus on aspects that were hard to cover in the presented feature tables, such as the required technical expertise, the assistance for inexperienced form authors or the straightforwardness of the tool's usage workflows.
Additionally, the chapter features a brief summary of another software tool: a suite from the COBWEB-project[<https://cobwebproject.eu>] that was originally supposed to be included in the comparison but was deemed unfit for thorough testing during the process of this student-project.

CHAPTER: CONCLUSION

The presented comparison shows that due to the different features that are offered by the different software tools, the choice of a platform depends on the given use case with its unique requirements.
However, it also shows that ODK1 and KoBo Toolbox are the open source tools that offer the biggest collections of features.
SurveyCTO on the other hand offers the most professional and user-friendly environment if the limitations of the free subscription are not a problem.
For most data collection projects, at least one of these three tools should be able to cover the requirements.

Another point that this comparison shows very clearly is that none of the tools currently provide any kind of semantic component that would allow direct interpretation of the exported data.
The only tool that seemed to take a step in this direction was the COBWEB software suite with its RDF export, which was not fit for proper testing.
Since linked and semantically enriched data enable more meaningful interpretation of the data and even automated reasoning, such features could drastically improve both quality and usability of the collected data.
Therefore, such features deserve some attention in the future enhancement of data collection platforms and tools.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus at pulvinar nisi. Phasellus hendrerit, diam placerat interdum iaculis, mauris justo cursus risus, in viverra purus eros at ligula. Ut metus justo, consequat a tristique posuere, laoreet nec nibh. Etiam et scelerisque mauris. Phasellus vel massa magna. Ut non neque id tortor pharetra bibendum vitae sit amet nisi. Duis nec quam quam, sed euismod justo. Pellentesque eu tellus vitae ante tempus malesuada. Nunc accumsan, quam in congue consequat, lectus lectus dapibus erat, id aliquet urna neque at massa. Nulla facilisi. Morbi ullamcorper eleifend posuere. Donec libero leo, faucibus nec bibendum at, mattis et urna. Proin consectetur, nunc ut imperdiet lobortis, magna neque tincidunt lectus, id iaculis nisi justo id nibh. Pellentesque vel sem in erat vulputate faucibus molestie ut lorem.

Quisque tristique urna in lorem laoreet at laoreet quam congue. Donec dolor turpis, blandit non imperdiet aliquet, blandit et felis. In lorem nisi, pretium sit amet vestibulum sed, tempus et sem. Proin non ante turpis. Nulla imperdiet fringilla convallis. Vivamus vel bibendum nisl. Pellentesque justo lectus, molestie vel luctus sed, lobortis in libero. Nulla facilisi. Aliquam erat volutpat. Suspendisse vitae nunc nunc. Sed aliquet est suscipit sapien rhoncus non adipiscing nibh consequat. Aliquam metus urna, faucibus eu vulputate non, luctus eu justo.

Donec urna leo, vulputate vitae porta eu, vehicula blandit libero. Phasellus eget massa et leo condimentum mollis. Nullam molestie, justo at pellentesque vulputate, sapien velit ornare diam, nec gravida lacus augue non diam. Integer mattis lacus id libero ultrices sit amet mollis neque molestie. Integer ut leo eget mi volutpat congue. Vivamus sodales, turpis id venenatis placerat, tellus purus adipiscing magna, eu aliquam nibh dolor id nibh. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed cursus convallis quam nec vehicula. Sed vulputate neque eget odio fringilla ac sodales urna feugiat.

Phasellus nisi quam, volutpat non ullamcorper eget, congue fringilla leo. Cras et erat et nibh placerat commodo id ornare est. Nulla facilisi. Aenean pulvinar scelerisque eros eget interdum. Nunc pulvinar magna ut felis varius in hendrerit dolor accumsan. Nunc pellentesque magna quis magna bibendum non laoreet erat tincidunt. Nulla facilisi.

Duis eget massa sem, gravida interdum ipsum. Nulla nunc nisl, hendrerit sit amet commodo vel, varius id tellus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ac dolor est. Suspendisse ultrices tincidunt metus eget accumsan. Nullam facilisis, justo vitae convallis sollicitudin, eros augue malesuada metus, nec sagittis diam nibh ut sapien. Duis blandit lectus vitae lorem aliquam nec euismod nisi volutpat. Vestibulum ornare dictum tortor, at faucibus justo tempor non. Nulla facilisi. Cras non massa nunc, eget euismod purus. Nunc metus ipsum, euismod a consectetur vel, hendrerit nec nunc.

Missing 'biblatex' package
The bibliography requires the 'biblatex' package.

titleCOBWEB - Project Details

titleCOBWEB - Public Deliverables

titleCOBWEB - Software Outputs

titleCOBWEB Website

titleD3.8 – COBWEB Platform Release - Final

titleDobility Website
family=HXL Working Group,

titleHumanitarian Exchange Language
family=Imperial College London,

titleEpiCollect5 User Guide - Project Details

titleAbout Magpi

titleAbout Us

titleOhmage Server Github
family=Open Data Kit,

titleDeploying an Application
family=Open Data Kit,

titleGetting Started with ODK
family=Open Data Kit,

titleODK Aggregate Deployment
family=Open Data Kit,

titleODK Cloud Endpoints
family=Open Data Kit,

titleODK Help page
family=Open Data Kit,

titleODK XForms Specification

titleXForms 1.1

titleXHTML™ 1.0 The Extensible HyperText Markup Language (Second
titleXLSForm Documentation