Photospheric Prompt Emission From Long Gamma Ray Burst Simulations -- I. Optical Emission

A complete understanding of Gamma Ray Bursts (GRBs) has been difficult to achieve due to our incomplete knowledge of the radiation mechanism that is responsible for producing the prompt emission. This emission, which is detected in the first tens of seconds of the GRB, is typically dominated by hard X-ray and gamma ray photons although, there have also been a few dozen prompt optical detections. These optical detections have the potential to discriminate between plausible prompt emission models, such as the photospheric and synchrotron shock models. In this work we use an improved MCRaT code, which includes cyclo-synchrotron emission and absorption, to conduct radiative transfer calculations from optical to gamma ray energies under the photospheric model. The calculations are conducted using a set of two dimensional relativistic hydrodynamic long GRB jet simulations, consisting of a constant and variable jet. We predict the correlations between the optical and gamma ray light curves as functions of observer angle and jet variability and find that there should be extremely dim optical prompt precursors for large viewing angles. Additionally, the detected optical emission originates from dense regions of the outflow such as shock interfaces and the jet-cocoon interface. Our results also show that the photospheric model is not able to account for the current set of optical prompt detections that have been made and additional radiative mechanisms are needed to explain these prompt optical observations. These findings show the importance of conducting global radiative transfer simulations using hydrodynamically calculated jet structures.


INTRODUCTION
Gamma Ray Bursts (GRBs), some of the most energetic events in the Universe (Kulkarni et al. 1999), have been detected since the 1960's as pulses of gammaray radiation (Klebesadel et al. 1973). These transient events have been classified into two groups based on duration times (Kouveliotou et al. 1993); events that last 2 s are known as Short GRBs (SGRBs) while events that last 2 s are classified as Long GRBs (LGRBs). SGRBs are associated with the merger of compact objects (Abbott et al. 2017;Goldstein et al. 2017;Lazzati et al. 2018) and LGRBs are associated with core-collapse supernovae (Bloom et al. 1999;MacFadyen et al. 2001;Hjorth et al. 2003). Both types of GRBs are thought to share a common physical mechanism that produces the prompt emission (Ghirlanda et al. 2011), the emission that is detected during the first few seconds of these events, however the details of the mechanism are still under investigation.
There are a number of models that attempt to describe the physical mechanism that produces the prompt emission. These can be broadly grouped into those that employ synchrotron radiation and those that rely on emission from the photospheres of the GRBs. The for-mer set of models are based on and include the optically thin synchrotron shock model (SSM) (Rees & Mészáros 1994), which describes shells of material that are launched by a central engine with varying speeds. These shells eventually collide with one another and produce nonthermal radiation if the optical depth is less than 1. This model is able to account for the variability and nonthermal spectra observed in GRBs, however it in tension with the Yonetoku, Amati, and Golenetskii relationships (Amati, L. et al. 2002;Yonetoku et al. 2004;Golenetskii et al. 1983;Zhang & Yan 2011). In an attempt to remedy these discrepancies modifications have been made to the SSM through the use of globally ordered and random magnetic fields in GRB jets (Toma et al. 2009;Zhang & Yan 2011).
The other branch of models that is used to describe the prompt emission of GRBs relies on photospheric emission. This photospheric model considers photons produced deep in the GRB jet which interact with the matter in the jet; this radiation is eventually advected out of the jet once the optical depth is ≈ 1 at the photosphere (Rees & Mészáros 2005;Pe'er et al. 2006;Beloborodov 2010a;Lazzati et al. 2009). Spectra calculated from the photospheric model can be non-thermal due to: subphotospheric dissipation and shocks (Chhotray & Laz-zati 2015;Parsotan et al. 2018;Ito et al. 2018), photons originating from high latitude regions of the outflow (Parsotan et al. 2018;Pe'er & Ryde 2011), and the photospheric region, where the photosphere is a volume of space (instead of a surface) where photons may experience their last scattering before being detected (Parsotan & Lazzati 2018;Parsotan et al. 2018;Ito et al. 2015;Pe'er 2008;Beloborodov 2010b;Ito et al. 2019). The photospheric model is able to reproduce the Yonetoku, Amati, and Golenetskii relationships (Lazzati et al. 2013;López-Cámara et al. 2014;Parsotan & Lazzati 2018;Parsotan et al. 2018;Ito et al. 2019) and many detected polarization measurements of GRBs (Parsotan et al. 2020). Despite these successes, one drawback of the model has been its inability to consistently produce enough low energy photons (below typical GRB spectral peak energies of ∼ few ×10 2 keV) in the outflow (Parsotan & Lazzati 2018;Parsotan et al. 2018).
Theoretical studies of the photospheric model and the SSMs have primarily focused on the X-ray and gammaray energies in order to compare model predictions to observational data. As a result, various models are able to explain observed characteristics of GRBs in this energy regime. Alternatively, there have been a number of optical emission detections made during the prompt emission of GRBs which provide additional data for the purpose of model comparison. Optical data is less straightforward to interpret than gamma ray data due to the complications that it experiences from absorption along the observers line of sight and overlapping optical light emitted during the early afterglow phase of the GRB, due to forward/reverse shocks of the jet colliding with the external medium. Kopač et al. (2013) analyzed a sample of GRBs with optical detections during the prompt emission and found a diverse set of observed properties. The varied behavior that they found can be attributed to the various physical mechanisms that produced the optical emission of the GRBs in their sample. Some of the optical emission in their sample is attributed to the prompt emission, due to the optical and X-ray emissions tracking one another, while other detections can be attributed to emission from the early afterglow phase of the GRB, due to similarities with emission expected from forward or reverse shocks (Sari & Piran 1999;Mészáros & Rees 1999). Oganesyan et al. (2019) recently refined this analysis and only analyzed GRBs with optical emission that was thought of as being directly related to the GRB prompt emission. In the spirit of having a concise list of GRBs with optical prompt emission detections that have been deemed to be produced by the same emission mechanism responsible for the gamma ray prompt emission, we have expanded on the work of Kopač et al. (2013) and Oganesyan et al. (2019) by identifying GRBs in the literature that have optical detections that have been attributed to the prompt emission, including those analyzed by Oganesyan et al. (2019); this information is compiled into Table 1 where we list the name of the GRB, the instrument that first took optical observations, the redshift of the GRB where available, the peak observed magnitude of the observed optical emission (independent of filter), the spectral index, β 1 , measured from the optical to X-ray bands where available or where an estimate could be made, and the appropriate reference.
The models that have attempted to describe GRB optical prompt emission employ synchrotron radiation mechanisms (see e.g. Zhang & Yan (2011) and Zhao et al. (2009)); although, Zheng et al. (2006) did propose that the optical prompt emission from GRB 041219A was formed by saturated comptonization of the GRB's gamma ray photons in a surrounding electron cloud. As a result, most of the analysis that has been conducted of prompt optical emission has been under the assumption of synchrotron emission producing the detected radiation, including the analysis conducted by Kopač et al. (2013) and Oganesyan et al. (2019). In their analysis, Oganesyan et al. (2019) fit the spectra of the GRBs in their sample set with two models: a synchrotron model, that captured the physics of synchrotron radiation for a range of values of interest, and a "thermalized" two component model, consisting of a cutoff power law with a subdominant blackbody component. They found that the synchrotron models provided superior fits to the spectra from optical to gamma rays, while the "thermalized" model typically overpredicted the optical portion of the spectra. When using the synchrotron model to predict the properties of the emission region of the jet (such as bulk lorentz factor, number density of electrons, magnetic field strength, etc.), Oganesyan et al. (2019) calculated values that were in tension with other analysis of GRB prompt emission weakening their prediction that synchrotron emission is responsible for the prompt emission of GRBs. Furthermore, Oganesyan et al. (2019) point out that relaxing the synchrotron emission mechanism criteria and permitting synchrotron self compton solutions would produce optical prompt emission that is brighter than what is typically observed. Synchrotron emission is still commonly taken to be the leading model for explaining optical prompt emission, especially due to the brightness of the naked-eye burst GRB 080319B (Racusin et al. 2008;Shen & Zhang 2009;Tang & Zhang 2006). There are many variations of the synchrotron emission mechanism that have been invoked Table 1. Various optical detections of GRBs that have been associated with the emission mechanism that produces gamma-ray prompt emission in the literature. We list the GRB, the instrument that first started optical observations, the redshift of the GRB where available, the peak observed Vega magnitude of the observed optical emission, the spectral index, β1, from the optical to X-ray energies in the spectrum (such that fν ∝ ν β 1 ) where available , and the appropriate reference for the GRB. The β1 obtained below from the cited works were either reported in the manuscript or estimated by us based on plots of the prompt spectra; in the cases of GRBs 041219A and 050401, we calculated the spectral slope from Rykoff et al.'s (2005) Table 3. When various time resolved spectra that extended to optical energies are presented, we estimate the β1 and present them as ranges, such as in the case of GRB 080319B. In some cases, such as for GRB 080928, the low energy tails of the spectra were fixed to be that of synchrotron radiation in order to acquire a converged spectral slope power law fit. Due to the risk of oversimplifying these spectral fits, we have excluded these spectral indexes from the Table. GRB  (2008) theorized that synchrotron emission produced by residual internal shocks would also be able to account for observed optical prompt emission. Optical prompt emission has also been interpreted as synchrotron emission that has been produced in regions of the jet that are distinct from the region where gamma ray photons are produced (Fan et al. 2009;Zou et al. 2009). Inverse compton has been proposed as a plausible radiation mechanism by Racusin et al. (2008) however this model has been shown to violate energy constraints obtained from GRB observations (Piran et al. 2009). While synchrotron emission is still the leading emission mechanism for explaining the current set of optical prompt emission detections, there has not been sufficient investigation of the photospheric model and its ability to account for the few dozen optical prompt detections. The photospheric model is in a prime position for making predictions of the optical prompt emission. Although this model had been neglected in the past, recent advances in making predictions under this model has made the task of simulating emission across the electromagnetic spectrum feasible. Current state-ofthe-art radiative transfer calculations of photospheric prompt emission combines complex jet structures and self-consistent radiation treatments (Lazzati 2016;Parsotan & Lazzati 2018;Parsotan et al. 2018;Ito et al. 2015Ito et al. , 2019Parsotan et al. 2020) providing a deeper insight into the emission from GRBs. The addition of cyclo-synchrotron emission and absorption processes into these radiative transfer calculations, as presented in this paper, make it possible to explore how much optical emission is expected under the photospheric model and make predictions of the optical prompt emission under this model.
In this paper we present the first simulations of the photospheric optical prompt emission for a set of LGRB special relativistic hydrodynamic (SRHD) simulations. We show synthetic spectra and light curves for these GRBs and the varied degree of correlation between the optical light curves and the bolometric light curves, which are dominated by gamma ray radiation. Additionally, we explore where the optical photons originate in the outflow. In Section 2, we discuss the radiative transfer simulations, the mock observations, and the hydrodynamic simulations that the radiative transfer cal-culations used to define the jet profile. In Section 3 and 4, we outline the results of our radiative transfer simulations and their implications on our understanding of current and future optical prompt emission measurements, respectively. In a companion paper, we extend this analysis to polarization and conduct a time resolved spectro-polarimetry analysis of GRB prompt emission from optical to gamma rays (Parsotan & Lazzati 2021).

The MCRaT Code
The MCRaT (Monte Carlo Radiation Transfer) code 1 (Parsotan 2021a) is an open source, highly parallelized radiative transfer code that conducts postprocessing radiative transfer calculations using a jet profile acquired from special relativistic hydrodynamic (SRHD) simulations of GRB jets (Parsotan & Lazzati 2018;Parsotan et al. 2018Parsotan et al. , 2020. The code is compatible with jets simulated with the FLASH and PLUTO hydrodynamics codes (Fryxell et al. 2000;Mignone et al. 2012) and it takes into account a number of physical processes relevant to jetted systems such as Compton scattering, the Klein-Nishina cross section with polarization, and cyclo-synchrotron emission and absorption (as described in Section 2.2; Lazzati (2016); Parsotan & Lazzati (2018); Parsotan et al. (2018,2020)).
The MCRaT code injects a blackbody or Wien spectrum into the SRHD simulation where the optical depth is 10 3 or 10 2 respectively (Parsotan et al. 2018). The injected photons are then individually scattered and propagated from frame to frame of the SRHD simulation. The properties of the jet are acquired from the SRHD simulation and are used to determine: which photons will scatter, the energy of the electron that the photon will scatter with, and the lab frame energies of the photons once the scattering is complete.

Cyclo-synchrotron Emission in MCRaT
We have enhanced the MCRaT code by including cyclo-synchrotron (CS) emission and absorption, allowing us to simulate the prompt emission of GRBs from optical to gamma ray energies. In this section we will briefly describe our implementation of these processes in the code and show tests of the algorithm. Details of the implementation of CS emission and absorption can be found in Appendix A.
From frame to frame of the SRHD simulation, the photons propagate a distance cδt, where c is the speed of light and δt is the time between two simulation frames. We show the SRHD simulation fluid elements where various fluid parameters are defined, the thermally injected photons as red circles, the CS pool of photons as black diamonds with the size of the diamond correponding to the number of pool photons located within a cell, and scattered, unabsorbed photons as blue stars. We also show the shell that defines where the pool of CS photons are emitted into the simulation as dashed black lines. In the first frame of the simulation, at t = to, the code injects only thermal photons with the number of photons dependent on the temperature of the cell. In the next frame, at t = to + δt, the code emits the pool of CS photons and scatters them appropriately. At t = to + 2δt the pool of CS photons are absorbed along with any other photons with energies less than the CS frequency of the cell that they are located within. Then, the next frame is loaded and a new set of CS pool photons are emitted to be potentially scattered alongside the original thermally injected photons and the scattered CS photons that have survived absorption.
This defines a shell where we emit a pool of CS photons into the MCRaT simulation 2 . We identify the fluid elements within this shell and calculate the number of CS photons that will be emitted into each element. Within a given fluid element, we calculate the number of CS photons that will be emitted by integrating the blackbody number density spectrum up to the cyclotron frequency of that given cell. Since we inject CS photons based on the local blackbody spectrum, we are naturally limited by the number of photons that would be expected under the blackbody distribution and can never exceed that flux. The comoving magnetic field of the fluid element, which affects the cyclotron frequency of the same element, can be calculated in two ways: 1) using the internal energy of the fluid element, or 2) using the total energy of the fluid parcel. As outlined in Appendix A, the fluid frame magnetic field in the internal energy 2 The emission of CS photons does not occur in the very first frame of the SRHD simulation due to the fact that we typically inject photons drawn from a blackbody spectrum as our initial condition, which accounts for all emission and absorption processes.
case is calculated by setting the comoving magnetic field energy density of the fluid element equal to the electron thermal kinetic energy of that same element, with some unitless factor B . This results in where n i is the number density of electrons in the fluid element, and the comoving temperature of the fluid ele- where p i is the pressure of the fluid element as acquired from the SRHD simulation and a is the radiation density constant. In the total energy case the comoving magnetic field is calculated by relating the luminosity of the magnetic field to the total luminosity of the fluid element with a unitless parameter B . Here, the comoving magnetic field is given as where ρ i is the density of the fluid element. With the number of CS photons calculated to be in each cell of the shell completed, the total number of photons that should be emitted into the shell can be calculated as the sum of the CS photons emitted into each fluid element. The code then follows a procedure that attempts to balance the actual calculated number of photons that should be emitted into the shell with a computationally feasible number of MCRaT photons. This procedure iteratively calculates the number of photons in each cell while varying the weight of the photons (the weight is the number of physical photons each MCRaT photon packet represents) until the total number of photons emitted into the shell falls within a user defined range.
The aforementioned procedure emits a pool of CS photons into the MCRaT simulation, which is a stagnant population of CS photons that can potentially be scattered as the simulation continues. There are two other populations of photons in MCRaT: the thermally injected blackbody photons that make up the initial condition of the simulation and the scattered CS photons, which may have energies that are larger than the cyclotron frequencies of the fluid elements that they are located in and thus will survive absorption.
After creating the pool of CS photons, MCRaT continues its algorithm of: calculating the mean free path of photons, incrementing the distance traveled of each photon that is not part of the CS pool to correspond to the smallest mean free path, and scattering the photon with this mean free path. This cycle is continued until the simulation time has been incremented to correspond to that of the next SRHD simulation frame. If a pool CS photon has been chosen to be scattered, it will be replaced in the pool of CS photons. Then the photon will be randomly placed within its fluid element and allowed to scatter normally. Once a time δt has passed in the simulation, the code checks to see if any photons have frequencies that are smaller than the cyclotron frequency of the fluid element that they are located within at that time. If this condition is true, those photons are "absorbed" by removing them from the list of photons that are considered for scattering in MCRaT.
The various photon populations that exist in MCRaT and their behaviors as the simulation progresses are outlined in Figure 1. We show the initial thermally injected blackbody photons as red circles, the pool of CS photons as black diamonds, and the scattered CS photons that survive absorption as blue stars. We also plot the shell that marks where the CS pool of photons are emitted into the simulation as the black dashed lines. In this cartoon, we show the injection of thermal photons into the first frame of the simulation, at t = t o , based on the properties of each fluid element, where the hottest and coolest fluid elements corresponds to high and low photon densities respectively (Parsotan et al. 2018). In the next frame of the SRHD simulation, at t = t o + δt, the original set of thermal photons still exist but there is also the pool of CS photons that can potentially be scattered to higher energies. Here the size of each diamond marker represents the amount of CS pool photons that are present in each fluid element, which is dependent on B i . Just before the next frame is loaded, corresponding to t = t o + 2δt, MCRaT "absorbs" the CS pool photons and any other photons that have energies smaller than the CS frequency of the fluid element that they are located within. After, the next frame of the simulation is loaded and the original thermally injected photons are present and so are some scattered CS photons that have survived absorption. In this new frame, the shell denoting where the CS photons are emitted has moved and we have placed a new set of pool CS photons that can potentially be upscattered.
As the simulation progresses, the number of photons will naturally grow. In order to keep the number of simulated photons reasonable, MCRaT periodically rebins the scattered CS photons in energy and space (as detailed in Appendix A.3).
In order to verify the proper implementation of the CS process in MCRaT and to understand the effects that the various magnetic field calculations (the internal energy and total energy options as detailed in Section A.2) have on the spectra, we ran a number of test simulations of MCRaT on a spherical outflow, similar to the analysis done by Lazzati (2016). These tests and their results are outlined in Section A.4, which we summarize briefly. We find that the total energy method of calculating the magnetic field emits a larger number of CS photons in the MCRaT simulation compared to the internal energy method. We also find that our MCRaT spectra are able to recover the saturated comptonized spectra for an input of soft photons, which was also recovered by Vurm et al. (2013). Additionally, we find that the fraction of energy in the magnetic field compared to the total energy of the outflow, B , does not have a large effect on the resultant spectrum; this result means that we can set B = 0.5, as we do in this paper, and not expect our results to change much for B that are a factor of ∼ 2 different from 0.5.

Mock Observations
The results of the MCRaT simulations can be used to produce mock observations of the SRHD LGRB simulations. The procedure for conducting these mock observations has been outlined in Parsotan & Lazzati (2018), Parsotan et al. (2018), andParsotan et al. (2020). Here, we briefly summarize the methods we use to construct our mock observations, which is encoded in our Pro-cessMCRaT code 3 (Parsotan 2021b).
Mock observed light curves are produced by calculating the time of arrival of each MCRaT photon with respect to a virtual detector located at some distance from the origin of the SRHD simulation. We place the virtual detector at a number of viewing angles, θ v , with respect to the jet axis and calculate which photons are propagating towards an observer located at that angle. We accept photons that are moving towards the observer within a ±0.5 • acceptance interval. The light curves can be binned into uniform time bins or into variable time bin sizes that are determined by a bayesian blocks binning algorithm (Astropy Collaboration et al. 2013, 2018. We present bolometric and optical light curves in this paper, each being binned into the same time bins as the other. Bolometric light curves are calculated following the aforementioned method and no photon energies are excluded from the calculation; the bolometric light curve is typically dominated by the gamma ray emission. The optical light curves that we show in this paper are calculated in the same manner except we only consider photons that have energies that fall within the Swift UVOT White bandpass, from 1597-7820Å 4 (∼ 1.5 − 7.7 eV) (Poole et al. 2008;Rodrigo & Solano 2020). This choice is motivated by Table 1, where we find that Swift UVOT has measured the majority of the optical prompt emission detections.
Time resolved or time integrated spectra, in units of counts, are produced by binning photons based on their lab frame energies. These spectra are then fitted with either a Comptonized ("COMP") function 5 (Yu et al. 2016) or a Band function (Band et al. 1993); we fit the energy bins with ≥ 10 photons in order to approximate errors in the bins as being gaussian. Unlike prior studies where the entirety of the spectrum is fit (Parsotan & Lazzati 2018; Parsotan et al. 2018), we fit the spectra that we acquire from 8 keV to 40 MeV which is typically done in observational analysis of GRB spectra (Yu et al. 2016).
The mock observations can also be related to the GRB jet structure as acquired by the SRHD GRB simulation. We do this by relating the time of the mock observation 3 The  code  used  to  conduct  the  mock  observations is also open source and is available at: https://github.com/parsotat/ProcessMCRaT 4 http://svo2.cab.inta-csic.es/theory/fps/ 5 While this function is typically called the Comptonized function in observational studies, the function is better described as a cutoff powerlaw. Comptonization can produce many types of spectra and cutoff power laws can be produced for a number of emission processes.
of interest to the equal arrival time surfaces (EATS) of the SRHD simulated jet. The EATS are acquired by calculating the location that photons would be emitting along a given observers line of sight for the time of interest in the light curve (Parsotan et al. 2020). An important assumption that goes into constructing the mock observations is that the MCRaT photons are decoupled from the fluid in the jet by the end of the MCRaT simulation, which is not always the case (Parsotan & Lazzati 2018;Parsotan et al. 2018Parsotan et al. , 2020. The only effect that this has on the mock observables is that the photons have not fully cooled, meaning that they are more energetic than they should be (Parsotan et al. 2018).

The Simulation Set
The FLASH 2D SRHD simulations set analyzed in this work are identical to the ones used by Parsotan et al. (2020). Here, we briefly summarize these SRHD simulations and the MCRaT simulations that were conducted for this paper.
We ran MCRaT on two SRHD simulations where a jet was launched into a 16TI progenitor star with a density profile given by Woosley & Heger (2006). The first simulation, which we name 16TI , has a domain of 2.5 × 10 13 cm along the direction of the jet. The 16TI simulation jet was injected with a constant luminosity, L inj = 5.33 × 10 50 erg/s, for 100 s at a radius of 1 × 10 9 cm, with an initial lorentz factor of 5, an opening angle of 10 • , and an internal over rest-mass energy ratio, η = 80 (Lazzati et al. 2013). The other simulation, which we denote as 40sp down , has a jet that is injected with similar parameters as the 16TI simulation with the exception of the time that the jet was on and the temporal structure of the jet. In this case, the jet was on for a total of 40 s and the injected jet profile consisted of 40 half second pulses each followed by another half second of quiescence. The luminosity of each active pulse of the jet is decreased by 5% with respect to the initial pulse (López-Cámara et al. 2014). The domain of the 40sp down simulation is a factor of 10 smaller than the domain of the 16TI simulation. After 40 s and 100 s in the 40sp down and 16TI simulations respectively, the jets were turned off and allowed to evolve for a few hundred more seconds.
The MCRaT calculations were conducted for the period of time that the jet was on in each SRHD simulation. We set MCRaT to calculate the magnetic field for CS emission and absorption using the total energy option, in which we set B = 0.5 for all the calculations presented in Section 3. The initial injected spectrum into the MCRaT simulations was set to be a blackbody spectrum. Since the number of photons in the MCRaT simulations can change due to the emission, absorption, and rebinning processes in the code, we report the number of photons that exist at the end of the given MCRaT simulation. The 16TI simulation ended with a total of ∼ 10 7 photons while the 40sp down simulation ended with a total of ∼ 6 × 10 6 photons. The average number of scatterings that photons experienced by the end of each simulation was ∼ 4 × 10 3 for the 16TI simulation and ∼ 2 × 10 5 for the 40sp down simulation, showing that the optical depth of where we started our MCRaT simulation in the SRHD jets are appropriate for a blackbody spectrum (Parsotan et al. 2018). We produced mock observed light curves and mock observed time integrated and time resolved spectra for observers located at a range of θ v , from 1 − 15 • for the 16TI simulation and from 1 − 9 • for the 40sp down simulation.

RESULTS
In this section, we will outline some of the results that we have obtained regarding optical prompt emission from our MCRaT calculations. We will first present MCRaT calculated light curves and spectra and then delve into the origins of the detected photons in the simulated GRB jets.

Bolometric and Optical Light Curves
The bolometric light curves that we calculate from our MCRaT simulations are similar to the light curves acquired in previous works (Parsotan & Lazzati 2018;Parsotan et al. 2018). Here, we show the relationship that we find between the bolometric and optical light curves for the 16TI and 40sp down simulations which we acquire by calculating various time signal properties such as correlation and time lag between each light curve. Figures 2 and 3 show mock observed light curves, with variable time bins, of the 16TI and 40sp down MCRaT simulations, respectively, at various θ v . The top panels show the bolometric light curve in light blue normalized by its peak, L max , the optical light curve in pink, also normalized by its own L max , and the fitted time resolved peak energies in green. In the bottom panels, the time resolved fitted α and β parameters are shown in red and blue respectively; unfilled α, β, and E pk markers represent spectra that are best fit by a Band spectrum while solid markers represent spectra best fit with the COMP spectrum. We find that as θ v increases for the 16TI simulation, the bolometric light curve, which is dominated by gamma rays, begins to peak at later and later times. For small θ v , we find that there can be optical flares after the bolometric light curve has decayed significantly while for large θ v we find that the optical light curves show activity well before the bolometric light curve peaks. In the 40sp down case both the optical and bolometric light curves show erratic behavior due to the variability of the injected jet. In both the 16TI and 40sp down simulations we find that the optical L max decays slowly as a function of θ v , while the bolometric L max decays rapidly, as is shown in Figure  4. Here, we show the normalized L max for the 16TI and 40sp down optical and bolometric light curves where the normalization is the value of each L max at θ v = 1 • . The blue and red colors represent the 16TI and 40sp down L max while the solid and dashed lines represent the bolometric and optical L max .
We can analyze the relationship between the bolometric and optical light curves by looking at how well correlated they are through the spearman rank coefficient, r s , and by calculating the time lag, τ , between the two time signals that maximizes their correlation, which we show in Figures 5(a) and 5(b). The red dashed line in each plot shows the results of the 40sp down simulation, the blue solid line shows the results of the 16TI simulation, and the black dashed-dotted line shows no correlation or time lag. In Figures 5(a), we show the 95% confidence interval for the calculated r s through the shaded red and blue regions for the 40sp down and 16TI simulations respectively. We find that r s for the 40sp down simulation is consistent with 0 for nearly all θ v . For the 16TI simulation, we find a positive correlation between the bolometric and optical light curves until θ v ∼ 5 • . For θ v ∼ 5 • − 10 • we see that the two light curves are negatively correlated and for θ v 10 • the two light curves are marginally correlated. Looking at τ , we find that the 16TI simulation shows an evolution from positive time lags, meaning that the optical L max occurs later in time than the L max of the bolometric light curve, to negative time lags, meaning that the optical L max occurs earlier in time than the bolometric L max (see also the light curves shown in Figure 2). The 40sp down τ are typically positive, showing that the optical L max occurs later in time than the bolometric L max .

Time Resolved and Time Integrated Spectra
In this section, we discuss the results of our mock observed MCRaT spectra. Figures 6 and 7 show time integrated spectra for the 16TI and 40sp down simulations, respectively, for the same θ v shown in Figures 2 and 3. The total spectra, consisting of all the detected photons, are shown as blue circle markers while the CS spectra, consisting of just the scattered CS photons, are represented with red plus markers. The total spectra are fitted with either a Band or COMP spectrum within the  (c) respectively. The top panels show the bolometric and optical light curves in light blue and pink respectively, each normalized by its maximum luminosity. The green points in the top panel are the fitted time resolved spectral peak energies while the bottom panels show the fitted α and β parameters in red and blue respectively. The unfilled markers represent spectra that are best fit with a Band function and solid markers show spectra that are best fit with a COMP spectrum. Star markers represent spectra that are best fit with α < 0.
green shaded region, which represents the photon energies that are typically considered in observational analysis of Fermi GRB spectra. The solid black line denotes the best fit function with its best fit parameters given in the bottom left of the plots and the dashed black line shows the extrapolation of the fit to lower energies. The red shaded region highlights the Swift white filter bandpass, which we use to produce our optical light curves in the previous section. We have also plotted the spectral photon density of the optical prompt emission of GRBs 080319B and 041219A in relation to the MCRaT spectra in Figure 6(c).
In the 16TI simulation, we find that the time integrated spectra are best fit with positive α for θ v ≤ 8 • , while for θ v > 8 • , the portion of the spectra in the Fermi band is best fit with a negative α, reproducing typical observed GRB time integrated spectral α. For the 40sp down simulation, we observe the opposite trend, where for θ v ≤ 5 • the spectra are best fit with a negative α while at larger θ v the fits utilize a positive α and diverge from real observations of GRBs. In both cases we find that below ∼ 0.1 keV the spectra are composed of the CS photons primarily; above this energy, the CS photons do not affect the spectra significantly. The CS photons in both simulations also form a powerlaw of ∼ E −1 between ∼ 10 −3 keV or ∼ 10 −2 keV to ∼ 0.1 keV. Looking at the extrapolated fitted spectra and the intensity of the spectra at optical energies, we find a variety of behaviors from the optical emission lying above or below the extrapolated fits. In particular, time integrated spectra with α < 0 have optical emission that lie far below that of the extrapolated Band function at these energies. Another important result is that the optical region of the MCRaT spectra lie far below what is observed, regardless of the simlation type or spectral fit.  We can also look at the MCRaT time resolved spectral fits and compare them to typical observational GRB spectral fits and their distributions, as is shown in Figure 8. In Figure 8 we plot the distributions of α, β, and E pk , shown in red, blue, and green respectively, alongside distributions from Yu et al. (2016). The purple solid and dashed lines represent the contributions to the histograms from the 40sp down and 16TI simulations respectively. We find that the fitted time resolved α parameters are widely distributed around ∼ 0.5 with a skewed distribution to negative values which is made up of spectra from the 40sp down simulation. The β values are also widely distributed with values that are steeper than what is found by Yu et al. (2016). The MCRaT E pk distribution is skewed towards lower values than those found by Yu et al. (2016), mostly due to the low luminosity points of the 40sp down simulation, where photon energies are much lower than expected (Parsotan et al. 2018). These results differ slightly from prior analysis due to the fact that we fit the spectra from 8 keV to 40 MeV and, as a result, more spectra are best fit with negative α values, showing the importance of taking observational effects into account.

Location of Photons in the Jet
In order to get a deeper understanding of what the mock observations presented in Section 3.1 and 3.2 tell us about what is occurring in the simulated GRB jet, we plot the location of the detected photons in relation to the SRHD jet.   The semi-transparent blue circle markers show all the photons that the observer detects regardless of energy while the semi-transparent red plus markers show the photons with energies in the Swift white band. The size of the markers also denote the weight of each photon; since the weight represents the number of physical photons each MCRaT photon packet represents, this exhibits the contribution that a given photon makes in the calculation of the mock observables presented in Section 3.1 and 3.2. If many photons are located in a given area of the outflow the color density of blue or red photons increases, while photons with larger weights in the outflow are shown by larger markers.
Looking at Figure 9(a) where θ v = 1 • , we see that for an observer located along the jet axis all the photons that would be observed are either located along the jet axis or along the shocked interface of the jet and the cocoon (the jet cocoon interface or JCI; Gottlieb et al. (2021)). Furthermore, when looking at the optical photons, we find that the photons along the JCI have larger weights especially at late times in the light curve (see Figure 2(a)), showing that more optical photons are coming from this region of the jet than from the stream of fluid directly along the observer's line of sight. For an observer located further from the jet axis at θ v = 12 • , as is shown in Figure 9(c), the emission that is detected is entirely from the JCI. At early times, the emission is from the JCI that is near the core of the jet, which is when the bolometric light curve is at a minimum and the optical light curve is at a maximum (see Figure 2(c)). At late times, the detected photons are located along the observers line of sight, corresponding to a minimum in the optical light curve and a maximum in the bolometric light curve.
Figures 9(d) and (f) show the locations of the observed photons in the 40sp down simulation for observers located at θ v = 3 • and 7 • , respectively. In this simulation, we find that photons, regardless of their energy, are being detected by the observer from nearly all regions of the jet. This is expected since the jet is moving with a low Lorentz factor (Parsotan et al. 2018), allowing photons from high latitude regions of the outflow to scatter into the observers line of sight. If we focus on the optical photons, we find that they originate mostly from high latitude regions of the jet, corresponding to the JCI, and where shocks occur in the jet. The emission regions of the optical emission nearly trace out the shocks in the 40sp down simulation, showing the importance of taking these shocks and the JCI into account in radiative transfer calculations.

SUMMARY AND DISCUSSION
We have used the MCRaT simulations in order to analyze two SRHD simulations of GRB jets which we denote the 16TI and 40sp down simulations. The MCRaT code has been improved to include cyclo-synchrotron (CS) emission and absorption which has been tested and verified with other works in the literature. As a result of this improvement, we are now able to make predictions of expected light curves and spectra under the photospheric model of GRBs from optical to gamma ray energies.
Our results can be summarized as follows:  Each photon that is detected is shown with semi-transparent blue circles and the optical photons are shown in semi-transparent red plus markers. As more photons are located in a given region of the outflow, the color density of each type of photon increases. The size of each marker denotes the photon weight, with photons represented by smaller markers having less weight, and thus making a smaller contribution to the calculation of light curves and spectra, and vice versa for photons represented with large markers. Figures (b) and (e) show only the pseudocolor density plot in order to identify features in the outflows that can be related to where the photons are located.
• Jets with a constant injection of energy, such as the 16TI simulation, show a Spearman rank correlation between their optical and bolometric light curves (which is dominated by gamma rays) that changes from being positively correlated until there is a negative correlation between the two time series and after θ v ∼ θ o there is a marginal positive correlation. In the 40sp down simulation, indicative of variable GRB jets, we find that there is no significant correla-tion at almost all θ v and that the optical emission typically lags the gamma ray emission event.
• The 16TI simulation's time lag shows that as θ v increases, there is expected to be optical precursors up to a few tens of seconds before the main gamma ray emission.
• The time integrated fitted Band spectra, in the Fermi energy band from 8 keV -40 MeV, of our simulations can be best fit with negative α parameters. We also get an increased number of time re-solved spectra, particularly in the 40sp down simulation, that are best fit with a negative α.
• The CS photons do not have a large effect on the peak of the spectrum, however CS emission produces optical photons that exhibit a power law of ∼ E −1 below ∼ 0.1 keV.
• In time integrated spectra that are best fit with negative α parameters, the optical emission lies below the extrapolated Band function.
• For the 16TI simulation, we found that an observer located along the jet axis sees photons directly along their line of sight in the jet in addition to emission from the Jet Cocoon Interface (JCI). The detected optical photons, for an observer located along the jet axis, mostly originate from the JCI. For observers located far from the jet axis, the detected photons (optical to gammarays) originate solely from the JCI. In this case, the detected photons follow the surface of the JCI, with photons detected early on originating close to the jet core and photons detected later originating from the JCI that is along the observer's line of sight.
• In the 40sp down simulation, photons are detected from all regions of the jet due to the low Lorentz factors present in the outflow. The optical photons are located at the interfaces of shocks in the outflow and at high latitude regions of the JCI.
In line with our result that CS emission does not change the spectral peak energy of the synthetic spectra, we also found that the location of the 16TI and Our findings have observational consequences for observing the prompt emission. The MCRaT simulations have shown that there can be various correlations between the optical and gamma ray energy light curves depending on θ v and the intrinsic variability of the GRB jet. Traditionally, optical emission has been attributed to the emission mechanism that produces the prompt emission in gamma rays due to temporal correlations between the two signals. We have shown that this is indicative of θ v being close to the GRB jet axis. Furthermore, for GRBs observed far from the jet axis, there is expected to be a negative or no correlation between the optical and gamma ray light curves. The MCRaT results also predict there to be optical prompt precursors occurring for tens of seconds before the main gamma ray emission. Detecting these optical precursors, if they are bright enough, may allow the community to improve followup capabilities and thus be better prepared to measure the prompt and afterglow emission. Another interesting alternative to detecting GRB prompt emission is the possibility of detecting solely the optical prompt emission and not the gamma ray prompt emission. This would be possible at large θ v where the intensity of gamma rays is low enough that current detectors would not trigger. Unlike the gamma ray luminosity declining steeply with θ v (Parsotan et al. 2020), the optical luminosity is a weak function of θ v which means that it is possible that it would be detected without the gamma ray counterpart, possibly resulting in emission similar to what was observed in PTF11agg (Cenko et al. 2013). In these cases, it would be important to consider the effects of the afterglow forward and reverse shocks and understand when the radiation from these processes may begin to wash out the true optical prompt emission, a task that is outside the scope of this paper. Due to our MCRaT optical predictions being due to CS emission and absorption, which is certainly not the only process producing photons with optical energies, the optical luminosities and spectral intensities that we acquire in this paper provide lower limits on the predicted optical prompt emission. We can estimate the detected magnitude of our best case optical prompt emission signature, L max = 1.1 × 10 43 erg/s, by assuming a detection with the Swift white filter for a GRB located at redshift z = 1 with the aforementioned optical prompt luminosity at its maximum. This provides a detected magnitude of ∼ 25 in the Vega system, which is still a few magnitudes dimmer than some of the dimmest detections made (see Table 1). Furthermore, this estimated magnitude is still many magnitudes dimmer than optical prompt detections made for GRBs located at z ∼ 1. Thus, detecting optical prompt precursors and measuring correlations between the optical and gamma-ray prompt emissions under the current unmodified photospheric model would be difficult. These predictions may remain the same or change as the photospheric model is modified and additional radiation mechanisms are added to the model to account for typical optical prompt detections, although this will be the subject of future work.
Our results are not able to fully account for the optical prompt detections that have been made, showing that, at least in those cases, another emission mechanism needs to be invoked to explain the optical bright-ness.. Nonetheless, the MCRaT results are able to reinforce some of the results acquired from analysis of optical prompt emission under the synchrotron model. Namely, we find that the optical prompt emission comes from a different region of the jet than the gamma rays typically originate (particularly for θ v close to the jet axis) which is a similar conclusion that Zou et al. (2009) reached in thier study. Furthermore, Tang & Zhang (2006) find that the optical lag of GRB 041219A is ∼ 1 − 5 s which, under our results, suggests that this GRB was observed at θ v ∼ 2 • regardless of jet model. Finally, analysis of optical prompt emission typically place the emission radius at radii much larger than typical photospheric radii. As we have shown in this work, the photospheric model produces photons in the dense, slow moving JCI for which we can calculate the location of the photospheric radius, R ph , at these high latitude regions. These calculations show that R ph ∼ 10 13 − 10 16 cm which is larger than typical photospheric radii for gamma ray emission and aligns with the findings of Shen & Zhang (2009).
Although the large majority of the mock observed time integrated and time resolved spectra suffer from a lack of low energy photons which contributes to the excess of positive α fits that we acquire, many spectra can be fit with negative α values due to the fact that we impose the observational constraint of fitting the spectra from 8 keV -40 MeV. This shows the importance of taking observational effects into account when comparing theoretical results to observational results, which should become the standard practice in the community. In order to make mock observations more realistic, we would need to also consider the transmission functions for various optical filters as well as the instrument response functions for various gamma ray instruments. Including these effects may change the results of the spectral fits, potentially bringing the theoretical spectra into agreement with observed spectra. Additionally, including these effects will allow the community to determine how well observational analyses are able to recover the ground truth of simulations. These instrumental effects and the ability of observational analysis to recover the ground truth of simulations will be the topics of future papers.
At energies less than 8 keV, the spectra do not reproduce the findings of Oganesyan et al. (2019) who find that the photon index of the spectra of their sample set is −2/3 between the optical and soft X-rays for the synchrotron spectra that they fit to the data and ∼ −1 for their two component model, which is similar to a Band function at low energies. This discrepancy drives the need for another radiation mechanism in MCRaT. Oganesyan et al. (2019) calculated the properties of the emitting region based on the superior fits that their synchrotron spectra provided over the two component model and found values for the comoving magnetic field, the number of emitting electrons, the electron Lorentz factor, the emitting radius, and the bulk Lorentz factor that agreed well with marginally fast cooling synchrotron emission (Daigne et al. 2011). Although these values are in tension with standard values of the prompt emitting region, the inclusion of synchrotron emission in this regime in the MCRaT code may help produce the correct spectra since it has been shown in this work and others (see e.g Deng & Zhang (2014)) that photospheric emission on its own is unable to consistently create spectra with photon indexes of −1. In such a case, we may expect synchrotron emission to form the low energy ( 1 keV) portion of GRB spectra while compton scattering forms the portion of the spectra at high energies, above typical GRB E pk . In the energy region below E pk and above ∼ 1 keV we would then expect both processes to contribute nearly equally to the spectrum, producing spectra with α ∼ −1.
In addition to adding synchrotron physics to MCRaT, we have also shown that we need to properly consider the effects of subphotospheric shocks, either directly in the core of the jet or in the jet cocoon interface (JCI) (Gottlieb et al. 2021), which is mostly where the optical photons originate in the flow. Ito et al. (2018) showed that properly simulating the shock structure and the resultant radiation can produce Band-like spectra. It is possible that these shocks could affect the optical portion of the spectra either by increasing the number of soft photons in the outflow or by upscattering optical photons to higher energies.
Our result of observers detecting optical photons (and gamma ray photons) originating in the JCI shows the need to conduct global radiative transfer simulations which is now possible with MCRaT. Furthermore, the SRHD simulations that are analyzed should be in 3D. Gottlieb et al. (2021) showed that SRHD simulations of GRB jets in 3D are able to properly capture the mixing between the jet core and the cocoon, which is vital to the properties of the JCI. Properly simulating this region and including it in radiative transfer calculations is important for acquiring accurate spectra and light curves at various wavelengths. Furthermore, Parsotan et al. (2018) showed that the photons at high density regions of the jet, which includes optical photons, are not fully decoupled from the outflow due to the relatively small domain of the SRHD simulations. As a result, future simulations that are analyzed with MCRaT should have domains large enough such that the photons can cool appropriately with the outflow (Parsotan et al. 2018).
The improvements of properly simulating subphotospheric shocks, synchrotron emission, and being able to handle 3D SRHD simulations will be added to MCRaT in the future.
The ability to compare the photospheric model to other models in the optical region will prove fruitful in future observations of GRBs, especially as the aforementioned physical processes are added to MCRaT. The addition of polarization observations of optical prompt emission, such as the measurements acquired by Troja et al. (2017), will also play an important role in ruling out potential models that describe GRB prompt emission. We explore this aspect of optical prompt emission in a companion paper (Parsotan & Lazzati 2021).

ACKNOWLEDGMENTS
We thank the anonymous reviewer for detailed suggestions that helped improve the content and clarity of the paper. We would also like to thank Diego López-Cámara for discussions and suggestions that helped improve the paper.
TP and DL acknowledge support by NASA grants 80NSSC18K1729 (Fermi) and NNX17AK42G (ATP), Chandra grant TM9-20002X, and NSF grant AST-1907955. TP acknowledges funding from the Future Investigators in NASA Earth and Space Science and Technology (FINESST) Fellowship, NASA grant 80NSSC19K1610. Resources supporting this work were provided by the NASA High-End Computing (HEC) Program through the NASA Advanced Supercomputing (NAS) Division at Ames Research Center. Additionally, this work used the CoSINe High Performance Computing cluster, which is supported by the College of Science at Oregon State University. The CS emission in MCRaT is discretized into photon packets that are emitted into a given shell of fluid with properties that are taken from a given SRHD simulation. As outlined in Section 2.2, the shell corresponds to the distance traveled by the photons already in the simulation. The number of CS photons emitted in the i th fluid element, with volume dV i , is calculated by integrating the blackbody photon number spectrum up to the cyclotron frequency of that same fluid element, ν B ,i . Thus, we calculate the number of emitted CS photons as where w is the weight of the emitted photon packet, which is the number of physical photons each emitted MCRaT photon packet in the shell represents, k is the Boltzmann constant, h is Planck's constant, c is the speed of light, and the comoving fluid temperature T i = (3p i /a) 1 4 , where p i is the pressure of the fluid element as acquired from the SRHD simulation and a is the radiation density constant. In order to calculate this integral, we need to determine the cyclotron frequency of the fluid element which is calculated as where e is the electron charge, B i is the comoving magnetic field within the cell (see Section A.2), and m e is the electron mass (Rybicki & Lightman 1979). Once n cs,i is calculated, we draw a random number from a Poisson distribution with a mean of n cs,i to acquire the actual number of photons that are emitted into the fluid element. We get the total number of emitted photons in the shell of interest, N e , by summing over the n cs,i of each fluid element. If N e > N e,max , a user defined parameter that limits the number of emitted MCRaT photon packets, then w is made larger and the aforementioned calculations are redone. If N e ≤ N e,max then the code proceeds to assign the CS photons a random 4 momentum in the fluid rest frame, with frequency ν B ,i , and assigns them to be at the center of their respective SRHD fluid element. These CS emitted photons are a pool of photons that can be upscattered as MCRaT determines which photons will be scattered. If one of these "reserve" photons gets chosen to be scattered, it gets replaced by an identical photon in the pool of CS photons that can be scattered. Then, we place the scattering photon randomly within its fluid element and allow it to scatter normally.

A.2. Calculating B i
In order to calculate ν B ,i , we still need to determine the comoving magnetic field strength within the fluid element, B i . MCRaT provides 2 ways to calculate the magnetic field in the SRHD simulation: 1) internal energy of the flow or 2) total energy of the outflow, which the user can set. These are outlined below:

• Internal Energy
In the internal energy case, the comoving magnetic field energy density of the fluid element is equated to the electron thermal kinetic energy of that same element with some ratio between them, B .
where n i is the number density of electrons in the fluid element.

• Total Energy
For a given plasma, the luminosity from matter and radiation can be written as L = 4π(ρc 2 + 4p)Γ 2 cr 2 , where c is the speed of light, ρ is the plasma density, p is the pressure, Γ is the bulk Lorentz factor, and r is the radius of the plasma away from its point of origin. The luminosity due to the magnetic field is L B = 4π(B 2 /8π)Γ 2 cr 2 where B is the magnetic field of the plasma. The fraction of energy between the magnetic outflow luminosity and the total outflow luminosity for a given fluid element, in the comoving frame, can be written as If the user supplies B to MCRaT then the code uses the above formula to solve for the comoving magnetic field in each fluid element.

A.3. Rebinning Scattered CS Photons
The MCRaT code rebins the CS photons in order to keep the number of photons that it needs to track down to a reasonable amount, which helps decrease computational time. In order to rebin the photons, MCRaT finds the photon with the smallest position in the polar direction, θ min , and the photon with the largest position in the polar direction, θ max . The size of each spatial bin, ∆θ, is set by the user. The number of spatial bins, N θ , is then is determined by The photons are also binned into energy bins, where the size of the energy bins, ∆E is determined as where E max and E min are the minimum and maximum energies of the CS photons and N E is the number of energy bins as specified by the user. The number of rebinned photons is then ≤ N θ N E since some energy and spatial bins may not contain any photons. When rebinning the photons in polar angle and energy, the following values of photons that fall within a given energy and θ bin are averaged and then assigned to a new rebinned photon (the quantities for this rebinned photon are represented with a tilde). For a given energy bin, α, and θ bin, β, the new rebinned photon would have the following four momentump where E is the energy of the photon, θ and φ are the directional angles of the 4 momentum and the < · · · > denote weighted averages of the various quantities over the photons that fall within bin (α, β). The stokes parameters for the rebinned photon becomess α,β = (1, < q >, < u >, < v >). The new rebinned photon weight,w α,β , is calculated by summing over the photons' weights that fall within bin (α, β) and the position vector of the rebinned photon becomes where < r > is the average radius of the photons that lie in bin (α, β), < θ p > is the average polar angle of the photons with the given bins and, for these same photons, < ∆φ p > is the average displacement angle taken across each photon's 4-momentum azimuthal angle, φ, and its positional azimuthal angle, φ p , that is ∆φ p = φ − φ p . This consideration of the displacement in the positional and 4-momentum azimuthal angles is necessary to ensure that the rebinned photons are still in appropriate equilibrium with the flow and do not get erroneously upscattered. This binning algorithm is initiated when the number of scattered CS pool photons in the MCRaT simulation exceeds some defined critical number of photons that is set by the user.

A.3.1. Absorption of CS Photons
When the time in the MCRaT simulation gets to be the time of the next frame in the SRHD simulation, MCRaT proceeds to absorb any photons that have a frequency ν ≤ ν B,i of the i th fluid element that they are located within. As a result, all of the CS photons that were emitted and never upscattered become absorbed and any photons that have been scattered but still satisfy ν ≤ ν B,i are also absorbed.
After MCRaT completes the absorption process, it loads the next SRHD simulation frame and re-emits the pool of CS photons based on where the remaining un-absorbed photons are located and the new fluid properties taken from the newly loaded SRHD simulation frame.

A.4. Verifying the CS Process
We test our implementation of CS emission and absorption in MCRaT by conducting test simulations of radiation from a spherical outflow. As outlined in Lazzati (2016), we over write the values from a SRHD simulation (in memory) with those corresponding to a spherical outflow. We inject photons drawn from a blackbody distribution at a radius corresponding to a large optical depth (∼ 10 4 ) and allow these photons to scatter and propagate through the spherical outflow, as the outflow itself moves. Simultaneously, the process of emitting and absorbing CS photons is occurring.
In the first test, shown in Figure A1, we look at the differences between the two methods of calculating the magnetic field. The circle markers show the entire spectrum consisting of the thermal photons injected as the initial condition of the MCRaT simulation and the CS photons that accumulate within the flow. The plus markers show the spectrum of just the CS photons. The red points are the results of the MCRaT spherical outflow simulation where the magnetic field was calculated from the internal energy, with B = 1, while the blue points are the results from the magnetic field being calculated from the total energy of the outflow, where we set B = 0.5. Both spectra contain ∼ 9 × 10 4 photons that were simulated in MCRaT. We find that the spectra consisting of solely CS photons, the plus markers, reproduces the spectrum of soft photons undergoing saturated comptonization (Rybicki & Lightman 1979). The low energy tail has a slope of E 2 that evolves into a modified blackbody and then a Wien spectrum at high energies 6 , which was also acquired by Vurm et al. (2013) in their Figure 6. This outcome makes sense since these CS photons undergo ∼ 10 4 scatterings on average, which is an indication of the optical depth in the outflow (Parsotan et al. 2018). In addition to these features, we find that the initial thermal injection of photons between the test simulations stay consistent, forming a high energy Wein spectrum. The CS photon portion of the spectrum, which is produced by the internal energy method of calculating the magnetic field, lies far below the portion of the spectra formed from the thermally injected photons, as shown by the red Wien peak. In the blue spectrum, the CS produced portion of the spectrum lies slightly below the Wien portion of the spectrum. This feature shows that the total energy method of calculating the magnetic field produces more low energy photons than the internal energy method, albeit, it does not affect the Wien portion of the spectrum.
In our second test we use the total energy method of calculating the magnetic field and investigate the effect that changing B and the optical depth in which the simulation is started have on the resultant spectrum. Figure A2 shows the spectra for the three simulations that we ran: 1) B = 0.5 and the simulation was started deep in the outflow where the optical depth (and thus the average number of scattering, < N >) ∼ 10 3 , which is shown in red, 2) B = 0.95 and < N >∼ 10 4 , shown in yellow, and 3) B = 0.95 and < N >∼ 4 × 10 4 , shown in green. The circle markers represent the spectra constructed from the thermal injected photons and the CS photons and the plus markers represent the spectra of just the CS photons. In general, we find that as the optical depth increases, the CS photons begin to form a saturated comptonization spectrum, with the Wien peak forming between < N >∼ 10 3 − 10 4 . Although the optical depth affected the formation of the Wien peak, the low energy portion of the spectra stayed relatively constant. Additionally, the low energy portion of the spectra ( 10 keV) did not change as the value of B changed. The fact that B does not have a large effect on the spectrum can be seen in Equation A4 where B ∝ √ B , thus an increase in B by a factor of 0.95/0.5 = 1.9 gives a change in the calculated magnetic field of √ 1.9 = 1.37 which does very little to change the cyclotron frequency and the number of CS photons emitted into the MCRaT simulation.   Figure A2. Spectra for 3 different test MCRaT simulations where the simulation was started at different optical depths in the outflow and each simulation used various values of B (using the total energy method of calculating the magnetic field). The red points are the spectra from the simulations where the average number of scatterings that photons underwent, < N >, was ∼ 10 3 and B = 0.5, the yellow points are from the simulation where < N >∼ 10 4 and B = 0.95, and the green points are from the simulation where < N >∼ 4 × 10 4 and B = 0.95. Above ∼ 10 1 keV the increase in < N > affects the formation of the Wien peak, while below 10 keV there is not much change in the spectrum. Overall, the change in B has no drastic effect on the resultant spectrum due to the weak dependence of the magnetic field on this parameter.