Can radial temperature profiles be inferred using NH3 (1, 1) and (2, 2) observations?

A number of works infer radial temperature profiles of envelopes surrounding young stellar objects using several rotational transitions in a pixel-by-pixel or azimuthally-averaged basis. However, in many cases the assumption that the rotational temperature is constant along the line of sight is made, while this is not the case when a partially resolved envelope, assumed to be spherically symmetric, is used to obtain values of temperature for different projected radii. This kind of analysis (homogeneous analysis) is intrinsically inconsistent. By using a spherical envelope model to interpret NH3 (1, 1) and (2, 2) observations, we tested how robust it is to infer radial temperature profiles of an envelope. The temperature and density of the model envelope are power laws of radius, but the density can be flat for an inner central part. The homogeneous analysis was applied to obtain radial temperature profiles, and resulted that for small projected radii, where the optical depth of the lines is high, the homogeneous temperature can be much higher than the actual envelope temperature. In general, for larger projected radii, both the temperature and the temperature power-law index can be underestimated by as much as 40%, and 0.15, respectively. We applied this study to the infrared dark cloud G14.225-0.506 for which the radial temperature profile was previously derived from the dust emission at submillimeter wavelengths and the spectral energy distribution. As expected, the homogeneous analysis underestimated both the temperature and the temperature power-law index.


INTRODUCTION
Characterizing the envelopes surrounding young stellar objects is important to correctly infer their properties and compare them to theoretical models.A typical assumption used to describe these envelopes is to consider that their density and temperature decrease with radius following power-laws.This has widely been determined from observations (e.g., Beuther et al. 2002;Mueller et al. 2002;Hatchell & van der Tak 2003;Williams et al. 2005;Butler & Tan 2012;Giannetti et al. 2013;Palau et al. 2014Palau et al. , 2021;;Gieser et al. 2021) and is also predicted from theoretical models (e.g., Larson 1969;Shu 1977;Gómez et al. 2021).
The density and temperature structure of the envelopes surrounding young stellar objects have been determined in many cases using the radial intensity profiles from the continuum emission.Even though it is widely known that molecular clouds are largely filamentary, it is also true that the most active star-forming sites are located at the centers of converging filaments, giving rise to the so-called hub-filament systems (e.g., Dewangan et al. 2020;Wang et al. 2020;Kumar et al. 2022;Liu et al. 2023).It has been shown that the hubs are reasonably reproduced by models of spherical symmetry, such ⋆ E-mail: robert.estalella@gmail.comas those studied in Beuther et al. (2023).Actually, Kainulainen et al. (2013) find that fragmentation of molecular clouds at spatial scales 0.5-10 pc is in agreement with the fragmentation expected for a selfgravitating cylinder, and therefore a filamentary structure, while at scales < 0.5 pc the fragmentation is in agreement with spherical Jeans fragmentation.In addition, it has been shown that assuming spherical geometry is reasonable for cores embedded within filamentary structures for aspect ratios up to 2 (Roy et al. 2014).Thus, even in the era of filamentary molecular clouds, assuming spherical symmetry to model the hubs where active star formation is taking place seems a reasonable first approximation.
In the case of spherical symmetry, and if one assumes optically thin emission, the Rayleigh-Jeans approximation, and an envelope with infinite radius, the intensity as function of the projected distance to the source, b, follows a power-law with index 1 − (p + q), where p and q are the power-law indices of the density and temperature (e.g., Beltrán et al. 2002;Beuther et al. 2002;Palau et al. 2014).Therefore, given an observed radial intensity profile, one needs to make a specific assumption about either the density or the temperature to infer the other.
Molecular line observations, including transitions of NH 3 , H 2 CO, CH 3 CN, HCOOCH 3 , and complex organic molecules, of partially resolved envelopes have been used to derive the temperature radial profile of the envelope (e.g., Ahmadi et al. 2018;Beltrán et al. 2018;  2, 2) (bottom) lines in G34.43+0.24.The (1, 1) transition shows the main and four (two inner and two outer) satellite quadrupole hyperfine lines, while the satellite lines of the (2, 2) transition are too faint to be observed.Gieser et al. 2019Gieser et al. , 2021;;Busch et al. 2022).The standard procedure to infer the temperature from rotational diagrams, for instance, of NH 3 , assumes that, along the line of sight, the medium is homogeneous and in particular that the rotational temperature is constant.However, the derived values of T rot for different projected radii are interpreted as the radial profile of temperature of the envelope.This kind of analysis is inconsistent because the gas is assumed to be homogeneous along the line of sight and, at the same time, inhomogeneous in the radial direction.
In this paper, we aim at studying whether the determination of the radial temperature profiles from the NH 3 (1, 1) and (2, 2) data are a reasonable approach to the actual temperature profile.Since the collisional coefficients for the quadrupole-hyperfine transitions of NH 3 are not available in the literature, the existing numerical radiative transfer models are of limited usefulness.Thus, we developed a numerical radiative transfer calculation for the NH 3 (1, 1) and (2, 2) hyperfines, which is described in Appendix A. A comparison with a full radiative transfer calculation is also included.The structure of the paper is as follows: in Section 2 we present the basics of the standard NH 3 analysis, in Section 3 we present the limitations of this analysis, in Section 4 the spherical model used here is described, in Section 5 the optically thin case is considered, in Section 6 a radiative transfer calculation is used for different parameters of the envelope, in Section 7 the results found here are applied to the G14.225−0.506case and in Section 8 we summarize our main conclusions.
2 NH 3 (J, K) = (1, 1) AND (2, 2) ANALYSIS BASICS The intensity of the NH 3 (J, K) = (1, 1) and (2, 2) lines can be expressed as Table 1.Frequencies in temperature units, spontaneous emission coefficients, and optical depth ratio of the main (m), inner satellite (s) of NH 3 (1, 1) and (2, 2) to the total optical depth of the transition (Osorio et al. 2009;Mangum & Shirley 2015).where η B is the beam filling-factor, J ν (T ) is the Plank correction to the Rayleigh-Jeans approximation, ν jk is the frequency of the transition, T ex is the excitation temperature, T bg is the background temperature, and τ( j, k) is the optical depth of the transition.Since we are dealing with the observation of an angularly resolved envelope, in the following we will consider the beam filling factor η B = 1.The standard procedure to analyze observations of the (1, 1) and (2, 2) inversion transitions of ammonia consists in fitting the intensity of the main and inner-satellite quadrupole-hyperfines of the (1, 1) line (see Fig 1), T L (1, 1; m) and T L (1, 1; s).Since the optical depth ratio of the main and inner satellite lines is known R jkm /R jks = 18/5 = 3.6 (see Table 1), the optical depth of the main line, τ(1, 1; m) is obtained from the equation This approach is valid if the magnetic hyperfines are blended, that is, the hyperfines line-width is large enough so that the quadrupole hyperfines profiles show no substructure and are nearly Gaussian.
A more robust method is to fit the magnetic hyperfine structure of the (1, 1) line using a procedure like CLASS (NH 3 method).The outputs of the fit include the intensity and optical depth of the main line, T L (1, 1; m) and τ(1, 1; m).For the (2, 2) line, the satellite lines are usually unobservable (see Fig. 1), and a single Gaussian is fitted to the main line, giving the main line intensity, T L (2, 2; m).Since the excitation temperature of the (1, 1) and (2, 2) transitions are assumed to be the same, and the frequencies of the two transitions are very close, the intensity ratio can be used to derive the optical depth of the (2, 2) main line, from the relation Alternatively, the magnetic hyperfine structure of the (1, 1) and (2, 2) lines can be fitted simultaneously using a procedure like HfS (Estalella 2017), and the optical depth of the (2, 2) main line is obtained directly, with the same assumption of equal excitation temperature for the (1, 1) and (2, 2) lines (see for instance Sepúlveda et al. 2020).
Once the opacities are known, Eq. 1 is used to derive the excitation temperature T ex .This temperature is not well determined since it depends on the correct calibration of telescope output, and on the coupling of the telescope beam with the source (the beam filling factor).The usual assumption is to take η B = 1.However, in the Rayleigh-Jeans limit and the optically thin case, the NH 3 column density can be derived independently of the value of T ex (see Section 5).
From these data, the column density of ammonia molecules in the  (Mangum & Shirley 2015).(1, 1) and (2, 2) levels, N 11 and N 22 , can be derived (see for instance, Estalella 2017), where A jk is the spontaneous emission coefficient (Table 1), R jkm = τ( j, k; m)/τ jk , is the ratio of main line to total optical depth, given in Table 1, and ∆v is the full-width at half-maximum of the hyperfine lines.
To obtain the rotational temperature, T rot , and the total NH 3 column density, N(NH 3 ), it is necessary to determine the fraction, f jk , of ammonia molecules that are in the (J, K) rotational level, from which the total hydrogen gas density is derived adopting an ammonia fractional abundance, X, assumed to be constant, The usual assumption for moderate temperatures is that only the metastable levels (J = K) of ammonia are populated, and that they are populated according to a unique excitation temperature, called the rotational temperature T rot .The rotational temperature is given by the Boltzmann equation, where g jk is the degeneracy and E jk the energy of the level (J, K) (see Table 2).The latter equation is used routinely to derive the rotational temperature by assuming that N 22 /N 11 ≃ n 22 /n 11 , The rotational temperature can also been expressed as a function of the optical depths of the (1, 1) and (2, 2) main lines by using Eq. 5, resulting, in practical units, in The rotational temperature is a good approximation to the kinetic temperature if the radiative transitions up the K-ladder are negligible, and only collisional transitions between the metastable levels occur.The rotational temperature can be corrected to estimate the kinetic temperature (Tafalla et al. 2004).An improved version of the correction is given in Estalella (2017), The last equation has to be solved iteratively to obtain T k .
In order to obtain the total NH 3 column density, we can consider that for moderate values of T rot ( < ∼ 100 K), only the levels (J, K) = (0, 0), (1, 1), (2, 2), and (3, 3) are populated, so that the partition function Q(T rot ) is The fractional abundances of the (1, 1) and (2, 2) levels, f jk = n jk /n(NH 3 ), are given by The maximum of f 11 ( f 11 ≃ 0.448) occurs for T rot ≃ 23.9 K, and for high temperatures so the the hydrogen column density is

LIMITATIONS OF THE STANDARD NH ANALYSIS
There is an implicit assumption in the approximations made to derive the expressions derived so far: that the gas is homogeneous and, in particular, that the rotational temperature is constant along the line of sight.This has no importance as long as the clump of gas analyzed is assumed to be homogeneous.However, this is not the case when we analyze ammonia data of a partially resolved envelope, assumed to be spherically symmetric, and use Eq. 9 to obtain values of T rot for different projected radii (the radial profile of temperature of the envelope).This kind of analysis is intrinsically inconsistent.On the one hand, Eq. 9 assumes that the gas is homogeneous along the line of sight, and on the other hand, these results are used to infer a radial dependence of T rot , implying that T rot is not constant along the line of sight.
Let us call r 11 the intensity ratio of main to satellite (1, 1) lines, r 11 = T 1m /T 1s .Equation 3 used to derive the optical depth of the (1, 1) line requires that For r 11 → 1 we have τ 1m → +∞, while for r 11 = 3.6, the optical depth is zero.If r 11 is less than 1, no value of the optical depth τ 1m can be derived, and if it is greater than 3.6, Eq. 3 gives a negative optical depth.The derivation of the rotational temperature (Eq.11) requires that where a = (A 22 R 22m g 22 )/(A 11 R 11m g 11 ) = 3.544.The relation between T 1m , T 2m , τ 1m , and τ 2m (Eq.4) can be written as By substituting Eq. 19, we obtain a condition on the intensity ratio r 21 and τ 1m , The values of r τ for the limiting values of τ 1m are r τ → r 21 /a for τ 1m → 0, and r τ → r 21 for τ 1m → ∞.
In the following we will call the standard NH 3 analysis, under the assumption of gas homogeneity, homogeneous analysis, and the kinetic temperature derived from Eqs. 9 and 12, homogeneous temperature, T hom k .We will estimate T hom k , in a consistent way, for a spherically symmetric envelope, and its dependence on the density and temperature structure of the envelope.

SPHERICAL ENVELOPE MODEL
Let us assume a spherically symmetric envelope, with a density that at large radii is a power-law of radius with index −p, but that may have a flat inner part, the so-called Plummer-like density, with a characteristic radius r c , The central density, at r = 0, is n c .For small radii, r ≪ r c , the density is flat, n ≃ n c , while for large radii, r ≫ r c , the density follows a power law, n ≃ n c (r/r c ) −p .We can consider the Plummerlike density as a generalization of the power-law density.This can be seen by writing the Plummer-like function as This expression of the Plummer-like function is useful because for r c = 0 we obtain directly a power-law function, with the reference radius r 0 and the density parameter n 0 well defined, while on the contrary, the central density n c → ∞.In the small and large radii limits we obtain Thus, the central density n c and n 0 are related through The density parameter n 0 is not an actual density.It can be interpreted as the density at the reference radius r 0 of the extrapolation of the Plummer-like function for r ≫ r c (see Fig. 4).In the case r c > r 0 , n 0 is even higher than the maximum density of the envelope, n c .We consider that the Plummer-like law for the density is valid up to the envelope radius, taken as the radius for which the density is a given minimum value, n min , the ambient gas density.
Regarding the temperature of the envelope, we consider a a power law of the radius, with a power-law index −q, where T 0 is the temperature at the reference radius r 0 .The gas temperature has also a minimum value, T min , which corresponds to a radius such that for larger radii the envelope temperature is taken constant, equal to T min .The temperature power-law index for a centrally heated envelope, with the dust and the gas well coupled, depends on the dust opacity index β, q = 2/(4 + β).For the usual values of β, 0 < β < 4, the temperature power-law index results in 0.25 < q < 0.5.
In the following we will derive the homogeneous temperature, T hom k , for a spherical envelope as a function of the projected radius, b.Two different approximations will be considered: (i) Rough approximation, optically thin case, power-law density.(ii) Radiative transfer calculation, with an excitation temperature given by the two-levels model, Plummer-like density.

OPTICALLY THIN CASE, POWER-LAW DENSITY
Let us assume that the emission is optically thin, that the Rayleigh-Jeans approximation is valid, that T ex ≫ T bg , and that T rot ≃ T k .In this case, the intensities of the (1, 1) and (2, 2) main lines are given by Equation 5 giving the column density as a function of the optical depth, in the optically thin case, can be simplified to so that, in the optically thin case, the column densities are proportional to the line intensities, and their ratio can be obtained directly from the ratio of line intensities, Thus, the homogeneous temperature can be simply derived from the ratio of intensities of the (1, 1) and (2, 2) lines.From Eqs. 31 and 9, we have Let us estimate, for a given projected radius b, the column densities N 11 and N 22 , where dz is the elementary length along the line of sight, and r = √ b 2 + z 2 (see Fig. 5).The function that is integrated, the number density n jk (r), depends on the fractional abundance f jk , which depends on the envelope temperature (Eq.14), and the envelope density, n(r), n jk (r) = f jk (T (r)) X n(r). (34) If we assume that the density is given by a simple power law, the maximum of n jk occurs at the minimum value of r, r min = b, with a value n jk (b), and we can roughly approximate the integral along the line of sight by line of sight Thus, with this approximation, the column density ratio for a projected radius b equals the fractional density radio for r = b, Since the envelope temperature gives the fractional density ratio f 11 / f 22 (Eq.15), and the same expression for the column density ratio gives the homogeneous temperature (Eq.9), both temperatures coincide.
In conclusion, in the optically thin case and with the rough approximation made for the integral along the line of sight, and for a power-law density, the homogeneous temperature coincides with the envelope temperature, However, the NH 3 (1, 1) emission is in many cases partially thick, and the optically thin approximation does not hold.In addition, even for a power-law density, the maximum NH 3 (1, 1) volume density n 11 is not necessarily found at the minimum distance of the line of sight to the envelope center, because for temperatures greater than ∼ 20 K, the density n 11 decreases with temperature (Fig. 2), and the approximation used to estimate the column density does not hold.

RADIATIVE TRANSFER CALCULATION
A radiative transfer code was developed to derive the intensities of the NH 3 (1, 1; m), (1, 1; s), and (2, 2; m) lines for a spherical envelope, and calculate the homogeneous optical depths τ hom (1, 1; s) and τ hom (2, 2; s), and the homogeneous temperature T hom k derived from the homogeneous analysis.The description of the method is given in Appendix A.

Results
A summary of results for different envelope parameters is shown in Figs. 6 and 7.In Fig. 6 we show the actual temperature profile and the homogeneous temperature profile obtained for envelopes with power-law density profiles (r c = 0), and in Fig. 7 with Plummerlike density profiles (r c > 0).The parameters of the envelopes, at a distance of 1 kpc, are the same for all the panels of the figures, unless stated otherwise, reference radius r 0 = 1 kau, density parameter n 0 = 10 7 cm −3 , density power-law index p = 2, temperature at r 0 , T 0 = 50 K, temperature power-law index q = 0.5, line width ∆v = 0.5 km s −1 , minimum density n min = 10 3 cm −3 , minimum temperature T min = 8 K, and NH 3 abundance X = 10 −8 .For each panel of Figs. 6 and 7 a single parameter of the envelope, indicated in the panel, is changed.
In Fig. 6 (power-law density, r c = 0), the first panel shows the results for different densities, n 0 = 10 6 cm −3 (resulting r env = 0.15 pc), 10 7 cm −3 (r env = 0.5 pc) and 10 8 cm −3 (r env = 1.5 pc).The second panel shows different values of the density power-law index, p = 1.5 (resulting r env = 2.2 pc), p = 2 (r env = 0.5 pc) and p = 2.5 (r env = 0.08 pc).The third panel shows different values of the envelope temperature, T 0 = 20, 50, and 100 K.The fourth panel, different values of the temperature power-law index, q = 0.25, 0.33, and 0.5.Finally, the bottom panels shows different values of the line width, ∆v = 0.2, 0.5, 1 km s −1 .For the three bottom panels the resulting envelope radius is the same, r env = 0.5 pc. for different parameters of an envelope with a power-law density profile.The dashed lines indicate the radial profiles of the actual kinetic temperature of the envelope.For all panels, except for the parameter indicated in each panel, the envelope is at a distance of 1 kpc, with n 0 = 10 7 cm −3 , p = 2, r c = 0, T 0 = 50 K, q = 0.5, and ∆v = 0.5 km s −1 .Top panel: Envelope densities n 0 = 10 6 , 10 7 , and 10 8 cm −3 .Second panel: Density power-law indices p = 1.5, 2, and 2.5.Third panel: Envelope temperatures T 0 = 20, 50, and 100 K. Fourth column: Temperature power-law indices q = 0.25, 0.33, and 0.5.Bottom column: Line widths ∆v = 0.2, 0.5, and 1 km s −1 .for an envelope with a Plummer-like density profile with different values of the radius of the inner flat region, r c = 0, 1, 3, 10, and 30 kau.The top panel is for a density n 0 = 10 7 cm −3 , and the bottom panel for n 0 = 10 8 cm −3 .The dashed lines indicate the radial profiles of the actual kinetic temperature of the envelope.For both panels the envelope is at a distance of 1 kpc, with p = 2, T 0 = 50 K, q = 0.5, and ∆v = 0.5 km s −1 .The values of r c (kau) and the resulting central densities n c (cm −3 ) are indicated in each panel.In the bottom panel, the profiles for r c = 0, 1, and 3 are nearly coincident.
In Fig. 7 we show the results for Plummer-like density profiles for different values of the radius of the inner flat region, r c = 0, 1, 3, 10, and 30 kau.The top panel is for a density parameter n 0 = 10 7 cm −3 , giving an envelope radius r env ≃ 0.5 pc, and the bottom panel is for n 0 = 10 8 cm −3 , corresponding to r env ≃ 1.5 pc.The central densities, n c , are indicated for each value of r c .
As can be seen in Figs. 6 and 7, in some cases for most sets of parameters there is a critical value of b below which no value of T hom k can be calculated.This happens when for small projected radii the lines become optically thick, and some of the conditions of Eqs. 18, 19, and 21 are not fulfilled, making impossible the calculation of T hom k , or of both τ(2, 2; m) and T hom k , or even of all three parameters τ(1, 1; m), τ(2, 2; m), and T hom k .Near the critical value T hom k increases sharply with decreasing projected radius.This behaviour, as explained above, is an optical depth effect.For small projected radii the optical depth of the lines is high.However, the (2, 2) line is optically thinner than the (1, 1), and thus it has more contribution from the the inner, hotter part of the envelope.This increase of the intensity of the (2, 2) line is interpreted by the homogeneous analysis as a higher T hom k .Far from the critical value, and for projected radii larger that the radius of the inner flat region, the homogeneous temperature is a fair estimate of the envelope radial profile of temperature, although it systematically underestimates the envelope temperature.A possible explanation is that for optically thin (1, 1) and (2, 2) lines, the mate- .Comparison of the power-law radial profile of the envelope temperature, T = T 0 (r/r 0 ) −q , and of T hom k obtained from the homogeneous analysis, for the projected radii for which it can be fitted by a power law, T hom k ≃ T 0h (b/r 0 ) −q h .The results obtained are shown as a function of the radius of the inner flat region r c .Each rows has two panels.The left panel shows the normalized difference of temperatures, (T 0h −T 0 )/T 0 , and the right panel, the difference in power-law indices, q h − q.For each row, the three lines (black, red, and blue) correspond to different values of the parameter indicated in the right panel of the row.The rest of parameters are the same as those used in Figs. 6 and 7. rial along the line of sight contributes to the (2, 2) emission only if its temperature is high enough, which occurs near the center of the envelope, which is not the case for the (1, 1) emission.This deficit of (2, 2) emission is interpreted by the homogeneous analysis as a lower T hom k .However, a much more remarkable feature of the homogeneous analysis is that for Plummer-like density profiles, the radial profile of T hom k can be much flatter than the temperature profile of the envelope.This is especially noticeably for projected radii less than the radius of the flat inner region, b ≲ r c (see Fig. 7).It appears that the flattening of the density profile is erroneously interpreted by the homogeneous analysis as a flattening of the temperature profile.
In order to see the effect of the radius of the inner flat region and the rest of envelope parameters on the difference between T hom k and the envelope temperature, we calculated for several values of r c and different physical parameters of the envelope the radial profile of T hom k as a function of r c , and fitted a power law for the range of projected radii where the profile could be approximated well by a power law, obtaining values of T 0h and q h .These were compared with the values of T 0 and q of the envelope.The results are shown in Fig. 8.The results are shown as a function of r c , ranging from 0 to 30 kau.The ranges of the physical parameters of the envelope examined were 10 6 cm −3 ≤ n 0 ≤ 10 8 cm −3 (top row of Fig. 8), 1.5 ≤ p ≤ 2.5 (second row), 50 K ≤ T ≤ 100 K (third row), 0.25 ≤ q ≤ 0.5 (fourth column), and 0.2 ≤ ∆v ≤ 1 km s −1 (bottom row).These ranges include the typical values derived for massive dense cores and clumps in previous works (e.g., Beuther et al. 2002;Williams et al. 2005;Giannetti et al. 2013;Palau et al. 2014Palau et al. , 2021;;Gieser et al. 2021).Two panels are shown for each row, the left panel with the normalized difference of temperatures, (T 0h − T 0 )/T 0 , and the right panel with the power-law indices difference, q h − q.For each row the three lines and dots correspond to different values of the parameter indicated in the same row.As can be seen in the figure, for small values of r c the difference (T 0h −T 0 )/T 0 is typically −20% to −30%, and q h −q of the order of −0.05.However, these differences increase dramatically for higher values of the inner flat region.The temperature difference can be as high as −40% to −50%, and the power-law index difference can reach −0.10 or −0.15.The differences also increase with increasing density parameter n 0 , density power-law index p, and temperature power-law index q.

Effect of beam smoothing
Up to now we have not considered the effect of beam smoothing on the observed profiles.Beam smoothing will produce a flattening of the observed radial profiles at the center of the envelope, in a region with a size of the order of the beam size.
In order to model the effect of a finite beam size, the radial profiles of the line intensities T L (1, 1; m), T L (1, 1; s), and T L (2, 2; m) were converted to 2D-maps.The maps were then 2D-convolved with a Gaussian beam pattern, and the resulting maps were ring-averaged to obtain the beam-smoothed radial profiles of the line intensities.From these, the homogeneous analysis was performed to obtain the radial profile of homogeneous temperature T hom k .In Fig. 9 we show the results for an envelope with a power-law density (r c = 0), at a distance of 1 kpc, for different beam sizes: no beam smoothing (top panel), and half-power beam widths (HPBW) of 1 ′′ , 3 ′′ , 10 ′′ , and 30 ′′ (second to fifth panels).As can be seen in the figure, the effect of beam smoothing is not noticeable for beam sizes less than 3 ′′ .The reason is that for the parameters of density and temperature of the envelope, the homogeneous temperature could not be derived for projected radii less than ∼ 2 ′′ , where the effect of beam smoothing is important.However, the effect of beam smoothing is very apparent for beam sizes of 10 ′′ and 30 ′′ , for which the radial profile of T hom k becomes flat for projected radii less than approximately the HPBW.
The result of beam smoothing for the same envelope, but with a Plummer-like density profile is shown in Fig. 10.In all three panels the beam is the same, HPBW = 3 ′′ , but the radius of the inner flat region is different: r c = 3 kau (top panel), 10 kau (center), and 30 kau (bottom).As can be seen, the discrepancy between the homogeneous temperature and the envelope temperature becomes important for values of r c larger than the beam size.Figure 9.Effect of beam smoothing on the radial profiles of the line intensities T L (1, 1; m) (red), T L (1, 1; s) (orange), T L (2, 2; m) (blue), and homogeneous temperature T hom k (black continuum line).The temperature of the envelope is indicated with a black dashed line.The beam HPBW (in arcsec) is indicated in each panel, and the beam profiles, with an arbitrary height at the origin of 100, are shown as green dotted lines.The parameters of the envelope are n 0 = 10 7 cm −3 , p = 2, T 0 = 50 K, q = 0.5, and ∆v = 0.5 km s −1 The distance is 1 kpc.At this distance, 1 arcsec corresponds to a length of 1 kau.

G14.2 Hub N and S
A well-suited observational case to apply the study presented above is the infrared dark cloud G14.225−0.506(hereafter G14.2), located at a distance of 1.98 kpc (Xu et al. 2011).The cloud consists of two is shown as a black solid line, and the temperature of the envelope is indicated with a black dashed line.The beam HPBW is 5 ′′ for all panels and the beam profile, with an arbitrary height at the origin of 100, is shown as a green dotted line.The parameters of the envelope are n 0 = 10 7 cm −3 , p = 2, T 0 = 50 K, q = 0.5, and ∆v = 0.5 km s −1 The distance is 1 kpc.At this distance, 1 arcsec corresponds to a length of 1 kau.main hubs, called Hub N and Hub S, being the center of a number of filamentary structures.This cloud has been deeply studied in NH 3 (1,1) and (2,2) using a combination of single-dish and interferometer.In particular, the cloud has been observed in NH 3 (1,1) and (2,2) with high angular resolution and with no missing short spacings, allowing to perform a reasonable study of its structure.A detailed description of the main observational results on G14.2 can be found in Busquet et al. (2013), Busquet et al. (2016), Santos et al. (2016), Ohashi et al. (2016), andChen et al. (2019).

G14.2 data description
The NH 3 (J, K) = (1, 1) and (2, 2) observations were carried out with the Very Large Array and the Effelsberg radio telescope.The data were combined, resulting in a final synthesized beam of 8. ′′ 17×7.′′ 00, P.A. = −15.• 1, and maps with a pixel size of 2 ′′ .A full description of the observations and data reduction can be found in Busquet et al. (2013).
The (1, 1) line was observed with 63 channels 0.62 km s −1 wide, with a velocity range between 2.8 and 41.2 km s −1 , encompassing the main line, the inner satellite lines, and one of the outer satellite lines.For the (2, 2) line, the number of channels was 15, with the same spectral resolution, and a velocity range between 16.5 and 25.2 km s −1 , encompassing the main line (see Fig. 11).

G14.2 data analysis
The NH 3 (1, 1) and (2, 2) lines in the two hubs were analyzed using the hfs_nh3_cube utility of the HfS tool (Estalella 2017).For every pixel, the spectra of the pixels inside a circle of 2 ′′ radius were averaged and the resulting (1, 1) and (2, 2) spectra were fitted simultaneously, obtaining the parameters of the lines: line width, central velocities and intensities of the (1, 1) and (2, 2) lines, and optical depths of the (1, 1) and (2, 2) main lines.From these, the standard homogeneous analysis provided the physical parameters pixel to pixel: excitation, rotational, kinetic temperatures, and column density of NH 3 .We show for Hub N (Fig. 12) and Hub S (Fig. 13), the integrated intensity, corrected for opacity, Aτ m ∆v, of the (1, 1) line (top panel) and (2, 2) line (middle panel), where A is the amplitude η B is the beam filling factor, τ m is the main line optical depth, and ∆v is the line width.The figure also shows the positions of the millimeter dust continuum sources detected with the Submillimeter Array (SMA) by Busquet et al. (2016).
The maps of the homogeneous temperature, T hom k , for Hub N and Hub S are shown in the bottom panels of the same Figs.12 and 13.The NH 3 (2, 2) integrated intensity are also shown as contours.These maps were used to average the values of T hom k in rings, 2 ′′ wide, centered on the position of the emission peaks in the hubs N and S at 350 µm observed with the Caltech Submillimeter Observatory (CSO) reported by Busquet et al. (2016).The CSO positions were chosen as center of the rings because the CSO angular resolution (9 ′′ ) is very similar to that of the NH 3 observations, and thus both observations are sensitive to similar structures at the same scale.These positions are shown as small circles in Figs. 12 and 13.The positions coordinates are α(J2000) = 18 h 18 m 12. s 53,   Table 3. G14.2 Hub N and S. Results from the fit of the observed T hom k radial profiles with the 2D-convolution of a power-law T = T 0h (r/r 0 ) −q h with a Gaussian beam of 7. ′′ 56.  3.They were chosen to avoid contamination from other dense clumps in the region, which produce an increase in temperature to the southeast of the center of the rings in both hubs.By constraining the range of PAs, we assure that the profiles are obtained in smooth regions unaffected by feedback from nearby sources.

Homogeneous analysis results
The T hom k radial profiles for Hub N and S are similar (Fig. 14), showing a flat profile for small radii, less than the beam radius, and a de-Table 4. G14.2 Hub N and S. Comparison of the power-law radial profile of temperature, T = T 0 (r/r 0 ) −q , from the dust emission and from the homogeneous analysis.

From dust a
From NH cline for large radii.We fitted the observed radial profiles with the 2D-convolution of a power law T 0h (r/r 0 ) −q h with a Gaussian with a HPBW of 7. ′′ 56.The best-fit values of the temperature at r 0 = 1 kau, T 0h , and the power-law index, q h , are shown in Table 3.The power-law homogeneous temperature obtained from the fit, deconvolved from the Gaussian beam, are shown as dashed lines in Fig. 14.As can be seen, although the results are similar for both hubs, the temperature of Hub S appears to be a bit steeper and with lower values than that of Hub N. Busquet et al. (2016) obtain the temperature radial profile from the submillimeter dust emission and spectral energy distribution (SED) fitting.Their results are shown in the left columns of Table 4.As can be seen, the NH 3 homogeneous analysis underestimates significantly the temperature value and power-law index of the envelope.Part of the differences can be attributed to the lack of dust-gas coupling in the lower-density region of the hubs (see, for instance Doty & Neufeld 1997).Indeed, Urban et al. (2009) find, for densities of 10 5 cm −3 and dust temperatures of 50 K, that the gas temperature can be lower by ∼ 20 K.However, the differences are compatible with the results obtained in Section 6 shown in Fig. 8.As reported in Busquet et al. (2016), both hubs have a flat inner region with a radius r c ≃ 20 kau, and for such a density distribution, we can expect T 0 differences of the order of −40%, and power-law index differences of up to ∼ −0.15, in accordance with the results obtained from the comparison with dust emission.

DISCUSSION AND CONCLUSIONS
The spherical envelope model, using a radiative transfer calculation of the intensities of the NH 3 (1, 1; m), (1, 1; s), and (2, 2; m) lines, allowed us to compare the kinetic temperature derived from the standard NH 3 analysis, the homogeneous temperature T hom k , with the actual temperature of the envelope.
Tests were performed with different characteristics of the envelope, similar to the typical values derived for massive dense cores and clumps.In many cases we found that there is a critical value of the projected radius below which no value of T hom k could be calculated, when the lines become optically thick enough.Near the critical value, the homogeneous temperature can be much higher than the envelope temperature.For larger projected radii, far from the critical value, the homogeneous temperature found from the standard NH 3 analysis was similar to the envelope temperature, but systematically underestimates the actual temperature T 0 and temperature powerlaw index q.In the case of a power-law density, n ∝ r −p , T 0 is underestimated by ∼ 20%, and q by ∼ 0.05.However, for a density with a central flat region, that is, a Plummer-like density, n ∝ (r 2 c + r 2 ) −p/2 , the discrepancy between the homogeneous temperature and the actual envelope temperature can be much higher, up to ∼ 40% in T 0 and ∼ 0.15 in q, for r c ≃ 10 kau.
We applied this study to the infrared dark cloud G14.2.We used the NH 3 (J, K) = (1, 1) and (2, 2) data obtained with the Very Large Array and the Effelsberg radio telescope for Hub N and Hub S. The data were analyzed using the homogeneous analysis, that is, standard NH 3 analysis with the assumption of homogeneity along the line of sight, providing a radial profile of homogeneous temperature, T hom k .The radial profiles were fitted by the convolution of a power law T h0 (r/r 0 ) −q h with a Gaussian beam of 7. ′′ 56.The homogeneous temperatures obtained from the G14.2 data were compared with the dust temperatures of Busquet et al. (2016).The lack of dust-gas coupling in the lower-density parts of the hubs could contribute to the observed discrepancies (∼ 40% in the temperature T 0 and ∼ 0.1 in the temperature power-law index q), but the discrepancies are in accordance with the expected results for envelopes with a central flat region.
Several conclusions can be drawn from this work.Regarding the homogeneous analysis of NH 3 (1, 1) and (2, 2) radial profiles, two results are relevant.Firstly, for small projected radii, where the optical depth of the lines is high, the homogeneous temperature can be much higher then the actual envelope temperature.Secondly, for larger projected radii, the temperature values and power-law indices derived from the homogeneous analysis could be seriously underestimated, depending on the density profile of the envelope.For powerlaw density profiles, with a very high density at small radii, characteristic of very young, Class 0 objects, the temperature can be underestimated by ∼ 20%, and the power-law index by ∼ 0.05.However, for density profiles with a flat central region, characteristic of more evolved, Class I and beyond objects, the effect is more severe.The temperature can be underestimated by as much as ∼ 40%, and the power-law index by ∼ 0.15.
A similar study for other commonly used dense gas tracers such as H 2 CO and CH 3 OCHO should be carried out to properly assess the validity of the temperature radial profiles inferred from dense gas thermometers.

APPENDIX A: RADIATIVE TRANSFER CALCULATION
In the following we will derive the intensities of the NH 3 (1, 1; m), (1, 1; s), and (2, 2; m) lines for a spherical envelope by integration of the radiative transfer equation, and calculate the homogeneous optical depths τ hom (1, 1; s) and τ hom (2, 2; s), and the homogeneous temperature T hom k derived from the homogeneous analysis.

A1 The radiative transfer equation
The radiative transfer equation is evaluated for every projected radius b.Let us consider the slab of geometrical width ∆z, and optical depth ∆τ, located at position z along the line of sight (see Fig. 5), with z 2 + b 2 = r 2 .For this elementary slab with optical depth ∆τ ν , the incoming intensity at z is attenuated a factor exp(−∆τ ν ), and is increased by the average source function of the slab, times [1 − exp(−∆τ)], where z can be approximated by the center of the slab, z = z + ∆z/2.By subtracting I ν (z) on both sides of the equation and rearranging terms the equation can be written as The source function S ν is defined by the excitation temperature T ex Equation A2 can be written in terms of the brightness temperature T b (giving the intensity) and the excitation temperature T ex (giving the source function), Assuming that the excitation temperature of the (1, 1) transition is given by the two-levels model, T ex can be expressed as a weighted average of the kinetic and brightness background temperatures, T k and T bg , where the weight factor y is A 11 is the spontaneous emission coefficient, n is the hydrogen density, n(H 2 ), and γ 11 is the de-excitation collisional coefficient, Thus, for the slab of material between z and z + dz we consider T k = T (r), and a background temperature given by the brightness temperature of the incident radiation from the preceding slab, T bg = T b (z).Then, the excitation temperature of the (1, 1) transition for this slab is obtained from Eq. A5.For the (2, 2) transition we take the same excitation temperature.

A3 Optical depth τ
Once the excitation temperature is known, we can estimate the elementary optical depths of the (1, 1; m), (1, 1; s), and (2, 2; m) lines for the slab, with the volume densities n 11 and n 22 given by n 11 = f 11 (T (r)) X n(r) (A9) where the fractional abundances f 11 and f 22 are given by Eqs. 14 and 15, with the rotational temperature calculated from the kinetic temperature (Eq.12).

A4 Iterative scheme
For any given projected radius b, the integral along the line of sight has to be evaluated from −z max to z max , where τ(2, 2 For a given z, we have determined from the preceding step the values at z of the optical depths τ(1, 1; m), τ(1, 1; s), τ(2, 2; m), and the brightness temperatures of the lines, T b (1, 1; m), T b (1, 1; s), T b (2, 2; m).
An example of the integration along the line of sight is shown in Fig. A1, for a power-law density with three different values of the density.For n 0 = 10 6 cm −3 the three lines, (1, 1; m), (1, 1; s), and (2, 2; m) are optically thin; for n 0 = 10 7 cm −3 the (1, 1; m) line is moderately optically thick; and for n 0 = 10 8 cm −3 the three lines are optically thick, the (1, 1; m) line being very thick (middle panel).In the latter case we see that the three lines present self-absorption from the colder gas of the part of the envelope facing the observer, for z > 0 (bottom panel).For the (1,1:m) line, optically thicker than the others, the self-absorption is higher, resulting in an intensity lower than those of the (1, 1; s) and (2, 2; m) lines.

A5 Results
In Fig. A2 we show an example of results obtained for an envelope with a power-law density profile, at a distance of 1 kpc.For this distance, an angular size of 1 ′′ corresponds to a linear size of 1 kau = 1000 au.The parameters of the envelope are a reference radius r 0 = 1 kau, density parameter n 0 = 10 7 cm −3 , density power-law index p = 2, radius of the inner flat region r c = 0, temperature at r 0 , T 0 = 50 K, temperature power-law index q = 0.5, line width ∆v = The envelope parameters are a reference radius r 0 = 1 kau, density parameter n 0 = 10 6 cm −3 (top), 10 7 cm −3 (middle), and 10 8 cm −3 (bottom), density power-law index p = 2, radius of the inner flat region r c = 0, temperature at r 0 , T 0 = 50 K, temperature power-law index q = 0.5, line width ∆v = 0.5 km s −1 , minimum density n min = 10 3 cm −3 , minimum temperature T min = 8 K, and NH 3 abundance X = 10 −8 .0.5 km s −1 , minimum density (setting the envelope radius) n min = 10 3 cm −3 , minimum temperature T min = 8 K, and NH 3 abundance X = 10 −8 .The top panel shows the radial profiles of temperature of the envelope (dashed line), line intensities, T L (1, 1; m), T L (1, 1; s), T L (2, 2; m), and homogeneous temperature T hom k .The middle panel shows the radial profiles of optical depths of the lines, τ(1, 1; m), τ(1, 1; s), and τ(2, 2; m), calculated from the integration along the line of sight (dashed lines), and estimated from the homogeneous analysis (continuum lines).
As can be seen in the top panel, for small values of the projected radius the homogeneous temperature T hom k could not be derived.The reason is that for b below a critical value of 1.94 kau, the intensity of the (2, 2) line is too high to fulfil the condition of Eq.21, and τ hom (2, 2; m) could not be calculated (see bottom panel of Fig. A2).The failure of the homogeneous analysis is a consequence of the (1, 1; m) line being optically thick for small b, and thus tracing the cold part of the envelope facing the observer, while the (2, 2; m) line, with a lower optical depth, is tracing hotter gas near the center of the envelope.For values of the projected radius near the critical value given above, the optical depth of the (2, 2) line derived from the homogeneous analysis is much higher than the actual optical depth, and the homogeneous temperature can be very different from the envelope temperature.For larger projected radii, far from the critical value, the radial profile of the homogeneous temperature is similar to, but systematically below that of the envelope temperature.

A6 Comparison with LIME
The Line Modelling Engine (LIME) (Brinch & Hogerheijde 2010) was used to compare the spherical envelope model with a full radiative transfer calculation.LIME assumes that the gas and dust tem-peratures are the same.Unfortunately, the collision coefficients of the quadrupole-hyperfine transitions of NH 3 are not available in the literature.
LIME was run using the molecular data for para-NH 3 from the Leiden Atomic and Molecular Database (LAMDA) (Schöier et al. 2005), which contains energy levels, transition frequencies, Einstein coefficients of the inversion transitions, and the collision rates with para-H 2 .The output of LIME provided us the radial profiles of the intensities and optical depths of the inversion transitions NH 3 (1, 1) and (2, 2), T L ( j, k) and τ( j, k).The intensity of the main and inner satellite quadrupole-hyperfine lines was then estimated as From these intensities, the standard NH 3 analysis was performed to obtain the homogeneous temperature radial profile.
The LIME calculation assumes that the five quadrupole-hyperfine lines of each inversion transition are completely blended, with an optical depth that is the total optical depth of the inversion transitions.So, the inversion optical depths calculated by LIME are higher than the actual optical depths of the hyperfine lines.As a consequence, for partially thick emission, the region contributing to the LIME intensity is closer to the observer (that is, farther from the envelope center, and so cooler and less dense) than for the hyperfine intensity.Thus, we expect discrepancies between LIME calculations and the radiative transport calculations of this work, which could be more important in the optically thick regime.
In the left panels of Fig. A3 we show the line intensities T L (1, 1; m), T L (1, 1; s), T L (2, 2; m), and homogeneous temperature T hom k for three different density parameters, n 0 = 10 6 , 10 7 , and 10 8 cm −3 calculated with LIME.In all three cases the homogeneous temperatures obtained from the the LIME calculation, at the projected radii where it can be calculated (solid black line), are near the envelope temperature.
In the right panels of Fig. A3 we show, for comparison, the same results calculated with the spherical envelope model of this work.As can be seen, at low densities (n 0 = 10 6 cm −3 ) there is a good agreement between the line intensities calculated by both methods, while at higher densities the discrepancies are most probably due to the overestimation of the optical depths made by LIME, as discussed above.Thus, despite the shortcomings of the LIME calculations, there is a general agreement in the line intensities and, more important, a good agreement between the homogeneous temperature T hom k derived from both methods.In conclusion, we can say that the radiative transfer calculation used in the present work is correct.This paper has been typeset from a T E X/L A T E X file prepared by the author.

Figure 4 .
Figure4.Plummer-like density as a function of radius for the same values of r 0 , n 0 , and p, and two different values of r c , one lower (red lines) and the other higher (blue lines) than r 0 .The red and blue dots indicate the actual density of the envelope at r 0 , n(r 0 ), while the black dot indicates the density parameter n 0 (see text).

Figure 7 .
Figure 7. Radial profiles of the homogeneous temperature T hom k (solid lines)for an envelope with a Plummer-like density profile with different values of the radius of the inner flat region, r c = 0, 1, 3, 10, and 30 kau.The top panel is for a density n 0 = 10 7 cm −3 , and the bottom panel for n 0 = 10 8 cm −3 .The dashed lines indicate the radial profiles of the actual kinetic temperature of the envelope.For both panels the envelope is at a distance of 1 kpc, with p = 2, T 0 = 50 K, q = 0.5, and ∆v = 0.5 km s −1 .The values of r c (kau) and the resulting central densities n c (cm −3 ) are indicated in each panel.In the bottom panel, the profiles for r c = 0, 1, and 3 are nearly coincident.
Figure8.Comparison of the power-law radial profile of the envelope temperature, T = T 0 (r/r 0 ) −q , and of T hom

Figure 10 .
Figure 10.Effect of beam smoothing for a Plummer-like density profile for different values of the radius of te inner flat region, r c = 0.3, 1, and 3 kau.The radial profiles of the line intensities are shown as a red line for T L (1, 1; m), an orange line for T L (1, 1; s), and a blue line for T L (2, 2; m).The homogeneous temperature T hom k

Figure 12 .
Figure 12.G14.2, Hub N. Top and middle panels: NH 3 (1, 1) and (2, 2) main line integrated intensities, corrected for opacity, Aτ m ∆v (see main text in § 7.3).The color scale is in units of K km s −1 .Bottom panel: homogeneous temperature T hom k .The color scale for T hom kgoes from 10 to 21 K.The contours are the integrated NH 3 (2, 2) emission, starting at 0.1 K km s −1 with steps of 0.05 K km s −1 .For all panels the crosses mark the positions of the SMA mm sources MM1 and MM3, in order of increasing RA, and the circle marks the position of the 350 µm emission peak(Busquet et al. 2016).The beam is shown in the bottom-left corner of each panel.

Figure 13 .
Figure 13.G14.2, Hub S. Top and middle panels: NH 3 (1, 1) and (2, 2) main line integrated intensities, corrected for opacity, Aτ m ∆v (see main text in § 7.3).The color scale is in units of K km s −1 .Bottom panel: homogeneous temperature T hom k .The color scale for T hom kgoes from 10 to 21 K.The contours are the integrated NH 3 (2, 2) emission, starting at 0.1 K km s −1 with steps of 0.05 K km s −1 .For all panels the crosses mark the positions of the SMA mm sources MM2 to MM9, in order of increasing right ascension, and the circle marks the position of the 350 µm emission peak(Busquet et al. 2016).The beam is shown in the bottom-left corner of each panel.
Figure 14.G14.2: T hom k radial profile obtained from the maps of Figs. 12 and 13 (small circles and error bars), for Hub N (red) and Hub S (blue), in a log-log scale.The error bars indicate the rms dispersion of the values of T k averaged in each ring.The red and blue solid lines are the best fit to the radial profiles, with the 2D-convolution of a Gaussian beam of 7. ′′ 6 with a power law T hom k = T 0h (r/r 0 ) −q h .The dashed lines are the T hom k power-law profiles deconvolved from the Gaussian beam.

a
Temperature at r 0 = 1 kau.b Maximum radius and range of position angles used to obtain the T hom k radial profile.c χ r = χ 2 /(n − 1).δ(J2000) = −16 • 49 ′ 28.′′ 2 (Hub N), and α(J2000) = 18 h 18 m 13. s 06, δ(J2000) = −16 • 57 ′ 19.′′ 2 (Hub S).The radial profiles obtained for T hom k are shown in Fig. 14 as small circles and error bars.The error bars are the rms dispersion of the values of T hom k averaged in each ring.The maximum radius and range of position angles (PA) used are given in Table

Table 2 .
Degeneracies and energies above the (1, 1) level of the lower metastables levels of NH 3