Main

We analyse Hubble Space Telescope (HST) Space Telescope Imaging Spectrograph (STIS) near-ultraviolet spectra of 25 bright type-O and type-B stars in the Galaxy. When available, we include archival Very Large Telescope (VLT) Ultraviolet and Visual Echelle Spectrograph (UVES) high-resolution optical spectra of these targets. The selection of the 25 stars in our sample, as well as the data collection and handling, is described in Methods and the sample properties are listed in Extended Data Table 1. The locations of our targets on the Galactic plane are visualized in Fig. 1.

Fig. 1: Location of our targets on the Galactic plane.
figure 1

Left, artistic impression of the Galaxy, face-on. Image courtesy of NASA/JPL-Caltech/R. Hurt (SSC/Caltech). Right, the location of our targets is marked on the same illustration of the Galaxy, but zoomed-in on the star-forming spiral arms in the Solar neighbourhood. The metallicity of the neutral gas along these lines of sight (Extended Data Table 3) is highlighted with the greyscale. 1 kpc ≈ 3.09 × 1019 m.

Source data

We identify and analyse the absorption lines from Mg i, Al ii, Si ii, Cr ii, Fe ii, Co ii, Ni ii, Zn ii and Ti ii. A selection of absorption lines in the spectra of our targets are shown in Extended Data Fig. 1. The column density measurements are explained in Methods and reported in Extended Data Table 2. We report 3σ significance levels for the quoted limits and 1σ for the quoted errors, unless otherwise stated.

We determine the neutral gas metallicity using two independent approaches and with different assumptions, which we call the ‘relative’ method and the ‘F*’ method. Both methods aim to characterize the strength of dust depletion along Galactic lines of sight, and are described in Methods (equations (1)–(8)). We use both methods to cross-check our results. In brief, the F* and relative methods use either the gas-phase abundances or the relative abundances to estimate by how much the observations are affected by dust depletion based on the empirical relations of ref. 8 or ref. 9, respectively. Each method uses a specific parameter to estimate the overall amount of dust depletion in a system, either [Zn/Fe]fit or F*, as explained in Methods.

The individual dust-corrected abundances derived with the relative method are shown in Fig. 2, for individual metals. Figure 3 shows the total metallicities towards the 25 lines of sight in our sample, which are listed in Extended Data Table 3 and derived with the relative and F* methods from the fit to the data in Extended Data Figs. 2, 3, respectively. We measure total metallicities [M/H]tot ranging between −0.76 dex and +0.26 dex, where about two-thirds of our sample show subsolar metallicities. The average metallicity in our sample is −0.26 ± 0.06 dex (that is, 55 ± 7% solar) with a standard deviation of 0.28 dex. The most notable result is that the maximum variations between lines of sight are more than an order of magnitude, mostly subsolar. In Methods, we test this result for different assumptions. The result holds regardless of the assumptions. It is possible that the low metallicities that we measure represent a mix of two different gases, namely a nearly solar interstellar medium (ISM) component with high depletion levels with the injection of significant amounts of pristine gas with zero depletion and metallicities even lower than what we measure (Methods).

Fig. 2: Dust-corrected abundances in the neutral ISM.
figure 2

Dust-corrected abundances of Si (light-blue triangles), Ti (blue stars), Cr (green diamonds), Fe (vermilion squares), Ni (pink crosses) and Zn (yellow squares) using the relative method. Stars are labelled in order of HD number (Extended Data Table 1). The error bars show the 1σ uncertainties.

Source data

Fig. 3: Metallicities in the neutral ISM.
figure 3

Dust-corrected metallicities are marked with circles: the filled blue circles are derived with the relative method and the open green circles with the F* method. The open yellow triangles show the observed [Zn/H], and thus represent a lower limit to the true metallicity. Stars are ordered with increasing metallicity. In our sample, 15 out of 25 lines of sight are more than 3σ away from solar metallicity (horizontal dashed line). The error bars show the 1σ uncertainties.

Source data

In addition, for some cases where we measure a low metallicity, the most volatile elements (for example, oxygen, carbon and krypton) show some disagreement with the mildly depleted elements (for example, zinc) and the more refractory elements (Extended Data Fig. 3). This is well explained by the presence of inhomogeneities in the ISM, where nearly solar-metallicity gas is mixed with large amounts of pristine gas with zero depletion and low metallicity (for example, 10% solar or lower), as we discuss in Methods.

Although the metallicity of the Sun is about 0.2 dex higher than the expected metallicity of H ii regions at a Galactic radius of 8.2 kpc10, this is not enough to explain our results. Local chemical dilution or enrichment in the ISM could be caused by infalling gas or star formation, respectively, but the survival of such chemical inhomogeneities is not straightforward. A previous work11 found that chemical enrichment due to supernovae can induce only small metallicity deviations of Z ≲ 10−1 between waves of star formation, after which Galactic rotation can mix the gas in a volume of about 0.1 kpc3 within a timescale of 2.8 × 108 yr. However, dilution of disk metallicities to lower values could be caused by accretion of pristine gas, and these inhomogeneities could survive. Chemical evolution models indicate that low-metallicity gas infalling from the halo is necessary to fuel star formation and reproduce stellar abundance patterns12,13. Moreover, the large dispersion of the stellar age–metallicity relation14 suggests a chemically inhomogeneous disk4. Episodic gas infall could produce pockets of low-metallicity gas and be responsible for the stellar age–metallicity scatter15. Analytical inhomogeneous chemical evolution models, which include non-instantaneous mixing of both infalling low-metallicity gas and enriched gas from star formation, showed that significant chemical inhomogeneities due to gas infall (or star formation) will arise if the mass of the new gas cloud is at least about 1/20 times the overall mass of the gas it is mixing into16. Simulations of supernova-driven metal enrichment and ISM mixing suggest that subkiloparsec-scale inhomogeneities in the ISM should survive at least on timescales of the order of 350 Myr17. Small subparsec-scale variations have been observed in the ISM18,19.

Both observations and simulations indicate that gas infall onto the Galaxy halo is metal poor, with high-velocity cloud (HVC) metallicities observed in the range of 0.1–1 solar20 and cosmological simulations predicting infalling gas to have metallicities as low as 0.01 solar21. More detailed zoom-in simulations show that infalling HVCs can fragment to scales below 30 pc and disperse on timescales of tens to hundreds of million years as they mix into the surrounding medium22,23. Metallicity inhomogeneities can therefore be smoothed out on these timescales. HVC clouds tend to have individual H i masses of a few 105M to 106M (in which M is the mass of the Sun), for a total M(H i)tot ≈ 107M for our Galaxy20. Intermediate velocity clouds (IVCs), which tend to have higher metallicities (solar) and smaller distances (<1–2 kpc) than HVCs24,25, may also contribute to the dilution or enrichment of the ISM.

The rate of gas accretion on the Galaxy disk currently measured (0.1–1.4 M yr−1) (refs. 26,27) is a factor of about 100 larger than the minimum required to sustain the formation and survival of chemical inhomogeneities, as we estimate in Methods. Therefore, not only could pockets of low-metallicity/pristine gas exist but also they could in fact be very common. Here we found that two-thirds of our sample showed subsolar metallicity, but these measurements are integrated along the lines of sight, so that more pockets of lower-metallicity gas could exist. The minimum physical scale of the metallicity variations that we observe is of the order of tens of parsecs, and possibly down to a few parsecs (Methods). Our methodology opens up the possibility of comparing the metallicity of the neutral gas with the metallicity of stars and their H ii regions, although this is not a straightforward comparison, as we discuss in Methods.

Finally, we find no positive correlations between the total metallicities and the reddening, or colour excess, between the blue and visual filters, E(B − V), meaning that we do not observe higher reddening towards regions of higher metallicity. We do not find a significant correlation between RV and metallicity, but we note that θ1 Orionis C and ρ Ophiuchi A have high values of the total to selective extinction, RV (Extended Data Table 1). The dilution of the ISM with lower-metallicity gas may have a role in explaining these effects. We do not observe any significant signs of a radial metallicity gradient in the gaseous disk, as shown in Extended Data Fig. 4. The observed metallicity gradients in the Galaxy have slopes of up to about −0.07 dex kpc−1, from measurements of stars28 and H ii regions10, but they are probed over several kiloparsecs. Our measurements cover a much narrower range (3 kpc) and with smaller statistics. A larger sample is needed for further conclusions on a potential gradient. We also do not observe any trend of metallicity with Galactic height, as shown in Extended Data Fig. 4. Thus, it is unlikely that the accreting gas is evenly distributed above the disk, but it is consistent with being clumpy, as in HVCs or tidal streams. However, our targets mostly lie within the young thin disk, probing small height scales. The global effects in chemical enrichment of inflowing and outflowing gas above the galaxy disks can be more evident at circumgalactic scales29.

We conclude that we have measured large local variations of metallicity in the neutral ISM in our Galaxy probably due to accretion of low-metallicity gas. Thus, we recommend changing the common assumptions that the gas in galaxies is well mixed and the gas in the Galaxy has solar metallicity in the solar vicinity, which are widely used both in observational and theoretical works, and in particular for the study of the chemical evolution of the Galaxy. Our findings that the gas is inhomogeneously distributed (not only chemically) indicate that the gas mixing is more inefficient than previously thought. One of the potential causes could be the fact that the different phases involved in the mixing have widely different kinematics and different physical conditions. In addition, substantial sustained gas inflow may contribute to the clumpiness and turbulent nature of the disk in addition to gravitational instabilities.

Methods

Sample selection and data collection

We select 25 stars and observe them as part of the cycle 25 HST programme ID 15335 (principal investigator A.D.C.). The sample was selected to include hot stars (spectral type O or type B) that have line-of-sight measurements of H i, H2 and Tiii in the literature30,31,32, high-enough rotational velocities (≳50 km s−1) to allow us to disentangle between stellar and ISM features in the spectra, and fairly diverse values of dust reddening and Galactic longitude. The distances r are taken from the Gaia Data Release 2 (DR2) archive33,34. The values of H i and H2 are taken from ref. 31 and ref. 32, respectively, as also collected by ref. 30 for most of our targets, and assuming their average uncertainties of 0.1 dex. For HD 62542, we adopt the column densities of atomic and molecular hydrogen from ref. 35. The main characteristics of the 25 selected stars are reported in Extended Data Table 1.

The reddening E(B − V) of the stars in our sample is taken from ref. 31 and spreads between 0.07 mag and 1.08 mag. The values of the optical total-to-selective extinction ratio, RV = AV/E(B − V), in which AV is the dust extinction in the visual band, are taken from the maps of ref. 36 and show variations between 2.6 and 5.7. The positions of the stars are distributed in Galactic longitude, their distances are within 2.7 kpc from the Sun and they lie within 0.3 kpc from the disk plane. All lines of sight have total hydrogen column densities (N(H) = N(H i) + 2 × N(H2)) that are high enough to shield the gas against photoionization2. We further discuss potential ionization effects below.

All stars are observed with the same HST/STIS Near-UV echelle setting E230M (at a central wavelength setting of 1,978 Å), which covers the absorption lines between about 1,605 Å and about 2,832 Å with a resolving power R = Δλ/λ ≈ 30,000 at wavelength λ.

We further collected all the available reduced VLT/UVES spectra in the European Southern Observatory (ESO) Science Archive covering Ti ii λ3230, 3242, 3384 lines for our sample, which are available for 16 of our targets and have R ≈ 71,050. We stack the spectra for each star to maximize the signal-to-noise ratio, and measure the Ti ii column densities in the same way as for the other metals, which are reported in Extended Data Table 2. In the event that no data that cover Ti ii are available, we adopt the Ti ii column densities of ref. 30.

For the star HD 62542, we include the column densities that were recently measured by ref. 35 from HST data at a higher spectral resolution. Given the better quality of these data, we adopt their column densities for both of their velocity components summed together for our analysis.

Analysis of the absorption features and column-density determination

We identify and analyse the following absorption lines: Mg i λ1827, 2026; Al ii λ1670; Siii λ1808; Tiii λ3230, 3242, 3384; Cr ii λ2056, 2062, 2066; Fe ii λ2344, 2260, 2249; Co ii λ2012, 1941 (although we did not use the column densities of Co ii in our analysis); Ni ii λ1741, 1709, 1751; Zn ii λ2026, 2062. The line profiles of the Zn ii λ2026, Cr ii λ2056 and Fe ii λ2260 transitions are shown in Extended Data Fig. 1. The velocity extremes over which we performed absorption line measurements appear to be well defined by the maximum extent of the very strong Fe ii λ2344 transition. We used the most recent oscillator strengths (f values), listed in Extended Data Table 4. We determined the column densities by integrating the apparent optical depths (AODs)37 over all velocities between these extremes, regardless of the appearance of the line in question. This procedure guaranteed that we did not overlook weak parts of an absorption buried in the noise, and also prevented us from defining a continuum level partly within the extent of such absorption. We defined continuum levels from best-fitting Legendre polynomials to fluxes on either side of the absorption profiles. Some lines appeared to be saturated or nearly so; in such cases, the AOD method can underestimate the true column density. When the lowest part of a feature seemed close to the zero intensity level but still had a pointed appearance, we considered saturation to be taking place and declared the measurement as a lower limit. The Fe ii λ2344 line was often heavily saturated, but weaker Fe ii lines (λ2260, 2249) were well constrained. In most circumstances, the two lines of Zn ii did not appear to be appreciably saturated, but the fact that the stronger λ2026 line consistently gave a column density that was lower than the weaker λ2062 line indicated that some unresolved saturation was still creating column-density outcomes that were below the true ones. To overcome this problem, we invoked the scheme proposed by ref. 38 that applies a correction to arrive at a more accurate column density. The contribution of nearby Mg i λ2026 and Cr ii λ2062 features were taken into account for the calculation of the Zn ii column density. We estimated errors for the column densities from the effects of three different sources: (1) noise in the absorption profile, (2) errors in defining the continuum level and (3) uncertainties in the transition f values, all of which were combined in quadrature. Continuum placement errors can have a large influence in the uncertainties of weak lines. We evaluated the expected deviations produced by such errors by remeasuring the AODs at the lower and upper bounds for the continua, which were derived from the expected formal uncertainties in the polynomial coefficients of the fits as described by ref. 39. We multiplied these coefficient uncertainties by two to make approximate allowances for additional deviations that might arise from some freedom in assigning the most appropriate order for the polynomial. We considered a measurement to be marginal if the equivalent width outcome was less than the 2σ level of uncertainty from noise and continuum placement. For weak lines below this uncertainty threshold, we specified an upper limit for the column density. Details of how we calculated these 1σ upper limits are given in appendix D of ref. 40. If the strongest transition yielded an upper limit or a very marginal detection, no attempt was made to measure considerably weaker ones except when a weaker line was in a much better part of the spectrum (higher signal-to-noise ratio or a more easily defined continuum).

We use a linear unit for the column densities N in terms of ions per square centimetre. We refer to relative abundances of elements X and Y as \([{\rm{X}}/{\rm{Y}}]\equiv \,\log \,\frac{N({\rm{X}})}{N({\rm{Y}})}-\,\log \,\frac{N{({\rm{X}})}_{\odot }}{N{({\rm{Y}})}_{\odot }}\), where reference solar abundances are listed in ref. 9.

Potential saturation effects and comparison with the Voigt-profile fit method

Saturation effects do not have an important role for the results presented in this Article. If present, any potential saturation effect must be small, and in particular much smaller compared with the strong effects of dust depletion. This can be immediately appreciated by the small deviations from the linear fits in Extended Data Figs. 2, 3. In addition, if saturation of Zn ii was an issue, we should see more deviations in the dust-corrected abundances of Zn at solar metallicity (Fig. 2), which are not observed.

Nevertheless, we tested the robustness of the column-density determinations with the AOD method with an independent method, the Voigt-profile fit, which decomposes and models the line profiles in their individual velocity components and fits all transitions simultaneously. The Voigt-profile fit can use narrow broadening-parameters (b values) to account for saturation. These tests are aimed at further assessing the potential saturation of Zn ii absorption lines. The saturation for other ions considered here is less probable because of the availability of weaker absorption lines to measure. Using the VoigtFit software41, we model lines of Zn ii and Cr ii towards the eight targets that have the strongest Zn ii absorption and show potential for saturation (Extended Data Fig. 4) and with a column density of Zn ii constrained with the AOD method (Extended Data Table 2), namely: θ1 Ori C, HD 73882, HR 4908, θ Muscae, HD 149404, HD 154368, HD 199579 and HD 206267. This includes the most troublesome target, θ1 Ori C, which we discuss below.

For the seven out of the eight lines of sight tested, with the exception of θ1 Ori C, the column densities of Cr ii measured with the AOD and Voigt-profile fit are in excellent agreement (mostly within 0.03 dex and consistent within the errors) and the column densities of Zn ii measured with the Voigt-profile fit differ by +0.03, +0.22, −0.1, −0.1, −0.02, −0.08 and + 0.06 dex with respect to the AOD results, corresponding to 0.2, 1.8, 2.6, 1.0, 0.3, 1.0 and 0.5σ (Z-test) for HD 73882, HR 4908, θ Mus, HD 149404, HD 154368, HD 199579 and HD 206267, respectively. These are mostly typical values for the comparison between AOD and the Voigt-profile fit. The larger discrepancies are measured for HR 4908 and θ Mus, towards which we estimated near-solar metallicity (Extended Data Table 3).

A different picture arose for θ1 Ori C, for which we measured significant differences of +0.33 dex and +0.45 dex with respect to the AOD results, corresponding to 7.4σ and 3.6σ (Z-test), for Zn ii and Cr ii, respectively. However, the Voigt-profile fit of the HST/STIS data was not well constrained for this system. This is probably caused by the extreme complexity of this line of sight42, which cannot adequately be decomposed with the sampling of 5 km s−1 per pixel of the HST/STIS data. However, with a Voigt-profile fit to the VLT/UVES data, we obtained consistent measurements (within 1σ) with the AOD Ti ii results and the results of ref. 42 for Ca ii. The complexity of this line of sight may also explain the discrepancies among the different metals that we observe in Extended Data Figs. 2, 3. In the latter, the Zn ii column is significantly below the linear fit, so that an increase in Zn ii column would not affect heavily the result. These discrepancies are the likely cause of the difference in metallicity that we measured towards this line of sight with the relative and F* methods (Extended Data Table 3).

Overall, our results hold regardless of whether the Voigt-profile fit or AOD method is used for estimating the column densities.

Ionization effects on column-density measurements

Owing to the background radiation field in the ISM, the atoms in the gas phase are found in various ionization states (for example, C ii/C iv and Al ii/Al iii). In the neutral medium, the singly ionized metals are the dominant species due to their ionization potentials relative to that of H i. To obtain metallicities, we assume that other ionization states are negligible such that \(N({\rm{X}})/N({\rm{H}})=\sum _{i}N({{\rm{X}}}_{i})/(N({\rm{H}}\,{\rm{I}})+{\rm{N}}({\rm{H}}\,{\rm{II}}))\), where the summation is over all ionization states (i) of a given metal, X. However, if the total integrated absorption line arises from many unresolved components with varying physical properties, it is possible that this assumption does not hold for individual components. Such ionization corrections could therefore affect our conclusions about a difference in metal enrichment being the driver of the variations in the depletion sequences.

In all but three lines of sight, we detect absorption from neutral carbon (with an ionization potential lower than that of H i), which indicates that the gas phase must be highly shielded by H i. For the three cases where no clear C i absorption is seen (ε Persei, ι Ori and ζ Ori A), the non-detections are consistent with the overall low optical depth of other lines. The C i line profiles resemble those of the singly ionized metals indicating that they arise from the same gas phase. These facts provide strong evidence that the gas is effectively shielded; hence, ionization corrections can be neglected.

If ionization effects were the culprit of the observed deviations in the relative abundances, and not differential dust depletion, then the oxygen abundance should not follow those of the other volatile elements given the tight relationship between H i and O i (due to charge exchange reactions). However, in the cases where we can constrain the oxygen abundance, we see that it does indeed show the same behaviour as the heavier volatile elements. This further bolsters our conclusion that ionization effects are negligible.

The relative and F* methods to measure the ISM metallicity

To measure the ISM metallicity, it is essential to quantify the amount of metals that are missing from the observable gas phase but instead are incorporated into dust grains, which is the phenomenon of dust depletion6,7,8,9,43,44,45. The dust-corrected (total of gas and dust) abundances can be defined as

$${[{\rm{X}}/{\rm{H}}]}_{{\rm{tot}}}=[{\rm{X}}/{\rm{H}}]-{\delta }_{{\rm{X}}}\,,\,$$
(1)

where [X/H] is the observed abundance of metal X and δX is its depletion in dust (which is a negative term in this classical notation). Here no other effects such as nucleosynthesis or ionization are taken into account. The depletion δX is linearly proportional to the overall strength of depletion8,9,45. The overall strength of depletion can be represented in different ways, for example, from the observed relative abundances, as in the relative method, or with a specific parameter F*, as in the F* method.

The relative method was first introduced by ref. 9, which compared Galactic and extragalactic observations. To estimate the overall strength of depletion, this method uses any relative abundance [X/Y] where X and Y follow each other in nucleosynthesis, but have very different refractory properties. A dust tracer can be [Zn/Fe], or other relative abundances such as [Si/Ti] or [O/Si]. Previous work46 discusses in more detail why [Zn/Fe] is a reliable dust tracer in the metallicities ranges considered here. The depletion of element X, δX, is obtained from the observed correlation between [X/Y] (with Y being non-refractory, such as S or P; here we use Zn) and the dust tracer [Zn/Fe] (or any other dust tracer). The dependency of [X/Zn] on the depletion of Zn can be removed by assuming a certain slope for the expected depletion of Zn with the dust tracer, BδZn. Then δX can be derived as follows:

$${\delta }_{{\rm{X}}}=A{2}_{{\rm{X}}}+B{2}_{{\rm{X}}}\times [{\rm{Zn}}/{\rm{Fe}}]\,,\,$$
(2)

where A2X and B2X are empirically determined coefficients and are reported in Extended Data Table 5. The simplest version of the relative method uses directly the observed [Zn/Fe] to estimate the dust depletion of the different metals. However, the information on all metals can be used simultaneously to determine the overall strength of the dust depletion with the parameter [Zn/Fe]fit, which is equivalent to [Zn/Fe] but is derived from the information of all metals. Merging equations (1), (2), and using the basic definition of [X/H], it is possible to find the dust-corrected metallicity and overall strength of depletion from the observed metal column densities, through a fit of the linear relation

$$y=a+bx\,,\,$$
(3)

where

$$a={[{\rm{M}}/{\rm{H}}]}_{{\rm{tot}}}\,,\,$$
(4)
$$b={[{\rm{Zn}}/{\rm{Fe}}]}_{{\rm{fit}}}\,,\,$$
(5)
$$x=B{2}_{{\rm{X}}}\,,\,$$
(6)
$$y=\,\log \,N({\rm{X}})-\,\log \,N({\rm{H}})-\,\log \,(X/{\rm{H}}){}_{\odot }-A{2}_{{\rm{X}}}$$
(7)

and considering the uncertainties on both x and y. x and y represent the depletion data for different metals, and we fit a linear relation to this data to find the parameters a and b, which are unique to each system. In this way, the y intercept (at x = 0) of the fitted relation gives the total metallicity, [M/H]tot, and its slope gives the overall strength of depletion, [Zn/Fe]fit. Extended Data Fig. 5 illustrates this procedure for our sample. The fitted and observed [Zn/Fe] often agree well (Extended Data Table 3).

Changes in relative abundances could in principle be caused by nucleosynthesis processes or other reasons. In particular, deviations from the curves of Extended Data Figs. 2, 3 could in principle be caused by nucleosynthesis. However, the relative abundance patterns that we observe here mostly follow the refractory properties of the metals, rather than their nucleosynthesis origin, and are therefore caused purely by dust depletion. We do not expect the infalling gas to have been enriched in specific metals or show or have any peculiar abundances due to different nucleosynthetic history. Alternatively, one could have the opportunity to investigate such peculiar abundances by studying eventual deviations from the depletion patterns.

The choice of B1δZn is the main assumption of the relative method used here to find dust-currected metallicities. First, it is reasonable to assume that δZn correlates linearly with [Zn/Fe] or other dust tracers, because this is observed for all other metals8,9. Moreover, we know that at [Zn/Fe] = 0, there is no dust depletion of non-carbonaeous species and we can safely assume no depletion of Zn, that is, δZn = 0 at [Zn/Fe] = 0. Thus, the main free parameter in the assumption of the Zn depletion is the slope of the relation of δZn with [Zn/Fe], B1δZn. Here we assume B1δZn = −0.27 ± 0.03 derived by ref. 9. We conservatively test our results for different slope assumptions, as described below, to ensure that our ultimate results are not affected. Notably, the A2X and B2X coefficients for Ti are not well constrained so far, and this is a weakness of the relative method. However, this does not affect the overall results of this Article, which can mostly be derived already from the basic version of the relative method, using only the observed [Zn/Fe] and regardless of Ti, with the exception of those systems where N(Zn) is not constrained.

The F* method, first developed by ref. 8, characterizes the dust depletion in Galactic clouds, by correlating all the observed abundances and minimizing the residuals with respect to a common factor, F*. This factor represents the overall strength of dust depletion in individual lines of sight. This method assumes that the underlying metallicity is solar. In an analogous way to that described above, the metallicities are found by fitting the linear relation

$$y=\,\log \,N({\rm{X}})-\,\log \,N({\rm{H}})-\,\log \,(X/{\rm{H}}){}_{\odot }-{B}_{{\rm{X}}}+{A}_{{\rm{X}}}\times {z}_{{\rm{X}}},$$
(8)

where the AX, BX and zX coefficients are determined and listed in ref. 8. The definition of y differs by −logN(H) with respect to ref. 8. The fit of this y = a + bx relation, where x = AX yields a y intercept at x = 0 equal to [M/H]tot, and b = F*.

Extended Data Figure 2, 3 show how the relative and F* methods fit the overall strength of dust depletion ([Zn/Fe]fit or F*) and total (dust corrected) metallicity [M/H]tot to the the observed column densities. There is an overall good agreement between the total metallicity resulting from the relative method and the F* method (Fig. 3), with a few notable exceptions, that is, for θ1 Ori C and HD 62542. These are cases of peculiar abundances in particular of Ti, and possibly Zn, that make the depletion patterns vary considerably from the norm, as visible in Extended Data Figs. 2, 3. HD 62542 is a case with strong ISM inhomogeneities along the line of sight, with one cloud having a much stronger depletion than the others35, and maybe also different metallicities.

The main assumption in the original establishment of the F* method is that the metallicity of the gas is solar, and this assumption was used to compute the AX, BX and zX coefficients8. That is, the individual observed [X/H] used to determine AX and BX are treated as pure signs of dust depletion, not including any potential variation in metallicity. However, the AX and BX coefficient determination could be altered, in case of significant deviations from the solar metallicity, such as potential several low-metallicity clouds.

Both the relative and F* methods are sensitive to the effect of potential ISM dishomogeneities along the line of sight, which we discuss below.

Testing the assumptions of the relative method

We test our results using different assumptions on the slope of the Zn depletion sequence BδZn, which is the main assumption of the relative method, for the basic version of the method, that is, relying on the observed [Zn/Fe] only to characterize the δX. In addition to the optimal slope for the depletion of Zn (BδZn = −0.27; ref. 9), we test for slopes that are two times steeper, two times shallower and from the relations of ref. 8. (1) Assuming a steeper slope (BδZn ≡ −0.54), the resulting dust-corrected metallicities are 0.3–0.4 dex higher than using the optimal slope. However, such steep depletion of Zn is quite extreme and very difficult to reconcile with the independent work on dust depletion of ref. 8 (see figure 5 in ref. 9). We consider this only as an extreme option of our parameter space to explore the potential impact on our results. (2) Assuming a shallower slope (BδZn ≡ −0.135), the resulting dust-corrected metallicities are 0.15–0.2 dex lower than using the ‘reference’ slope BδZn. This assumption is a potentially plausible option. (3) Finally, we assume that the depletion of Zn has the distribution of ref. 8 and use the (assumed) linear correlation between F* and [Zn/Fe]9, and thus assuming AδZn = 0.785 and BδZn = −0.904. The extrapolation of this correlation to negative F* is not necessarily reliable. Overall, the slopes for the metal depletion of ref. 8 are steeper than in ref. 9. The metallicities derived with this last assumption are overall similar to those using the optimal slope, with a few local variations towards higher metallicities, in one case up to 0.3 dex. One common feature of our results, regardless of the assumption on the Zn depletion (and even including the less likely assumptions) is a wide spread in metallicities of about 1 dex.

The influence of ISM inhomogeneities along the line of sight

One important concern is the presence of line-of-sight inhomogeneities, and in particular whether our methods of estimating the metallicities could be affected by the ISM being composed of individual clouds with very different depletion strengths and/or metallicities. One example of such inhomogeneities is star HD 62542, for which individual components with very different depletion properties have been observed with higher-resolution spectroscopy (figure 6 in ref. 35). Most Ti ii line profiles in the stacked UVES spectra in our sample show asymmetry or complexity in the velocity structure, hinting at potentially separate clouds or inhomogeneous ISM along the line of sight.

We test the application of our methods for the case of two individual ISM components with different combinations of amount of gas, depletion and metallicity. If the two individual components have the same metallicity, the metallicity determination that we would estimate from the combined total column densities (over the whole line profiles) would be accurate, provided we use the y variables as defined in equations (7), (8). However, if the two ISM components have not only very different depletion strengths but also very different metallicities, then our estimates of the metallicity using the combined total column densities is in between the metallicities of the two clouds, and mostly closer to the components that carries most gas. For example, if one component has F* = 1, solar metallicity and carries 10% of the gas, while the second component has F* = 0, 10% solar metallicity and carries 90% of the gas, the relative method finds a global metallicity of 18% solar.

The injection of pristine gas (metal-poor gas with zero depletion levels) in the ISM can bring strong deviations from a straight-line fit in the x versus y plots, which affects the metallicity determination. If the line-of-sight ISM is composed of two clouds carrying the same amount of gas, the first one with [Zn/Fe] = 1.6 and solar metallicity, and the second one with [Zn/Fe] = 0 and 10% solar metallicity, then the relation between the total x and y (from column densities measured over the whole line profiles) in the relative method strongly departs from a straight line, with a curvature where the more volatile elements have higher than expected y values.

In fact, we observe sometimes large discrepancies between the observed abundances of the highly volatile elements (for example, O, Kr, C and N) taken from the literature8,47 (Extended Data Table 6) on the one hand and the observed abundances of the mildly volatile elements (for example, Zn) and the refractory elements on the other hand, which is hard to interpret with the classic knowledge of dust depletion. This effect is highlighted in Extended Data Fig. 3, and is observed for several lines of sight in our sample, but only among those for which we find low metallicities (namely, o Per, X Per, 62 Tauri, HD 62542, ρ Oph A, χ Oph, HD 154368, 15 Sagittarii and HD 207198). Classically, this effect was attributed to very high values of F* (1–1.6), but with the difficulty of reconciling the overall depletion patterns. These abundance patterns can also not be attributed to nucleosynthesis effects. In principle, there could be intrinsic differences between O and N because of their different nucleosynthetic origin (primary α-capture process or secondary processes). However, only in one case we report measurements of N only among the volatile elements (HD 110432, Extended Data Fig. 3), and otherwise the measurements of N agree with all the other volatile elements.

Here we suggest that the large differences between the observed abundances of the most volatile elements with respect to Zn and the refractory elements are the effect of a substantial injection of pristine gas (with low metallicity, for example, 10% solar and no dust depletion) to the main ISM component with more typical (solar) metallicity and depletion levels. In our calculations, we assume that the pristine gas with no depletion has 10% solar metallicity, but it could have even lower metallicities. Dust depletion is often observed at high redshift in systems with 10% solar metallicity48.

The line of sight towards HD 62542 is a good, and perhaps extreme, example of a case where two (or more) ISM components have very different depletion properties (one with extremely high F* = 1.5 and the rest with F* = 0.3, confirmed with higher-resolution spectroscopy). But even after taking this into account, the observed abundances do not fit the depletion patterns well35. In our analysis, we found subsolar values of metallicities, although we only considered the total columns measured over the whole line profile. Thus, we speculate that additional ISM mixing effects, and in particular with gas at subsolar metallicities, may in fact help reconcile the observations.

Overall, in the case of an inhomogeneous ISM with contributions of gas at different metallicities, our total metallicity estimates probably represent a value in between the lowest and highest metallicities, depending on how much gas the clouds bear. Our results witness significant amounts of low metallicity gas. Some of these could potentially represent a mix between nearly solar metallicity and pristine gas, with even lower metallicities than our integrated estimates.

Estimates of the gas accretion rate

We roughly estimate the minimum accretion rate required for clouds of gas not to mix efficiently, which would allow chemical inhomogeneities to survive. We assume that a volume Vmix ≈ 0.1 kpc3 completely mixes within a timescale of τmix = 2.8 × 108 yr due to Galactic rotation11, and calculate the mass of this mixing volume by assuming a number density. For this, we compute the average number densities along the lines of sight in our sample, nH = N(H)/r using only the accurate distance measurements from Gaia DR2, and adopt their mean value <nH> = 2.3 cm−3. This is a typical value for the warm neutral medium1. The mass of the mixing region is then Mmix ≈ 6.2 × 106M. Given the minimum mass fraction for chemical inhomogeneities to survive (1/20) (ref. 16), the minimum accreting mass that can lead to a long-lived chemical inhomogeneity is mmin,acc ≈ 3.1 × 105M. This is comparable to the mass of a small HVC cloud20. Overall, the minimum accretion rate that allows chemical inhomogeneities to survive Galactic rotation is Rmin,acc = mmin,acc/τmix ≈ 0.001 M yr−1. This is much smaller than the typical accretion rate in the Galaxy, which is estimated to be around 0.1–1.4 M yr−1 from UV observations of HVCs26,27, not including the Magellanic Stream. That is, the rate of gas accretion that is currently measured is more than enough (by a factor of about 100) to account for the existence and survival of chemical inhomogeneities. This is true even if we assume a mean number density of ten times higher, typical of the cold neutral medium, in which case Rmin,acc would be ten times higher.

Estimates of the physical scale of the metallicity variations

The physical scale of the metallicity variations cannot be easily estimated, because of the sparsity of our targets, and the fact that we measure the integrated metallicity along their lines of sight. The smallest scales can perhaps be probed in the Orion region, in which we observed metallicity variations towards three targets. The angular separation between θ1 Ori C, a likely low-metallicity line of sight, and ι Ori and ζ Ori A is about 30.7′ and about 3.7325°, respectively. At the physical distance of θ1 Ori C, 373 pc, this corresponds to physical separations of about 3.3 pc and about 24 pc. Regarding the physical distance to our targets, the closest star is ε Per at 82 pc and we measure about solar metallicity for the neutral gas towards this line of sight. Then we measure low metallicity towards the next two closest targets, χ Oph and ρ Oph A at 122 pc and 139 pc, respectively, and with metallicities of 37% and 13% the solar value. Although above we conservatively refer to the distances among the stars themselves, the physical sizes of the pockets of lower-metallicity gas and the distances among them could be smaller. All metallicities are listed in Extended Data Table 3. Thus, we roughly estimate the minimum physical scale of the metallicity variations that we observe to be of the order of tens of parsecs, and possibly down to a few parsecs.

Comparing the metallicity of neutral gas, ionized gas and stars

An interesting open issue is how the neutral gas metallicity is related to the H ii regions and in turn to the stellar metallicities. We are not aware of measurements of stellar metallicities of the stars in our sample. For the case of the Orion OB association, ref. 49 found that the B-type stars in the Orion OB association, including in the Orion nebula, have around solar metallicity. The metallicity of the ionized gas in the Orion nebula H ii region is debated, ranging from 1/10 solar metallicity (for collisionally excited lines, and in general for refractory elements such as Fe, Mg and Si50,51,52 to slightly supersolar53. Reference. 54 found deviations of up to about 0.4 dex (0.2 dex) from the abundances of nitrogen (oxygen) of ionized gas in H ii regions in the Galaxy, after accounting for a radial metallicity gradient. Reference. 55 and ref. 10 measured the oxygen metallicity in H ii regions in our Galaxy and found metallicity variations over the overall radial gradient of about 0.3 dex over large scales, and smaller along the direction of the long bar. Reference. 56 recently found that about 0.5-dex variations of gas-phase metallicity on scales of 100 pc, observed from strong-emission lines diagnostics in Very Large Telescope/Multi Unit Spectroscopic Explorer (MUSE) data of nearby galaxies, positively correlate with the variations in star-formation rates, which they interpret as due to time variations of the star-formation efficiency and including gas infall in their gas-regulated theoretical models. With similar observational techniques, ref. 57 found that the metallicity of H ii regions in nearby galaxies show deviations of up to 0.2–0.3 dex from the radial gradients, and that these variations decrease at smaller scales58.

Comparison with our results is not straightforward. First, H ii regions comprise ionized dense gas that is associated with active star formation, while the diffuse neutral gas that we probe here is not necessarily connected to recent star-formation activity. Second, here we probe individual lines of sight, down to very small projected physical scales of a few parsecs. Such small-scale variations can be observationally smoothed away in integrated measurements of metallicity over larger scales, which is normally the case for nearby galaxies. In addition, H ii measurements can also be affected by dust depletion, including for the most commonly used reference element, oxygen.