You are an expert at summarizing long articles. Proceed to summarize the following text: 
observations of lyman-@xmath2  ( ly@xmath2 ) sources are a powerful probe of the high - redshift universe ( e.g. * ? ? ? * ; * ? ? ? * ; * ? ? ? * ; * ? ? ? in particular , the prominence of the ly@xmath2 line at @xmath8 allows for spectroscopic confirmation of redshift measurements of individual distant galaxies . ly@xmath2 sources are also a compelling probe of the cosmic dark ages leading up to reionization see @xcite for a perspective on high-@xmath6 observations . historically , @xcite determined that galaxies from the first billion years after the big bang would be powerful emitters of ly@xmath2 photons , though observations of these sources eluded us for longer than expected . however , robust detections are becoming more regular , especially if the stellar mass is comparable to the milky way or the star formation rate  ( sfr ) is elevated ( e.g. sfr  @xmath9 ; * ? ? ? * ) .    within the earliest galaxies hard uv radiation from massive stars is reprocessed into ly@xmath2 photons ; however , because neutral hydrogen  ( hi ) is opaque to the ly@xmath2 line , many of these photons may be resonantly trapped , and consequently suffer significant dust absorption . despite these effects , observations have determined that the ly@xmath2 escape fraction ,  @xmath10 , actually increases at higher redshifts  @xcite . at some point , although the photons are no longer destroyed by dust , they are scattered out of the line of sight and some fraction of the ly@xmath2 emission is lost to the background as their sources become spatially extended ly@xmath2 haloes @xcite . various mechanisms have been explored to explain the unusually high @xmath10 of high-@xmath6 galaxies . in all likelihood this is a result of the complicated resonant line transfer , galactic structure , and peculiar dust properties . for example , multiple scatterings that facilitate excursions to the wings of the frequency profile ; large - scale flows that induce doppler shifts ; and the geometry of dense , dusty clouds within a clumpy interstellar medium that provide pathways for escape  ( e.g. * ? ? ? * ; * ? ? ? * ; * ? ? ? * ) . in this work , we push these questions to the very first galaxies  ( for a review see * ? ? ? assessing the observability of such early ly@xmath2 sources is nontrivial . indeed , going to higher redshifts introduces physical effects that compete in either strengthening or attenuating the ly@xmath2 signal  @xcite . on one hand , the intergalactic medium  ( igm ) becomes increasingly neutral at higher @xmath6 , resulting in a more difficult escape for ly@xmath2 photons @xcite . on the other hand , the same igm also becomes increasingly devoid of dust @xcite . furthermore , population  iii ( so - called pop  iii ) stellar sources are predicted to have been more efficient ionizers , boosting the ly@xmath2 luminosity @xcite . the fact remains that high - redshift ly@xmath2 sources are being observed out to @xmath11 . still , many details regarding the epoch of reionization  ( eor ) , or the inhomogeneous phase transition around @xmath12 , are uncertain and may greatly affect interpretations of ly@xmath2 transfer through the igm @xcite . some of the most effective methods for identifying high - redshift objects involve the ly@xmath2 line . in particular , lyman - break galaxies  ( lbgs ) are generally massive galaxies for which neutral hydrogen produces a sharp drop in the spectra due to absorption @xcite . lyman-@xmath2 emitters  ( laes ) are young , less - massive galaxies with active star formation and strong ly@xmath2 emission @xcite . it is an important frontier to push ly@xmath2 selection methods towards the highest possible redshifts . for galaxies at @xmath13 the neutral fraction of the intervening igm increases enough for their spectra to yield complete absorption of photons blueward of the ly@xmath2 line . this is the well - known `` gunn - peterson trough '' @xcite which is characteristic of lbgs . however , these massive , evolved galaxies become increasingly rare at high redshifts . the lae luminosity function also declines as redshift increases , and the observed trend is robustly established for @xmath14 ( e.g. * ? ? ? * ; * ? ? ? * ) and expected to continue beyond @xmath15 @xcite . because a strong detection of the highly - redshifted ly@xmath2 line requires the emitter to be young and relatively dust free  conditions which are naturally expected for the first galaxies  laes are likely their typical manifestation . high - redshift ly@xmath2 candidates must be followed up by spectroscopy in order to guard against false positives from foreground contaminants . fortunately , moderate- to high-@xmath6 surveys are underway that will dramatically increase the sample size of ly@xmath2 galaxies and better characterize their statistical properties . for example , the hobby - eberly telescope dark energy experiment ( hetdex ) is a large integral - field spectroscopic survey expected to detect a million laes @xcite . currently , there are several candidates at @xmath16  ( e.g. * ? ? ? * ) , with the highest spectroscopically - confirmed source announced at @xmath17 by @xcite . other records have been found using gamma - ray bursts  ( grbs ) , active galactic nuclei  ( agn ) , or ( sub-)mm observations of redshifted thermal dust emission @xcite . however , it is unclear how these other selection methods relate to ly@xmath2 predictions . such connections may complement ly@xmath2 observations , even if the phenomena originate from the luminous deaths of individual massive stars ( i.e. grbs ) or are not associated with a ` normal ' activity of the first galaxies ( e.g. agn or high amounts of dust ) . ly@xmath2 radiative transfer within the first galaxies is a timely problem because next - generation facilities will provide high resolution data by the end of the decade . the _ james webb space telescope _  ( _ jwst _ ; * ? ? ? * ) and large - aperture ground - based observatories ) , thirty meter telescope  ( tmt ; http://www.tmt.org/[www.tmt.org ] ) , and the european extremely large telescope  ( e - elt ; http://www.eso.org/sci/facilities/eelt/[www.eso.org/sci/facilities/eelt ] ) . ] offer the prime avenue for observing ly@xmath2 emission at the high-@xmath6 frontier and will significantly contribute to our understanding of the ionization history at the end of the dark ages @xcite . however , significant progress has also been made on a number of complementary probes of the high-@xmath6 universe . several 21-cm array experiments ) , the murchison wide - field array ( mwa ; http://www.mwatelescope.org/[www.mwatelescope.org ] ) , the precision array to probe the epoch of reionization ( paper ; http://eor.berkeley.edu/[eor.berkeley.edu ] ) , and ultimately the square kilometer array ( ska ; http://www.skatelescope.org/[www.skatelescope.org ] ) . ] are coming online to map the distribution of hi  over the course of reionization . the ly@xmath2 and 21-cm lines are related through the wouthuysen - field mechanism for which ly@xmath2 scatterings pump electrons into the excited hyperfine state , thereby coupling the spin and kinetic temperatures  @xcite . finally , an ideal complementary ly@xmath2 probe is encoded in the cosmic infrared background  ( cib ) because the integrated radiation from all background stars and galaxies has been redshifted to ir wavelengths @xcite . the ly@xmath2 contribution is seen through the correlation of sources across characteristic length scales ( for a review see * ? ? ? a number of authors have studied ly@xmath2 radiative transfer within different contexts . we have greatly benefited from and hope to add to the body of work in this area . a partial list of references include : @xcite . the state of the art is to apply post - processing radiative transfer to realistic hydrodynamical simulations , which is justified for many large scale systems . we use this method in conjunction with semi - analytic models to ascertain the feedback of ly@xmath2 radiation on the galactic assembly process . our focus on the very first galaxies , in their proper cosmological context , is different from previous research that has targeted more massive systems at redshifts close to , or after , reionization ( e.g. * ? ? ? such systems require a statistical description of ly@xmath2 transmission through the igm as described by @xcite and @xcite . photons that scatter out of the line of sight due to the neutral fraction of the igm are effectively lost to the background . therefore , the observability of ly@xmath2 emitters will provide independent constraints on reionization @xcite . measurements of the ly@xmath2 flux from first galaxies depend heavily on the observed line of sight in addition to the properties of the host system and igm . therefore , rather than solving a potentially intractable transfer equation with complex angular dependence we take advantage of monte - carlo radiative transfer techniques to accurately build emergent spectral energy distributions  ( seds ) . in order to perform ly@xmath2 simulations we have developed a new massively parallel code called @xmath4  the @xmath0smic @xmath1yman-@xmath2 @xmath3ransfer code . in section  [ subsec : rs ] , the basic physics of ly@xmath2 transport is presented . in section  [ sec : methodology ] , we discuss the general methodology behind @xmath4 and provide further algorithmic details in section  [ sec : schemes ] . in section  [ sec : tests ] , the code is tested against both static and dynamic setups . in section  [ sec : toy ] , we construct idealized analytical models to explore how fundamental parameters , including halo mass , virialization redshift , bulk velocity , and ionization structure , affect ly@xmath2 transport in the first galaxies . these well - motivated models help test our methods and sensitivity . section  [ sec : sim ] describes our implementation of the _ ab initio _ cosmological simulation of @xcite as post - processing conditions for @xmath4 . in section  [ sec : results ] we analyze and discuss the emergent line of sight flux distributions and surface brightness profiles for both the idealized analytic cases and the cosmological simulation . finally , in section  [ sec : conc ] we reflect on the implications of this study with regard to future ly@xmath2 observations with the _ jwst_. photons with frequencies close to the ly@xmath2 resonance line , corresponding to the transition from the first excited state  ( 2p ) to the ground state  ( 1s ) , may be absorbed and quickly re - emitted by neutral hydrogen . thus , in optically thick environments ( @xmath19 ) the main mechanism of spatial diffusion is by the rare excursion to the lorentz wing of the spectral line . the cross section  @xmath20 and number density @xmath21 describe the optical depth  @xmath22 along a photon s path : @xmath23 where @xmath24 specifies the frequency dependence . it is often convenient to express frequency in a dimensionless manner as the number of doppler widths from line centre @xmath25 where @xmath26  hz is the frequency of ly@xmath2 and the thermal doppler width of the profile is @xmath27 . the thermal velocity in terms of @xmath28 is @xmath29 furthermore , if the natural ly@xmath2 line width is @xmath30  hz then the ` damping parameter ' represents the relative broadening of the natural line width : @xmath31 therefore , the final cross section is @xmath32 where @xmath33 is the oscillator strength of the ly@xmath2 transition and the hjerting - voigt function  @xmath34 is the dimensionless convolution of lorentzian and maxwellian distributions , @xmath35 for reference , we define the cross section at line centre as @xmath36  @xmath37 . for a region of constant density  @xmath21  such as a cell in a computational domain  the integral in equation  ( [ eq : tau ] ) simplifies to @xmath38    typically , the parameter  @xmath39 is much less than unity so the hjerting - voigt function is dominated in the centre by a resonant scattering doppler core , @xmath40 , and the wings are dominated by the lorentzian component , @xmath41 . if the approximate frequency marking the crossover from core to wing is denoted by @xmath42 , i.e. where @xmath43 , then the hjerting - voigt function is roughly @xmath44 see sections  [ subsub : h_approx ]  and  [ subsub : x_cw_approx ] for a more rigorous discussion as well as numerical approximations for @xmath34 and @xmath42 . for most conditions with significant neutral hydrogen density the gas is optically thick to core photons . however , in the wing , @xmath34 can be quite small allowing a photon to escape with greater ease . the approximate optical depth for a wing photon is then @xmath45 which is independent of temperature as is immediately apparent when written in terms of the doppler velocity @xmath46 . note the relation between doppler frequency and velocity : @xmath47 . regions of high column density , @xmath48  pc  @xmath49  @xmath50 , may produce very high opacities . the trapped ly@xmath2 photons are therefore exposed to greater extinction from dust . this may be best measured by the optical depth at line centre , which has moderate temperature dependence and can be read from equation  ( [ eq : tauh ] ) as @xmath51~t_4^{-1/2}$ ] . the @xmath4 code is based on previous monte - carlo radiative transfer ( mcrt ) algorithms ( see e.g. * ? ? ? * ; * ? ? ? * ; * ? ? ? * ; * ? ? ? * ; * ? ? ? the code reads initial conditions of velocity , density , and temperature for each cell of a three - dimensional grid employing adaptive mesh refinement  ( amr ) . sampling the ly@xmath2 emission profile of high opacity systems is possible because acceleration schemes avoid unnecessary computations , e.g. frequent core scatterings . additionally , @xmath4 is massively parallel allowing a greater number of photon packets and therefore less statistical error . section  [ sec : methodology ] outlines the general methodology for a ly@xmath2 transport code while section  [ sec : schemes ] describes the specific implementations used in @xmath4 . while the monte - carlo method for ly@xmath2 radiative transfer is fairly standard , each portion of section  [ sec : schemes ] contains significant discussion or numerical schemes unique to this work .      in order to sample ly@xmath2 observables we apply the method described below to individual photon packets . depending on the desired resolution and physical setup a large number of packets may be necessary to obtain statistical convergence . unless otherwise specified the number of photon packets in each simulation is @xmath52 . the initial spatial distribution of ly@xmath2 photons is based on the physical setup , i.e. initial conditions . the first mechanism for producing ly@xmath2 line emission is interstellar recombination as a result of ionizing radiation from hot stars . the second mechanism is collisional excitation of neutral hydrogen , usually resulting from shocks caused by accretion or supernovae . an initialization criterion accounts for photoionizing sources and diffuse emission , both of which may be significant for atomic cooling haloes . however , throughout this work we choose to initialize photons from the central location @xmath53 . the initial direction  @xmath54 of each photon is drawn from an isotropic distribution in the rest frame of the embedded source . for convenience , velocities are expressed in terms of the thermal velocity : @xmath55 the photon is emitted at the natural frequency of the ly@xmath2 photon  @xmath56 in the rest frame of the atom . to obtain the initial frequency  @xmath57 in the moving frame of ambient gas we apply a doppler shift appropriate to the velocity of the atom  @xmath58 @xcite @xmath59 to be explicit , @xmath56 is drawn from a lorentzian distribution and the components of @xmath60 are each taken from a maxwellian distribution describing the thermal motion of the ambient gas . although we use the expression in equation  ( [ eq : init_freq ] ) , the memory of @xmath57 is quickly lost by multiple scattering events , so for optically thick environments one may simply inject the photon at line centre , or @xmath61 . the propagation distance of any photon is determined by the optical depth  @xmath22 drawn from an exponential distribution . this is because the mean optical depth @xmath62 defines the mean free path  @xmath63 , or the average distance a photon can travel without being absorbed ( or scattered ) by the intervening medium  @xcite . therefore , travel beyond each mean free path becomes less and less probable . formally , the mean free path is then @xmath64 .    from equation  ( [ eq : tau ] ) the respective optical depths of infinitesimal paths are @xmath65 so the probability of _ no _ interaction is @xmath66 . with @xmath67 partitions of @xmath68 , the numerical representation of discrete intervals , the probability distribution function over the total path is the product @xmath69 which has been normalized so that @xmath70 . the cumulative distribution function is the integrated distribution defined by @xmath71 , which can be inverted to give the optical depth at which an interaction event occurs , @xmath72 where @xmath73 is drawn from a univariate distribution .    to perform cartesian - like ray tracing , the monte - carlo method selects a photon with an optical depth  @xmath74 according to equation  ( [ eq : lnr ] ) . because individual cells are regions of uniform density we may equate this with the calculated optical depth  @xmath75 from equation  ( [ eq : tauh ] ) to find the propagation distance , i.e. @xmath76 provides @xmath77 . however , this often leads to a scattering which is outside the original cell . therefore , we first calculate the optical depth required to travel through the cell : @xmath78 , where @xmath79 is the distance from the current position to the point where the photon exits the cell . if @xmath80 the ` spent ' optical depth is subtracted from the current optical depth , i.e. @xmath81 . likewise , the current position is updated to @xmath82 and ray tracing continues through the next cell . as photons traverse from cell to cell the temperature  @xmath83 and ambient bulk velocity  @xmath84 may change . therefore , doppler shifting induces terms of @xmath85 corresponding to a nonrelativistic lorentz transformation , i.e. one where @xmath86 . additionally , the frequency differs between cells due to the @xmath87 scaling relation . the frequency in the new ( primed ) cell is then @xmath88    if @xmath89 the optical depth is ` exhausted ' in the current cell and the photon undergoes a scattering event . the propagation distance is recalculated according to the remaining optical depth , i.e. @xmath90 $ ] . the position is advanced by @xmath91 in the @xmath54 direction and the algorithm proceeds to update the frequency and direction as described in section  [ sec : scatter ] . the photon ray traces along a new direction with each subsequent scattering until it ultimately escapes the computational domain . a scattering event changes the photon s frequency according to the atom s velocity  @xmath60 , the final  @xmath92 and initial  @xmath54 directions , and a small recoil effect to satisfy conservation of momentum @xmath93 the recoil parameter  @xmath94 is defined as ( see e.g. * ? ? ? * ) @xmath95 which is included but negligible for the applications of this paper . the velocity of the scattering atom is most conveniently expressed in terms of its parallel  @xmath96 and perpendicular  @xmath97 components . the perpendicular magnitudes are unbiased by the photon s frequency and are therefore drawn from a gaussian , i.e. @xmath98 . however , the magnitude of the parallel velocity @xmath99 is affected by the presence of the resonance line . the distribution function for @xmath100 depends on frequency as the convolution of a gaussian with a doppler - shifted lorentzian peak : @xmath101 which highly favors velocities with @xmath102 for core photons . for wing photons ( @xmath103 ) , however , the probability that an atom has a high enough velocity to doppler shift into resonance becomes vanishingly small , so @xmath104 becomes increasingly gaussian . the angle  @xmath105 between the incident and outgoing scattering directions is governed by the phase ( probability ) function @xmath106 where @xmath107 is the degree of polarization for @xmath108 scattering . due to the physical symmetry the phase function is independent of the azimuthal angle @xmath109 . for core photons with @xmath110 the electron transition to the @xmath111 state results in isotropic scattering , i.e. @xmath112 , while the @xmath113 transition results in polarization with @xmath114 @xcite . since a quantum state with angular momentum  @xmath115 has a spin multiplicity of @xmath116 , ly@xmath2 photons in the core are excited to the @xmath111 state with @xmath117 probability and the @xmath113 state with @xmath118 probability . nonresonant wing photons on the other hand are dominated by rayleigh scattering because their wavelength is much larger than the bohr radius , @xmath119 , therefore the resultant polarization is maximal , i.e. @xmath120 @xcite . anisotropic scattering is used throughout @xmath4 . the previous section was written with little regard to computational efficiency , something we now seek to remedy . the details are presented in order of introduction , rather than importance .     and our approximation for different values of temperature . the crossover from core to wing  @xmath42 as given by equ . ( [ eq : xcw ] ) is also shown . bottom panel : a demonstration of the relative per cent error @xmath121 $ ] where @xmath122 is given by equ . ( [ eq : ab ] ) . the yellow , blue , green , and red curves correspond to temperatures of @xmath123  k , @xmath124  k , @xmath125  k and @xmath126  k , respectively . the overlying dashed lines represent the best case scenario when only keeping first order terms in @xmath39 , i.e. using the exact dawson integral.,title="fig : " ]   and our approximation for different values of temperature . the crossover from core to wing  @xmath42 as given by equ . ( [ eq : xcw ] ) is also shown . bottom panel : a demonstration of the relative per cent error @xmath121 $ ] where @xmath122 is given by equ . ( [ eq : ab ] ) . the yellow , blue , green , and red curves correspond to temperatures of @xmath123  k , @xmath124  k , @xmath125  k and @xmath126  k , respectively . the overlying dashed lines represent the best case scenario when only keeping first order terms in @xmath39 , i.e. using the exact dawson integral.,title="fig : " ]      an approximation for the voigt profile is important because @xmath34 is evaluated after every scattering . a substantial effort has gone into studying this profile and implementing efficient algorithms with double precision accuracy see e.g. @xcite and references therein . however , the ly@xmath2 resonance line is a unique application with a specific parameter range , so the approximations used in this work are entirely our own . we require our algorithm to provide better than one per cent accuracy for all frequencies and all realistic temperatures . to do this we first evaluate the integral @xmath34 with special functions and expand to second order in @xmath39 : @xmath127 where the ( complex ) complementary error function is related to the area under a gaussian by @xmath128 and the associated dawson integral is @xmath129 . @xmath4 takes advantage of the fact that @xmath34 is symmetric by first evaluating @xmath130 . then because the behavior of the profile differs for small and large @xmath6 the domain is decomposed into three regions . the ` core ' region is derived by expanding around @xmath131 , while the ` wing ' region is an asymptotic expansion . an intermediate region acts as a smooth transition between the two . the approximations utilize continued fractions in order to maximize the efficiency of a small number of operations , e.g. @xmath132 additions and @xmath133 divisions . see appendix  [ appendix : h_approx ] for the implementation of @xmath134 . second and higher order terms in @xmath39 are required to achieve one per cent accuracy for sub - kelvin temperatures . however , since the cmb temperature floor prevents gas from reaching such low temperatures only first order terms are used in @xmath4 . figure  [ fig : herror ] demonstrates the relative error , i.e. @xmath121 $ ] , for temperatures ranging from @xmath135  k. as can be seen , the error is well controlled , improving even further for higher temperatures . $ ] , is shown in green . the yellow curve in the insert is @xmath136 as given by equation  ( [ eq : xcw ] ) . all curves cover a temperature range of @xmath137 $ ]  k. ]    the crossover from core to wing  @xmath42 determines when @xmath34 changes from a gaussian to a lorentzian . this is important because @xmath42 marks the point where difficulties arise in generating @xmath100 and also identify whether core skipping is necessary ( see sections [ sec : upar ]  and  [ sec : coreskip ] ) . our calculation assumes that the core and wing limits of @xmath34 compete in their contribution to the profile : @xmath138 equation  ( [ eq : xcwa ] ) provides a conservative approximation for @xmath42 , providing a sharp boundary with the core  ( see fig . [ fig : herror ] ) . the exact solution can be written in terms of the lower branch of the lambert  @xmath139 function , which in turn may be approximated by a low - order rational function with a relative accuracy of less than @xmath140 per cent for the same parameter range as @xmath122 . in summary , our optimal calculation of the core - to - wing crossover frequency is @xmath141 where @xmath142 and @xmath143 $ ] . the relative per cent error is shown in fig . [ fig : xcwerror ] . as described in section  [ sec : scatter ] ( cf . equation  [ eq : uparf ] ) the distribution for the parallel velocity @xmath100 with respect to the incoming photon is @xmath144 to good approximation this profile resembles a gaussian with a sharp peak around the point @xmath102 ( see fig . [ fig : upar ] ) .    unfortunately , @xmath104 is not integrable so we instead use the inverted cumulative distribution function method on a related distribution and employ the rejection method to accept each draw . in this case the comparison function is chosen to be @xmath145 and draws are accepted with a probability of @xmath146 . however , we only employ this algorithm for small frequencies , i.e. @xmath147 , because as @xmath148 increases the method becomes quite inefficient . we learn more about @xmath104 by examining its behavior when @xmath149 . here the peak at @xmath102 is pushed so far into the wing that there are essentially no atoms with speeds fast enough to absorb at the doppler shifted resonance line , i.e. @xmath150 . therefore , we may simply draw from a proper gaussian with a slight modification  the peak is shifted by @xmath151 . we demonstrate this by finding the local extrema in the core : @xmath152 here we have assumed @xmath153 . it is straightforward to show @xmath154 so this is a local maximum as expected . therefore , for @xmath155 we draw from a gaussian with mean @xmath151 . as given by equ . ( [ eq : uparf ] ) for different values of incoming frequency  @xmath148 . the profile resembles a gaussian with a sharp peak around the point @xmath102 . for large @xmath148 it becomes too improbable for atoms to have velocities high enough to doppler shift into resonance so the peak at @xmath102 disappears and a shifted gaussian is a good approximation . the frequencies sampled are @xmath156 . ] the intermediate region is problematic for either of these methods . therefore , we follow @xcite and use the piecewise comparison function : @xmath157 & \ ; u_\| \leq u_0 \\ g_2 = e^{-u_0 ^ 2 } / \left [ a^2 + ( x - u_\|)^2 \right ] & \ ; u_\| > u_0            \end{cases}\ ] ] where @xmath158 is a separation parameter and the corresponding acceptance fraction is @xmath159 for @xmath160 and @xmath161 for @xmath162 . we now restrict the discussion to positive @xmath148 , which is possible because @xmath163 allows us to recover velocities drawn from negative @xmath148 . the probability that a velocity is less than @xmath158 is @xmath164 where @xmath165 if @xmath166 , a univariate , then @xmath105 is drawn uniformly from the interval @xmath167 $ ] , otherwise @xmath168 $ ] . finally , a velocity candidate , @xmath169 is accepted if another univariate , @xmath170 , is less than the acceptance fraction , i.e. @xmath159 or @xmath161 for each respective region .    the algorithm from @xcite works well as long as the probability of the two regions are balanced , i.e. in @xmath4 we attempt to maintain @xmath171 . the reason for this is that @xmath158 controls the acceptance fraction , so if @xmath158 is too small then we do not gain much for larger @xmath148 and conversely if @xmath158 is too large then we defeat the purpose for smaller @xmath148 . the exact value of @xmath172 is very sensitive to both @xmath148 and @xmath39 , so we can only hope for average acceptance rates to be reasonable given the variance in @xmath173 . if we assume @xmath174 then to first order in @xmath39 we have : @xmath175 the behavior of this function is different for core and wing photons . in the core it is reasonable to assume a perturbation from the natural peak location and apply the transformation @xmath176 where @xmath177 admits an analytic solution to the approximate balance of @xmath171 . again , to first order in @xmath39 equation  ( [ eq : papprox ] ) becomes @xmath178 the solution in terms of @xmath179 is @xmath180 where the final equality allows the approximation to extend to larger @xmath148 and is used in @xmath4 for @xmath181 .    for the region in which the wing dominates , i.e. @xmath182 , the algorithm suffers an identity crisis . as discussed earlier , the high-@xmath148 behavior of @xmath183 approaches a gaussian distribution though each of the candidate @xmath100 samples are from a lorentzian distribution . therefore , the exact value of @xmath158 is less important as long as it is greater than @xmath42 . we test various prescriptions for @xmath184 , also varying initial frequency  @xmath148 and temperature  @xmath83 , in order to minimize the average number of draws in a simulation . a linear function , matched to the previous region provides sufficient acceptance of candidate random numbers . we use the following separation constant for @xmath185 , denoted the ` wing ' region : @xmath186 figure  [ fig : u0p ] demonstrates the fractional probability  @xmath187 for drawing @xmath188 given our piecewise prescription of @xmath189 for @xmath181 and @xmath190 for @xmath191 . the efficiency of the algorithm is especially sensitive to frequency . that @xmath188 . this separation captures the behavior of @xmath94 for frequencies above and below the transitional frequency  @xmath42 . the axes are frequency  @xmath192 and ( log@xmath193 ) temperature  @xmath194  k. ]      in optically thick regimes photons spend much of their time undergoing core scatterings with negligible diffusion in physical or frequency space . these scatterings can be avoided by only selecting atoms with perpendicular velocity components greater than a critical frequency , i.e. photons have zero mean free path if @xmath195 . following @xcite we employ the box - muller method to generate two independent draws according to : @xmath196 where @xmath197 and @xmath198 are univariates . the speedup time achieved here is significant since the probability of drawing a wing photon is roughly @xmath199 corresponding to skipping roughly @xmath200 core scatterings .    the crucial problem is to find an appropriate value for the critical frequency  @xmath201 . @xmath4 introduces an algorithm with core - skipping based on both local and nonlocal criteria . this is especially important for high resolution , adaptively structured grids where the range of densities may cover several orders of magnitude . we desire a local determination of @xmath201 that accelerates the code but does not artificially push photons too far into the wings . as noted by @xcite the important parameter is the product  @xmath202 so we seek a relation of the form @xmath203 . the model we consider for the near zone environment is that of an optically thick static uniform sphere . this is motivated by the idealized geometry and an analytic solution for the angular averaged intensity  @xmath204 at the surface first given by @xcite , @xmath205 which has been normalized to @xmath206 , reflecting an integration over solid angle . the peaks are located at @xmath207 , which is derived by solving the equation @xmath208 , or equivalently @xmath209 with @xmath210 . therefore , the peak heights correspond to @xmath211 . we next expand equation  ( [ eq : sphere ] ) around @xmath212 and define @xmath201 for large @xmath202 as the frequency where @xmath213 reaches a small fraction of @xmath214 , giving @xmath215 . thorough tests demonstrate this expression for @xmath201 is valid for all @xmath216 ( see appendix  [ appendix : x_crit ] ) . furthermore , it has a negligible effect on the emergent spectrum but greatly reduces the computation time . in summary , @xmath4 uses the following approximation : @xmath217 if the photon is already in the wing we do not use a cutoff because there are no core scatterings to skip . the final ingredient in equation  ( [ eq : xcrit ] ) to be explained is how to calculate the product @xmath202 . @xmath4 employs a combination of local and nonlocal estimates of how aggressive to be with core - skipping . as we can not possibly predetermine the escape path of a given photon we instead place a conservative limit on @xmath202 for different lines of sight the local criterion is computed on - the - fly , using the minimum optical depth to the edge of the current cell  @xmath218 . however , in highly refined regions ( perhaps with partial ionization ) and for scattering events near cell edges this can be quite small , i.e. if @xmath79 is the minimum distance to the cell boundary equation  ( [ eq : tauh ] ) gives @xmath219 it is apparent that if @xmath21 is roughly constant then the only nonlocal quantity needed is the physical size of the system . therefore , the minimum integrated column density along rays emanating from the scattering event sets up an effective sphere with the intensity of equation  ( [ eq : sphere ] ) . rather than calculate this at every scattering we combine the cell - based determination with a nonlocal  ( nl ) estimate : @xmath220 where the path is followed as long as the relative change in neutral hydrogen density remains less than a prescribed threshold , i.e. @xmath221 . a value of @xmath222 ignores the nonlocal scheme completely and setting @xmath223 is too aggressive , failing to even detect sharp ionization fronts . to avoid double counting the local contribution , the paths originate at the edge of each cell and proceed outward . in practice the paths include at least the six directions of the coordinate axes and possibly more to achieve greater angular coverage . the nonlocal estimate can be computed once for each cell as the initial conditions are read in . @xmath4 currently uses the sum of the local determination @xmath218 and the nonlocal estimate @xmath224 as the value of @xmath202 used in equation  ( [ eq : xcrit ] ) . we note that other criteria could be used for estimating @xmath202 . for example , the nonlocal integration might stop if the velocity gradient exceeds the threshold for sobolev escape ; however , in most cases this is a secondary factor with little affect on core - skipping . finally , additional local distances may be used in certain cases . of special interest is to use the jeans length to estimate core - skipping in idealized galactic setups . the jeans length  @xmath225 acts as a physical upper limit for the size of a system with uniform density @xmath226 . a primordial gas with mean molecular weight @xmath227 , mass fraction of hydrogen @xmath228 , and density @xmath229 corresponds to a jeans length of @xmath230 and a local @xmath202 of @xmath231 so that @xmath232 for @xmath233  k and @xmath234 . monte carlo codes benefit greatly from parallel computation because each photon packet is an independent event . therefore , the scalability is nearly linear . @xmath4 uses the message passing interface  ( mpi ) libraries to implement dynamic load balancing between different processors . this is done because photons that undergo many scatterings take longer to escape . therefore , the master process allocates a reasonable amount of work to each slave , e.g. ( @xmath235% of the photons)/(number of processors ) , until the required number of photons are assigned . the nonlocal determination of @xmath236 for each cell , see equation  ( [ eq : ataunl ] ) , is also performed with an efficient parallel computation . at this stage it is important to verify the code against known solutions . we choose tests that are complementary to each other in order to isolate certain key aspects of ly@xmath2 transport . the static test is the well - known neufeld analytical solution for an optically thick homogeneous slab @xcite . the dynamic test is that of an isotropically expanding sphere with different maximal velocities as described by @xcite .     of a static , homogeneous slab at @xmath233  k. the central optical depth @xmath237 covers a range of moderate to extreme values , where the yellow , blue , green , and red curves represent @xmath4 simulations using @xmath238 photon packets for @xmath239 , @xmath240 , @xmath241 , and @xmath242 , respectively . the agreement with the approximate analytic solutions ( thin black lines ) is quite good , especially for higher values of @xmath237 . at lower optical depths the underlying assumptions used to derive equation  ( [ eq : neufeld ] ) break down , therefore the true measure of this test is the limiting behavior as @xmath237 tends to infinity . bottom panel : face - on line of sight radial surface brightness profiles for the same slabs as calculated by equation  ( [ eq : sb ] ) of section  [ sub : surface_brightness_construction ] . the scaling is such that the highest optical depth system is unity at the centre , i.e. @xmath243 . the dashed line is a rough analytic fit to guide the eye . , title="fig : " ]   of a static , homogeneous slab at @xmath233  k. the central optical depth  @xmath237 covers a range of moderate to extreme values , where the yellow , blue , green , and red curves represent @xmath4 simulations using @xmath238 photon packets for @xmath239 , @xmath240 , @xmath241 , and @xmath242 , respectively . the agreement with the approximate analytic solutions ( thin black lines ) is quite good , especially for higher values of @xmath237 . at lower optical depths the underlying assumptions used to derive equation  ( [ eq : neufeld ] ) break down , therefore the true measure of this test is the limiting behavior as @xmath237 tends to infinity . bottom panel : face - on line of sight radial surface brightness profiles for the same slabs as calculated by equation  ( [ eq : sb ] ) of section  [ sub : surface_brightness_construction ] . the scaling is such that the highest optical depth system is unity at the centre , i.e. @xmath243 . the dashed line is a rough analytic fit to guide the eye . , title="fig : " ]      the angular averaged intensity  @xmath244 for a static one - dimensional uniform slab was derived by  @xcite and @xcite . photons are injected at line centre at the origin and continuously scatter until escape occurs at a ` centre - to - edge ' optical depth of @xmath237 . when the bulk motion of the gas is set to zero , @xmath245 , and the recoil effect is ignored , @xmath246 , the emergent spectra are double - peaked and symmetric around the line - central frequency  @xmath247 . the intensity at the surface is given by @xmath248 which has been normalized to @xmath206 , reflecting an integration over solid angle . the peaks are located at @xmath249 , which is derived by solving the equation @xmath208 , or equivalently @xmath250 with @xmath210 . therefore , the peak heights correspond to @xmath251 .    as can be seen in fig . [ fig : neufeld ] the agreement between numerical and analytic solutions is quite good for high optical depths . for example , at an optical depth of @xmath252 when comparing the simulated profile ( red line ) with the approximate analytic solution ( thin black line ) there is a maximum difference of @xmath253 per cent . the neufeld approximation of equation  ( [ eq : neufeld ] ) fails to capture the correct spectra at lower optical depths because core scatterings also contribute to the spatial diffusion of ly@xmath2 photons . therefore , the true measure of this test is the limiting behavior as @xmath237 tends to infinity . the bottom panel of fig . [ fig : neufeld ] demonstrates the face - on radial surface brightness profiles for the same slabs as calculated by equation  ( [ eq : sb ] ) of section  [ sub : surface_brightness_construction ] . the scaling is such that the highest optical depth system is unity at the centre , i.e. @xmath243 . the dashed line is a rough analytic fit to guide the eye and is given in the figure . the shaded regions represent one standard deviation of uncertainty on @xmath254 due to radial binning . finally , this test has also been performed at other temperatures with similar results , cf . appendix  [ appendix : temperature_tests ] . such simulations of ly@xmath2 scatterings through optically thick slabs help measure the effectiveness of the acceleration schemes , cf . appendix  [ appendix : x_crit ] . to test the code for the case of a nonzero gas bulk velocity we compare our results to previous simulations with isotropic expansion of a uniform sphere see @xcite . in general , velocity gradients affect ly@xmath2 escape because photons are doppler shifted out of line centre thereby reducing the effective optical depth . in general , even velocity fields on the order of the thermal velocity in photoionized gas ( @xmath255 ) can change the emergent spectrum of ly@xmath2 photons . following @xcite we consider the intensity of an isothermal ( @xmath233  k ) , homogeneous sphere of column density @xmath256 experiencing isotropic expansion . the hubble relation gives the velocity @xmath257 of the gas at the position @xmath258 from the centre of a sphere with radius  @xmath73 : @xmath259 where the hubble - like parameter @xmath260 sets the maximal velocity @xmath261 at the edge of the sphere , i.e. @xmath262 . figure  [ fig : velocity ] shows the result of this test which demonstrates excellent agreement with @xcite . the static case ( @xmath263 ) also agrees with the analytical solution of @xcite for a static , optically thick spherical `` slab '' . this test is also similar to that of @xcite who calculated the zero - temperature spectrum of a ly@xmath2 source embedded in a neutral , homogeneous igm undergoing hubble expansion . whereas a static solution produces two distinct peaks for blue and red modes of escape , the blue photons are continuously redshifted back to the core and the red mode becomes the only means of escape . this inevitably leads to free streaming on cosmological  ( @xmath264mpc ) scales . unfortunately , there is no analytical solution for a medium possessing both thermal and bulk motions . figure  [ fig : velocity ] illustrates the effect of increasing @xmath261 , which acts to suppress the blue peak until it disappears entirely by @xmath265 . at first the red peak is pushed further from line centre , however , past a critical @xmath261 the peak approaches the centre again because the velocity gradient facilitates escape . the bottom panel of fig . [ fig : velocity ] shows the ( averaged ) line of sight radial surface brightness profile for each sphere . the scaling is such that the static sphere is unity at the centre , i.e. @xmath243 . the dashed line is a reference for a flat profile to guide the eye . only the largest velocity gradients substantially alter the profile so that the apparent image is much more concentrated toward the centre . galaxy formation is a highly complex process ; however , studying the formation and radiative transport in the first , comparatively simple , systems provides an ideal laboratory for the physics involved @xcite . we here employ two complementary methodologies to represent the structure and dynamics of a first galaxy for @xmath4  first , in section  [ sec : toy ] we construct idealized analytic models of these galaxies , and second , in section  [ sec : sim ] we extract a virialized halo from an _ ab initio _ cosmological simulation for post - processing . these first galaxy models will then be the input for the radiative transfer calculations discussed in section  [ sec : results ] . our idealized models allow us to explore the basic physics by directly adjusting parameters in order - of - magnitude fashion . our cutout from the cosmological simulation , on the other hand , provides us with one representative example of a realistic first galaxy . we can thus gauge the validity of our exploratory toy models . we now explore idealized models for the first galaxies at redshift @xmath266 in preparation for extractions from a cosmological simulation . the number density of hydrogen nuclei  @xmath267 is built up from the following assumptions : first , we require spherical symmetry so that @xmath268 . second , we adopt a power law density profile within the galaxy , i.e. @xmath269 out to the edge of the galaxy  @xmath270 defined as the point where @xmath267 equals the background igm , @xmath271 . an isothermal law with @xmath272 provides a good description of a virialized system  ( e.g. * ? ? ? * ) . finally , we prefer a non - cuspy ` core ' in the centre of the galaxy , meaning the density profile flattens off to a constant density  @xmath273 within a core radius of  @xmath274  pc . this is inspired by observations of low surface brightness galaxies that suggest a softening in the centre  @xcite . in summary , the model is piecewise in the radial coordinate  @xmath275 according to : @xmath276    here @xmath271 is the background atomic hydrogen number density derived from a @xmath277cdm model with cosmological parameters taken from the @xcite , and incorporating constraints from the _ wilkinson microwave anisotropy probe _ ( wmap ; * ? ? ? * ) , the _ south pole telescope _ ( spt ; * ? ? ? * ) , and the _ atacama cosmology telescope _ ( act ; * ? ? ? specifically , the hubble constant is taken to be @xmath278  km  s@xmath279  mpc@xmath279 while the fractional energy contributions of baryons , matter , and dark energy are @xmath280 , @xmath281 , and @xmath282 , respectively . therefore , @xmath271 is @xmath283 , or @xmath284 where @xmath228 is the mass fraction of hydrogen and @xmath285 is the critical energy density at present . furthermore , the edge of the galaxy is given by solving the equation @xmath286 , which yields a radius of @xmath287 . the density parameter  @xmath273 is then found by normalizing the overall mass of hydrogen in the galaxy  @xmath288 to some value , e.g. @xmath289 for an atomic cooling halo . the total mass is given by the integral @xmath290 equation  ( [ eq : mhtot ] ) is a cubic polynomial in @xmath273 whose solution is not particularly insightful . however , we may expand about large masses  @xmath288 to consolidate the leading order terms . these terms provide a relative accuracy in @xmath273 of better than 1  part per billion for masses larger than @xmath291 . for the parameters chosen above this implies a central density of @xmath292 where we have introduced the dimensionless parameter : @xmath293 this term may also be found by dropping the @xmath294 term in equation  ( [ eq : mhtot ] ) . the @xmath295 parameter relates the ( leading order ) ratio of core and background densities via @xmath296 and the ratio of core and edge radii via @xmath297 . with this central density the optical depth to ly@xmath2 scattering of the core region is at least @xmath298 , a value that would increase with a larger core radius , a lower temperature , or a more massive system . we are primarily interested in the mass and density of hydrogen , therefore we decided to use @xmath288 in the comparison . the total or virial mass of the galaxy is larger for two main reasons : @xmath299 the mass fraction of hydrogen to baryons is less than unity , i.e. @xmath228 . @xmath300 the contribution of baryonic mass is considerably less than the contribution of dark matter , which is usually more extreme in smaller galaxies . in fact , if a substantial amount of gas is lost through ram pressure stripping or supernova blowout , for example , the baryonic mass may be significantly below the cosmological baryon fraction of @xmath301 per cent @xcite . at any rate we can reasonably relate the virial and total hydrogen masses by @xmath302 .      the model above did not include an ionized region around a central star cluster . this is important because ly@xmath2 photons can easily escape such regions . furthermore , a strmgren analysis suggests that the ionized region may be on the order of @xmath303 for a reasonable set of parameters : @xmath304 where we have defined normalized values for ionizing photon rate @xmath305 and density @xmath306 . the normalization used for @xmath307 is a plausible guess at the rate expected from the starbursts residing in the first galaxies ( see section  [ sec : central_starburst ] for further discussion ) . the expression was simplified by approximating the total case  b recombination rate by @xmath308  cm@xmath5  s@xmath279 @xcite . in order to understand how the ionized region affects ly@xmath2 transfer we need to consider how the full three - dimensional ionization structure evolves in time . the strmgren radius is a good approximation early on when the radiation is bottled up and the ionization rate balances the recombination rate , i.e. @xmath310 . however , as the ionization front moves out , the hii  regions blow pockets through which ly@xmath2 photons may escape . therefore , we distinguish between _ early _ ionization scenarios when the hii  region is ultra - compact as in equation  ( [ eq : stromgren ] ) and _ late _ scenarios when the hii  starburst regions have overtaken the entire halo . these cases bracket the entire evolution . the late stages of the ionization structure must be anisotropic because the cosmological filaments guide the ionized bubbles into a butterfly - shaped morphology around the centre . for simplicity we model this as a bipolar cavity . specifically , in addition to the strmgren sphere , our _ late _ scenario also has a biconical region out to @xmath270 . the size of the hii  region is determined by the total number of ionizing photons , i.e. @xmath311 . if the photons are produced at a constant rate and the volume of the cone is described by the opening angle  @xmath312 from the axis of symmetry then the time to evacuate the cavity is at least of order @xmath313 therefore , the _ late _ scenario corresponds to a time when the biconic region out to @xmath270 is fully ionized see fig . [ fig : idealized_density ] for an edge - on view of the column density through one such halo .     for a `` late '' model at a source redshift of @xmath314 with @xmath315 . the spatial scale , in physical kiloparsecs and arcseconds , are provided . the edge - on view of the halo demonstrates the butterfly - shaped ionization structure of the models . for comparison with eq . ( [ eq : t_late ] ) the corresponding ionizing photon rate is @xmath316 , giving a late time lower limit of @xmath317  yr . ]      the central starburst provides a feedback mechanism on the host galaxy . in order to motivate a spherically symmetric velocity law we consider the relative strength of the gravitational force  @xmath318 to the radiation force  @xmath319 . as a first estimate , if we attribute the radiation pressure to thompson scattering in the single - scattering limit , then because of the @xmath320 scaling of both forces , their ratio is of order @xmath321 where @xmath322 and @xmath323 are respectively the total luminosity and mass of the entire cluster . the normalization is chosen to correspond to the mass to light ratio for pop  iii stars , i.e. @xmath324 ( see section  [ sec : central_starburst ] ) . for simplicity equation  ( [ eq : rad_grav ] ) assumes a point source . in reality , the ratio decreases radially from the centre of the gravitational potential as the dark matter halo mass dominates the gravitational force . furthermore , equation  ( [ eq : rad_grav ] ) is only applicable to ionized gas , whereas ly@xmath2 scattering occurs in neutral gas so other sources of pressure must also be present for our idealized law . we consider a force multiplier in analogy to that of ( cak ; * ? ? ? * ) originating from many resonant and optically thin lines . the multiplier can amplify the scattering efficiency by many orders of magnitude . thus , the luminosities considered here ( @xmath325 ) may be capable of sustaining radiation - driven winds @xcite . indeed , the ly@xmath2 line alone may be responsible for much of the opacity these winds require @xcite . the cak theory uses mass conservation and momentum balance to arrive at a ` beta law ' with an exponent of @xmath326 for the radial velocity profile @xmath327 where @xmath328 is the size of the source . the terminal velocity @xmath329 is typically larger than the escape velocity @xmath330 by a factor of a couple . plausible values for our models are obtained by requiring that the mass loss rate @xmath331 be less than the maximally efficient mass loss for single scattering @xmath332 for which the radiation momentum is imparted entirely to the gas . in the halo s isothermal region , i.e. @xmath333 , the velocity approaches @xmath329 and @xmath334 so @xmath335 in principle , multiple scattering in the optically thick environment could boost @xmath329 by a factor of the square root of the optical depth , or at least an order of magnitude . however , for simplicity our wind models all assume the velocity profile of equation  ( [ eq : wind ] ) with @xmath336  pc , the approximate size of the central star cluster , and @xmath337 , a value comparable to the thermal velocity  @xmath338 . we note that our value of @xmath329 is also close to the escape velocity of the system , @xmath339 @xmath340^{1/3}$ ] @xmath341^{1/2}$ ] . for completeness , the original cak force multiplier @xmath342 would need to be reevaluated for h and he lines of gas with primordial composition . it is beyond the scope of this work to do so here but for reference the model of @xcite derives values of @xmath343 and @xmath344 . the parameter @xmath345 is either the electron - scattering optical depth @xmath346 or the sobolev optical depth @xmath347 in static or expanding media , respectively . the density and velocity profiles considered here are not self - consistent in the dynamical sense . however , our simplified @xmath348-model , calibrated in the above fashion , should give us a rough window into the otherwise extremely complex physics of galactic winds ( e.g. * ? ? ? this also avoids overconstructing models that are already quite idealized . finally , the radiation pressure driven winds considered above may require some dust and metals to be present in the ism . however , we have not included dust in these primordial environments . further study on how dust affects ly@xmath2 transfer in anisotropic models should be carried out and is left for future work . still , various mechanisms such as scattering in clumpy media have been proposed to explain why the ly@xmath2 escape fraction is so significant in environments where core depletion seems unavoidable . in fact , @xcite suggest that dust attenuation is unlikely to affect ly@xmath2 escape at @xmath349 . for our purposes , we expect dust to lower the bolometric line flux by at most a factor of a few . for an example of coupling large scale cosmological simulations with dust and radiative transfer models designed to constrain igm ionization and the dust distribution in the ism of early galaxies see @xcite and @xcite . the expression @xmath350 is based on comparing an expanding of the analytical solution for a static uniform sphere to the height of its peak  see equation  ( [ eq : sphere ] ) . however , the constant of proportionality must be found by empirical tests . the tests were run on many different values of @xmath202 , however , we only show two to demonstrate the validity across the parameter space . the first is for @xmath351 , for which equation  ( [ eq : xcrit ] ) gives @xmath352 , while the second is for @xmath353 , where @xmath354 . as can be seen from fig .  [ fig : xcrit_test ] , both values produce excellent results .     designed to compare different values of @xmath201 . the converged solution ( yellow histogram ) is given by @xmath355 while a low value of @xmath356 provides excellent agreement and is shown in black . a sample of values which are too high and affect the emergent spectrum are @xmath357 and are respectively given by orange , red , and purple dotted histograms . bottom panel : same as the top panel except for @xmath353 . a value of @xmath358 is sufficiently converged for our purposes . an acceptable value of @xmath359 is given by a black line while non - converged values of @xmath360 are again given by the orange , red , and purple dotted histograms . here @xmath202 is large enough that the analytical solution of equ . ( [ eq : sphere ] ) is accurate , so it is included as the green dashed line in the background . both tests used @xmath361 photon packets.,title="fig : " ]   designed to compare different values of @xmath201 . the converged solution ( yellow histogram ) is given by @xmath355 while a low value of @xmath356 provides excellent agreement and is shown in black . a sample of values which are too high and affect the emergent spectrum are @xmath357 and are respectively given by orange , red , and purple dotted histograms . bottom panel : same as the top panel except for @xmath353 . a value of @xmath358 is sufficiently converged for our purposes . an acceptable value of @xmath359 is given by a black line while non - converged values of @xmath360 are again given by the orange , red , and purple dotted histograms . here @xmath202 is large enough that the analytical solution of equ . ( [ eq : sphere ] ) is accurate , so it is included as the green dashed line in the background . both tests used @xmath361 photon packets.,title="fig : " ] in order to test the grid structure of the cosmological simulation for edge effects and sensitivity to the extraction size we examine the emergent spectra for cubes with a centre to edge distance of @xmath125  pc , @xmath362  kpc , @xmath132  kpc , and @xmath363  kpc . the largest size represents the radiative transfer through the entire @xmath364  mpc@xmath365 comoving volume . figure  [ fig : box_size ] demonstrates the convergence of the flux density  @xmath366 toward that of the largest extraction , although there is still a significant variance across different lines of sight due to the inhomogeneous nature of the cosmic structure .        in order to demonstrate the `` thermal effects '' on ly@xmath2 radiative transfer , e.g. via the doppler width  @xmath372 and core - wing transition @xmath42 , we include two test suites of uniform slabs with varying temperature . the first maintains a constant optical depth at line centre of @xmath373 while the second ensures a fixed column density of @xmath374  @xmath50 , which corresponds to @xmath373 at @xmath375  k. the angular averaged intensity for each model is plotted in fig . [ fig : temperature_tests ] .    even though the optical depth or column density is fixed , the product @xmath376 depends on temperature and the emergent spectra is affected . furthermore , we note that although the lorentz wing optical depth is always independent of temperature , @xmath377 and @xmath378 are proportional to @xmath379 and @xmath380 , respectively . ( [ eq : x_f ] )  and  ( [ eq : recoil_parameter ] ) demonstrate that for recoil shifting to appreciably affect the ly@xmath2 profile it must be comparable to the typical redistribution at each scattering event . for example , if @xmath381 then under thermally - dominated redistribution we typically have @xmath382 . however , lorentzian - dominated redistribution may become a reasonable approximation at low temperatures . in this case , the scattering atom s parallel velocity component is roughly @xmath383 and the ratio to recoil is significantly reduced for core photons , i.e. @xmath384 . the total relative contribution over all scattering events induces a runaway reddening effect in cold , optically thick environments . radiative transfer . both cases represent the angular averaged intensity as a function of doppler velocity @xmath385 for uniform slabs of varying temperature . for direct comparison between the models the normalization is arbitrary but consistent in all cases . the top panel maintains a constant optical depth at line centre of @xmath373 while the bottom panel ensures a fixed column density of @xmath374  @xmath50 , corresponding to @xmath373 at @xmath233  k. even though the optical depth or column density are fixed , the product @xmath376 depends on temperature and the emergent spectra is affected . the number of photon packets used in these simulations is @xmath386 . ]
we present the @xmath0smic @xmath1yman-@xmath2 @xmath3ransfer code ( @xmath4 ) , a massively parallel monte - carlo radiative transfer code , to simulate lyman-@xmath2 ( ly@xmath2 ) resonant scattering through neutral hydrogen as a probe of the first galaxies . 
 we explore the interaction of centrally produced ly@xmath2 radiation with the host galactic environment . 
 ly@xmath2 photons emitted from the luminous starburst region escape with characteristic features in the line profile depending on the density distribution , ionization structure , and bulk velocity fields . 
 for example , anisotropic ionization exhibits a tall peak close to line centre with a skewed tail that drops off gradually . 
 idealized models of first galaxies explore the effect of mass , anisotropic hii  regions , and radiation pressure driven winds on ly@xmath2 observables . 
 we employ mesh refinement to resolve critical structures . 
 we also post - process an _ ab initio _ cosmological simulation and examine images captured at various distances within the 1  mpc@xmath5 comoving volume . 
 finally , we discuss the emergent spectra and surface brightness profiles of these objects in the context of high-@xmath6 observations . 
 the first galaxies will likely be observed through the red damping wing of the ly@xmath2 line . 
 observations will be biased toward galaxies with an intrinsic red peak located far from line centre that reside in extensive hii  super bubbles , which allows hubble flow to sufficiently redshift photons away from line centre and facilitate transmission through the intergalactic medium . even with gravitational lensing to boost the luminosity this preliminary work indicates that ly@xmath2 emission from stellar clusters within haloes of @xmath7 is generally too faint to be detected by the _ james webb space telescope _  ( _ jwst _ ) . 
 [ firstpage ]    lyman-@xmath2 emission 
 radiative transfer  resonant scattering  line : profiles  cosmology : theory  galaxies : formation  galaxies : high - redshift