Atmospheric Retrievals of the Young Giant Planet ROXs 42B b from Low- and High-resolution Spectroscopy

Previous attempts have been made to characterize the atmospheres of directly imaged planets at low resolution (R ∼ 10–100 s), but the presence of clouds has often led to degeneracies in the retrieved atmospheric abundances with cloud opacity and temperature structure that bias retrieved compositions. In this study, we perform retrievals on the ultrayoung (≲5 Myr) directly imaged planet ROXs 42B b with both a downsampled low-resolution JHK-band spectrum from Gemini/NIFS and Keck/OSIRIS, and a high-resolution K-band spectrum from pre-upgrade Keck/NIRSPAO. Using the atmospheric retrieval framework of petitRADTRANS, we analyze both data sets individually and combined. We additionally fit for the stellar abundances and other physical properties of the host stars, a young M spectral type binary, using the SPHINX model grid. We find that the measured C/O, 0.50 ± 0.05, and metallicity, [Fe/H] = −0.67 ± 0.35, for ROXs 42B b from our high-resolution spectrum agree with those of its host stars within 1σ. The retrieved parameters from the high-resolution spectrum are also independent of our choice of cloud model. In contrast, the retrieved parameters from the low-resolution spectrum show strong degeneracies between the clouds and the retrieved metallicity and temperature structure. When we retrieve both data sets together, we find that these degeneracies are reduced but not eliminated, and the final results remain highly sensitive to cloud modeling choices. We conclude that high-resolution spectroscopy offers the most promising path for reliably determining atmospheric compositions of directly imaged companions independent of their cloud properties.


INTRODUCTION
Directly imaged planets are a population of massive, self-luminous companions, typically observed from orbital separations comparable to that of Saturn, to well beyond the orbital distance of Neptune (10s-100s of au).These companions are typically young, with ages ≲ 100 Myr, and are often distinguished from brown dwarfs companions (∼ 13 − 80 M J ) as having masses near or below the deuterium-burning limit at ∼13 M J (Bowler 2016;Currie et al. 2022).A more physically motivated distinction between directly imaged planets and brown dwarfs would be based on formation process, as planets are expected to form bottom up from core accretion, while brown dwarf companions form from gravitational collapse, however this is challenging to distinguish for individual objects (Pollack et al. 1996;Boss 1997;Alibert et al. 2005).
Population studies indicate that these lower mass companions have properties that are distinct from those Table 1.Summary of the previously derived system parameters and data used in our analysis of ROXs 42B b along with new derived parameters for the host star from this work using the SPHINX model grid from Iyer et al. (2023).Note-a) The reported T ef f corresponds to the primary, brighter component in the binary, calculated using the reported K-band flux ratio in Ratzka et al. (2005).b) Calculated using the separation measured by Kraus et al. (2014) and the updated distance from Gaia Collaboration (2022) of massive brown dwarf companions.Planetary-mass companions appear to have a higher occurrence rate than brown dwarf companions to the same stellar population, and tend to have lower orbital eccentricities (Nielsen et al. 2019;Wagner et al. 2019;Bowler et al. 2020a;Nagpal et al. 2023), and distinct stellar spin-orbit orientations (Bowler et al. 2023).The differing properties of these two populations suggest that they likely have distinct formation channels, but the nature of these formation channels is currently debated.It has also been suggested that one or both populations might not have formed in situ, but instead migrated away from their initial formation locations (Scharf & Menou 2009).However, Bryan et al. (2016) failed to find evidence for additional massive bodies in systems hosting wide-separation directly imaged companions that could have acted as scatterers, suggesting this is not the dominant formation mechanism for these planets.
Numerous studies have explored how the elemental abundances of giant planet atmospheres, which are often parameterized as a carbon-to-oxygen ratio (C/O) and bulk metallicity (e.g.[Fe/H]), can encode information about their formation and migration histories (e.g., Madhusudhan 2012;Oberg et al. 2011;Cridland et al. 2016;Mordasini et al. 2016;Turrini et al. 2021).Companions that form via gravitational instability, including cloud fragmentation and disk instability, are expected to have envelope compositions that are largely similar to those of their host stars, (analogous to binary star formation), although is has been shown that disk structures can result in local enhancements of solid material that can be incorporated during collapse (Boley & Durisen 2010;Boley et al. 2011).Alternatively, core accretion (Pollack et al. 1996;Lambrechts & Johansen 2012) is expected to produce giant planets with a wide range of C/O and bulk metallicity values.This is because the compositions of the solid and gaseous components of the disk vary as a function of time and location within the disk, and different planets are expected to accrete different quantities of solids versus gas (Oberg et al. 2011;Turrini et al. 2021;Chachan et al. 2023).However, since collapse from instability is more likely to occur early in the disk's lifetime (Boley 2009), a newly formed planet could still have access to a substantial reservoir of material in the disk.If the planet is able to accrete additional material following initial collapse phase, a range of envelope compositions may be possible for planets formed via disk instability as well.Nonetheless, atmospheric composition could still probe the formation and migration histories of directly imaged planets and help distinguish between different formation scenarios.
Atmospheric characterization analyses of directly imaged planets have historically made use of photometric and low-resolution spectroscopic data sets (resolving power R ∼ 20 − 100), which are compared to grids of self-consistent, 1-dimensional radiative-convective equilibrium forward models (e.g. the early studies of the HR 8799 planets: Galicher et al. 2011; Barman et al. 2011;Currie et al. 2011;Marley et al. 2012).These models have relatively limited degrees of freedom, and often produce poor fits to these spectra.More recently, a number of studies have begun to utilize spectral inversion, or atmospheric retrieval, techniques to model the atmospheres of isolated brown dwarfs (Line et al. 2017;Burningham et al. 2017Burningham et al. , 2021;;Lueber et al. 2022;Calamari et al. 2022;Hood et al. 2023), directly imaged companions (Mollière et al. 2020;Ruffio et al. 2021;Wang et al. 2022;Zhang et al. 2023), and brown dwarf companions (Xuan et al. 2022).These atmospheric retrievals can be used to place constraints on the C/O ratios and metallicities of these objects, as well as other physical quantities such as their radii, surface gravities, and cloud properties.
Many of the directly imaged planets and brown dwarfs examined in the literature lie in a temperature regime where silicates are expected to condense in their upper atmospheres (Marley & Robinson 2015).The presence of these clouds has a strong effect on the observed shapes of their low-resolution emission spectra (e.g., Burningham et al. 2017).Previous studies have explored a wide range of cloud models with varying degrees of physical motivation and success at reproducing the observed features.They also revealed that low-resolution retrievals often exhibit strong degeneracies between their retrieved cloud properties and other physical parameters, such as effective temperature and metallicity.For example, a retrieval analysis by Burningham et al. (2017) found that their cloud-free models tended towards isothermal pressure-temperature (P-T) profiles and high metallicities in order to compensate for the effects of clouds.This degeneracy has been noted in many subsequent studies, with a variety of proposed solutions (e.g.Piette & Madhusudhan 2020;Zhang et al. 2023).Lueber et al. (2022) found that their treatment of cloud opacity also resulted in trade offs with the retrieved surface gravity, and were unable to obtain good constraints on the C/O ratios of many of the brown dwarfs in their sample.On the other hand, Mollière et al. (2020) retrieved a C/O value consistent with solar in their paper on HR 8799 e.This value was independent of the cloud model used and did not correlate with other physical parameters such as the vertical temperature structure.
We can obtain a complementary perspective on the atmospheres of these cloudy objects using high-resolution spectroscopy.At high spectral resolution, the ratios of the line depths of different molecular species can be used to constrain their relative abundances in a way that is less biased by the presence of continuum opacity sources from clouds.Since the cores of absorption lines are emitted higher up in the atmosphere than the continuum flux, high-resolution spectroscopy also allows observers to probe a much broader range of pressures, including pressures that lie above the cloud tops.This can increase the signal-to-noise of molecular detections for cloudy objects (Gandhi et al. 2020;Hood et al. 2020).
In their recent study of the brown dwarf companion HD 4747 B, Xuan et al. (2022) found their retrieved abundances from high-resolution spectroscopy were insensitive to their choice of cloud model.Similarly, Wang et al. (2022) performed joint retrievals on low and highresolution spectroscopy of HR 8799 e and found that while clouds are likely present in this planet's atmosphere, they are located deeper in the atmosphere than where the majority of the flux was emitted, resulting in a minimal effect on their observed spectrum.They obtained good constraints on the C/O, C/H and O/H ratios, retrieving values that were consistent with other studies of the HR 8799 planets (e.g.Ruffio et al. 2021) and AF Lep b (Zhang et al. 2023).
ROXs 42B b is an ultra-young directly imaged planetary companion on a wide orbit around a low mass binary star.Its large separation (∼1") from its host stars makes it a favorable target for atmospheric characterization.It's large orbital separation and low-mass binary host make it an interesting case study for formation.In this paper, we perform atmospheric retrievals on low-and high-resolution spectroscopy of the young companion ROXs 42B b.Bowler et al. (2014) published a medium-resolution spectrum for this object spanning J-, H-and K-bands (1.1 -2.4 µm), while Bryan et al. (2018) published a high-resolution K-band spectrum.However, neither of these studies sought to interpret these data using atmospheric retrieval modeling.We use the opensource radiative transfer code petitRADTRANS (Mollière et al. 2019(Mollière et al. , 2020) ) in order to constrain the properties of ROXs 42B b's atmosphere, including its C/O ratio and metallicity.We compare our constraints from lowresolution only ( §5.1), high-resolution only ( §5.2), and joint high-and low-resolution retrievals ( §5.3) to explore the advantages and disadvantages of each data type in the context of atmospheric characterization.Finally, we compare our retrieved abundances for ROXs 42B b to those of its primary, which is an unresolved binary, in §6 and discuss implications for the formation of this system.

SYSTEM PROPERTIES
ROXs 42B is a close binary system 1 in the ρ Ophiuchus star-forming region (Bouvier & Appenzeller 1992).A candidate companion was first identified around the binary by Ratzka et al. (2005).The companion was later confirmed by Kraus et al. (2014) and Currie et al. (2014b).Kraus et al. (2014) measured a projected separation of 1.17", which corresponds to a separation of 175 au with the updated distance from Gaia Collaboration (2022).The primary binary, ROXs 42B AB, has a (unresolved) spectral type of M0 and has been identified as a young system based on weak Hα emission, X-ray emission, and possible lithium absorption in its optical spectrum (Bouvier & Appenzeller 1992).Isochronal fitting gives an approximate stellar age of 6.8 +3.4  −2.3 Myr (Kraus et al. 2014).Models suggest individual component masses of 0.89 ± 0.08 and 0.36 ± 0.04 M ⊙ (Kraus et al. 2014).The absence of infrared excess in either W 3 or W 4 in WISE observations, or a radio emission at 1.3 mm, indicates that this system does not contain a signif-1 ROXs 42A and ROXs 42C are two nearby stars located within the error circle of the Einstein Observatory which first identified the Rho Ophiuchus X-ray source, ROXs 42 (Montmerle et al. 1983).While ROXs 42C has a similar age to ROXs 42B, it has a very different mass and is widely separated from ROXs 42B, so is unlikely to be affiliated, while ROXs 42A is likely a field star (Bouvier & Appenzeller 1992).
icant protoplanetary disk (Kraus et al. 2014;Daemgen et al. 2017).However, Spitzer observations at 8 µm suggest that the companion, ROXs 42B b has excess infrared emission, and might therefore host a circumplanetary disk despite the lack of accretion signatures (Martinez & Kraus 2021).ROXs 42B b is closest to a spectral type of L0, but is also observed to have colors much redder than field objects of a similar spectral type, which could be due to circumstellar dust (Kraus et al. 2014;Daemgen et al. 2017).
Evolutionary model fits to photometry of ROXs 42B b place approximate bounds on its mass of 10 ± 4 M J for an assumed age between 1 − 5 Myr (Kraus et al. 2014) using models from Chabrier et al. (2000).In a follow-on study, Bowler et al. (2014) obtained mediumresolution near infrared (NIR) JHK-band spectra of the companion and found that the shape of the H-band flux peak was best-matched by grid models with low surface gravities, consistent with its relatively young age.Published constraints on the effective temperature of this object vary.Values from the photometric study of Currie et al. (2014a) ranged from 1800 − 2200 K depending on the models used and whether or not clouds were included.Currie et al. (2014b) fit a low-resolution Kband spectrum from VLT/SINFONI and found a significantly higher effective temperature range of 1800-2600 K, which also varied depending on their treatment of clouds in the grid models.There are currently no published constraints on ROXs 42B b's atmospheric metallicity or C/O ratio, due to the limitations of fits to pub-   2014) (top panel) and error-weighted residuals (lower panel).Our full low-resolution retrievals are compared to the best fit model (yellow) from our retrievals where our P-T profile is fixed to a Sonora Bobcat P-T profile from (Marley et al. 2021b).The horizontal black line indicates the wavelength coverage of our Keck/NIRSPEC high-resolution K-band data for comparison.
licly available grid models (Currie et al. 2014a;Daemgen et al. 2017).Bryan et al. (2018) obtained a highresolution K-band spectrum for this object and used it to measure a projected rotational velocity of 9.5 +2.1 −2.3 km s −1 , but this study assumed a solar composition atmosphere.To date, the only published composition constraint for this object is an upper limit on its CO 2 abundance from Daemgen et al. (2017).
There are currently no published composition constraints for the primary, ROXs 42B AB, either.Only a few directly imaged planet hosts in the literature have measured abundances, e.g.HR 8799 (Wang et al. 2020).In most cases, the retrieved chemical abundances are compared to solar values instead of their stellar value.However, in order to make determinations about the formation mechanisms of the companion, it is necessary to have stellar properties to compare to our retrieved abundances for the companion.In Section 6, we fit the optical SNIFS spectrum of the (unresolved) primary ROXs 42B AB from Bowler et al. (2014) using the SPHINX M dwarf model grid from Iyer et al. (2023) to constrain the abundances of the host binary.2014) published a medium resolution (R∼1000) spectrum of ROXs 42B b.The H-band data in this study were taken on UT May 9, 2012 and the J-band data were taken on UT May 14 and July 4, 2012 using ALTAIR, the facility AO system, and the Near-Infrared Integral Field Spectrometer (NIFS, McGregor et al. 2003), an image-slicer integral field spectrograph with a resolution of R∼5000.The K-band data were taken with the OH-Suppressing Infrared Imaging Spectrograph (OSIRIS, Larkin et al. 2006) on Keck II on UT August 20 2011.The OSIRIS measurements used NGSAO, with an average seeing of ∼ 0.6 ′′ .The data was them binned and smoothed from its original resolution to R ∼ 1000 to increase signal to noise per resolution element.Details about the data reduction can be found in Bowler et al. (2014).In this study, we further binned the data to a resolution of R=300 for the retrievals.This allowed us to use the correlated-k opacities from petitRADTRANS, rather than substantially downsampling the line-by-line opacities, which would result in inaccuracies, and reduced the run times for our retrievals.While medium resolution data has been suggested as a way to overcome the degeneracies of lowresolution data (e.g.Hood et al. 2023), we find that running our retrievals at R∼1000 result in unphysical solutions due to low signal-to-noise and opacity sampling.These issues vanish when we bin to slightly lower resolution.We find no substantial differences to our retrieved parameters for a resolution of R∼100-600, only a difference in run time.We opt for R∼300 to optimize between resolution and run time.
Table 2.A summary table of all fitted parameters in our high-resolution (HR) and low-resolution (LR) petitRADTRANS retrievals and our adopted priors.The parameters for each of our two cloud models are detailed in separate sections.In the third column we note whether each parameter is used for our high-resolution (HR) or low-resolution (LR) retrievals.All parameters are used in our joint retrievals.

High-resolution Spectroscopy of ROXs 42B b
Bryan et al. ( 2018) obtained a high-resolution Kband spectrum of ROXs 42B b on UT June 1 and 2, 2015, using the pre-upgrade NIRSPEC instrument (R∼25,000) on Keck II.The target was observed using a 0.041 × 2.26 ′′ slit in adaptive optics (AO) mode in order to minimize blending with the primary star.For ROXs 42B b, both the companion and primary (separation ∼ 1.2 ′′ ) were observed simultaneously in the slit, with their light spatially separated on the detector.The host star's spectrum was then used to derive a wavelength solution and telluric correction for the lower signal-to-noise ratio (SNR) planetary data.Details on the observations and data reduction can be found in Bryan et al. (2018).We used two spectral orders spanning λ = 2.27 − 2.38 µm in our retrieval because they contain absorption lines from both water and CO, including two strong CO bandheads.The other spectral orders had less accurate telluric corrections and wavelength solutions, and we therefore follow the example of Bryan et al. (2018) and exclude them from our analysis.
In Figure 1 we show the cross-correlation function for our continuum-normalized, radial velocity-corrected high-resolution spectrum compared to single molecular template spectra.We detect H 2 O and CO, which are expected to be the dominant near-infrared absorbers in an atmosphere of this temperature, at greater than 8σ.We do not detect CH 4 or OH, which are predicted to have much lower abundances.

SNIFS Optical Spectrum of ROXs 42B AB
In order to derive an estimate for the abundances of the binary host stars, we use a low-resolution optical spectrum obtained on UT May 20 2012 by the SuperNova Integral Field Spectrograph (SNIFS) at the University of Hawai'i 2.2-m telescope and published in Bowler et al. (2014).SNIFS is an integral field unit with simultaneous coverage of the blue (3000-5200 Å) and red (5200-9500 Å) optical regions at a resolving power of R∼1300.Additional details about the data reduction can be found in Bowler et al. (2014).In this study, we binned the SNIFs optical spectrum to a resolution of R∼100 for comparison with the SPHINX model grid, which has a native resolution of R∼250 (Iyer et al. 2023).

ATMOSPHERIC RETRIEVAL SETUP
We use the retrieval framework implemented in petitRADTRANS (Mollière et al. 2019(Mollière et al. , 2020) ) to model our low-and high-resolution spectra.We use a retrieval setup similar to the one described in Mollière et al. (2020), which we describe in more detail below.
Following previous studies (Mollière et al. 2020;Burningham et al. 2017;Xuan et al. 2022, etc.), we assume that the atmosphere of ROXs 42B b is in local chemical equilibrium, with the exception of potential quenched carbon chemistry.We use petitRADTRANS to calculate layer-dependent chemical abundances by interpolating tables generated by easyCHEM, a Gibbs Free Energy minimizer (Mollière et al. 2019).We parameterize the bulk chemistry using a C/O ratio and metallicity, [Fe/H], which together set the abundances for all of the individual species.We perform initial fits to test for the potential presence of disequilibrium chemistry by fitting for a carbon quench pressure, which fixes the abundances of carbon monoxide, water and methane to a constant value at pressures lower than the quench pressure.We find that the quench pressure either tends to very low values or is completely unconstrained, and therefore exclude it from our final fits.This is not surprising, as methane is expected to have a very low abundance throughout ROXs 42B b's atmosphere and it is primarily the measured ratio of CH 4 to CO that constrains the quench pressure when the atmosphere is not in chemical equilibrium (Fortney et al. 2020;Xuan et al. 2022).

Opacities
We use the pre-tabulated correlated-k and line-by-line opacities from petitRADTRANS (Mollière et al. 2019) to model our low and high-resolution spectra, respectively.We include opacities from CO, H 2 O, FeH, CO 2 , OH, H 2 S, PH 3 , Na, and K in our models.For completeness, we included the opacities of CH 4 , HCN, and NH 3 in our initial fits, but found that this had no effect on our retrieved posteriors for either the low-or high-resolution fits.This is not surprising, as these molecules are all predicted to have very low abundances in the relatively hot atmosphere of ROXs 42B b.We find similar results for tests including VO and TiO.We find that the alkali species, Na and K, are particularly important for fitting our low-resolution data, as their absorption wings can affect the continuum shape at the blue edge of Jband.We use the same base line list from the VALD opacity database (Piskunov et al. 1995), and try 3 different treatments of the wings, including the long wing treatment from Burrows & Volobuyev (2003), custom pressure broadening (for details see Mollière et al. 2019) and a Lorentz profile (Schweitzer et al. 1996), to quantify the effect of this choice on our retrieved abundances.We found that the differences were negligible and used the custom pressure broadening in our final fits.To cut down on computation time for our high-resolution retrievals, we down-sampled our opacities by a factor of 4 (native resolution of 10 6 , new resolution of R=250,000).This new resolution is still 10× the resolution of our data.We confirm that this resolution is sufficient for our data by generating synthetic data using petitRADTRANS and retrieve at both native and down sampled resolutions.We find no significant differences in the retrieved posterior distributions.

Temperature Structure
We adopt the 6-parameter spline pressuretemperature profile from Mollière et al. (2020).This spline profile splits the atmosphere into three layers.The lowest layer of the atmosphere is located beneath the radiative-convective boundary.In this region, the temperature profile is set equal to the moist adiabat corresponding to the assumed atmospheric temperature and composition.The middle layer, which extends from the radiative-convective boundary to the point where the optical depth τ = 0.1, is a radiative photosphere where the temperature structure is set based on the optical depth and the classical Eddington approximation.The uppermost layer begins at τ = 0.1 and extends to a pressure of 10 −6 bars.In this layer, the temperature is set using a cubic spline anchored by four equidistant points in log(P).This allows for a more complicated temperature structure than is permitted by the Eddington approximation, which forces the temperature at pressures above the photosphere to be isothermal.In our fits we penalize combinations of parameters that result in temperature inversions, which we do not expect to be present given ROXs 42B b's wide orbital separation.

Clouds
Previous studies of isolated brown dwarfs and directly imaged planets with effective temperatures similar to that of ROXs 42B b have consistently found that clouds  For our gray cloud model, we consider a simple cloud deck with a wavelength-independent opacity, and parameterize the opacity by the cloud base pressure, P base , the opacity at the cloud base, κ 0 , and the pressure scaling power law, γ, as follows: (1) In addition to this simple cloud prescription, we also carry out fits using the EddySed cloud model from Ackerman & Marley (2001) as implemented in petitRADTRANS (Mollière et al. 2020).In this cloud model, the location of the cloud base is set by where the condensation curve of a given cloud species intersects with the atmospheric pressure temperature profile.The vertical extent and number density of the clouds is calculated using parameters representing the vertical mixing, K zz , and the sedimentation efficiency f sed .In addition, we fit for a multiplicative factor which scales the abundance of each cloud species relative to the equilibrium chemistry-predicted value at the cloud base, X species .
We use a Mie scattering model to calculate the wavelength-dependent opacity from each cloud species in the EddySed model.We determine which cloud species to include in our model by comparing likely P-T profiles for ROXs 42B b to condensation curves for a wide range of potential cloud species.Based on this, we find that iron (Fe), enstatite (MgSiO 3 ), fosterite (Mg 2 SiO 4 ), quartz (SiO 2 ) and corundum (Al 2 O 3 ) are all possible cloud species that could condense in the atmosphere of ROXs 42B b.Signatures of silicates clouds have been observed in Spitzer IRS data of similar spectral type brown dwarfs (e.g.Cushing et al. 2006;Burgasser et al. 2008;Burningham et al. 2021).Visscher et al. (2010) predict that the formation of quartz clouds will be repressed in favour of enstatite due to the high abundance of Mg, though this has been shown to not always be true by Burningham et al. (2021), whose retrievals favored enstatite clouds over deeper quartz clouds.On the other hand, Gao et al. (2020) predict that fosterite should be the dominant silicate species to condense from equilibrium chemistry and cloud microphysics.However, the cross sections of quartz, fosterite, and enstatite clouds have a nearly identical slope at near-infrared wavelengths with no unique features to differentiate them (Wakeford & Sing 2015), so we choose to focus on enstatite clouds for this study.We explore multiple combinations of cloud species including Al 2 O 3 , Fe, and MgSiO 3 , as well as different cloud particle properties (amorphous vs. crystalline) for the solid species in our retrieval, which changes the refractive indices and resulting scattering cross sections.We find that our choice of amorphous versus crystalline structure has a negligible impact on our retrieved posterior probability distributions, so we use amorphous Mie scattering particles for our final models.This is consistent with model fits to mid-infrared Spitzer IRS spectra of brown dwarfs, which are best reproduced by amorphous silicate cloud particles (Luna & Morley 2021;Suárez & Metchev 2023).

Additional Fit Parameters
We also fit for the surface gravity, parameterized as log(g).In the low-resolution retrievals, we additionally fit for a flux scaling parameter in order to match the overall flux level.Our high-resolution spectrum is continuum normalized, and so is not sensitive to the absolute flux level.petitRADTRANS computes the flux density emitted at the surface of the planet.To obtain the observed flux, we must multiply this quantity by a scale factor: where R is the object's radius and d is the distance to the system.We allow for flux offsets between each of our lowresolution spectral bands (two offsets in total with Jband fixed) to account for the fact that they were observed with different instruments at different observational epochs.As this planet is located in a young star forming region, we additionally fit for an optical extinction coefficient, A V , and correspondingly redden our model spectra to compare with our data.Bowler et al. ( 2014) calculated a reddening value for the primary binary of 1.7 +0.9 −1.2 by comparing the optical SNIFS spectrum to optical templates from Pickles (1998).However, the constraints on this value are asymmetric and wide, and this value was calcuated assuming a single star, so we opt for a wide uniform prior on this value for our fits.
It is possible that the error bars of our data may be under-estimated due to the presence of correlated noise sources.We therefore add a logarithmic error term, b, in quadrature to the reported measurement errors for each spectral bin, such that the effective standard deviation of each point, i, becomes: For retrievals including the high-resolution data, we also include two additional parameters: the radial velocity offset, and the projected rotational velocity, vsini.
We adopt wide uniform or log-uniform priors for all parameters in our models and impose no restrictions other than excluding combinations of parameters that result in temperature inversions.A summary table of all the parameters included in the retrieval and their priors is shown in Table 2.

Nested Sampling
We fit the data using nested sampling as implemented in PyMultiNest, a python wrapper for MultiNest (Feroz et al. 2009).We run our retrievals with 1000 live points, and perform multiple runs using the optimal sampling efficiency for PyMultiNest to compute our evidence and posterior separate.Our "best fit" model is taken to be the sample with the highest likelihood.We compare different models using the Bayes factor, B 12 , which gives the evidence for model 1 relative to model 2. It is calculated as: where Z is the evidence for each given model as computed by PyMultiNest.The higher the Bayes factor, the stronger the evidence supporting one model over another.We evaluate the Bayes factor for each of our different models relative to our best fit model and list the results in Table 3.

Low-Resolution Retrievals
In this section we describe the results of our retrievals on our low-resolution spectra.We fit our low-resolution data using 5 different cloud models: a 'clear' model, where there are no clouds present in the visible portion of the atmosphere, a gray cloud model, and 3 variations of the EddySed cloud model to account for the unknown cloud properties.Our variations of the EddySed cloud model include an iron cloud deck, an enstatite cloud deck, and a combination of iron and silicate clouds, as well as a combination of enstatite and corundum clouds.
In Figure 2 we show the best fit spectra and residuals for our clear model, the best fitting model.In Figure 4 we show the posteriors for a few select parameters from each retrieval, including log(g), T ef f , C/O ratio and [Fe/H].The best fit values and 1-sigma uncertainties for key parameters are reported in Table 3.
We find that our clear model is preferred at 2.4 sigma over our grey cloud model, and 6.2 sigma from our Ed-dySed cloud model.We find a super-solar metallicity Note-The right most column lists the Bayes factor (B) for each retrieval relative to the clear model (B = 1).The uncertainties for each parameter quoted are determined using the 68% confidence interval from our posteriors assuming a Gaussian distribution.For our cloudy models, 'am' stands for amorphous cloud particles + Mie scattering.Our reported Bayes factor are calculated relative to the clear model and then converted to a minimum sigma value using the method described in Benneke & Seager (2013) of 1.37 ± 0.13.We also find a super-solar C/O ratio of 0.798 ± 0.019.Our retrieved C/O ratio, [Fe/H] and P-T profile are consistent between our clear, grey and Ed-dySed cloud models (Fig. 12).When cloud parameters are included in our fits, we find either clouds too deep in the atmosphere to affect the spectrum, or completely unconstrained values, which indicates that clouds are not necessary to reproduce our data or there is insufficient information to constrain cloud properties.
Even with constraints on the anchor points of our spline P-T profile, our fits strongly prefer an isothermal temperature structure at pressures lower than 1 bar.These kinds of steep, isothermal P-T profiles have been seen in other studies (e.g.Burningham et al. 2017) and are thought to be an attempt to compensate for the effect of cloud opacity using the flexibility of the P-T profile.While it has been suggested by Tremblin et al. (2017) that the atmospheres of these planets could in fact be isothermal and the observed reddening attributed to clouds could be explained by fingering convection, we find this is unlikely in the case of ROXs 42B b.Given that these objects are internally heated, it is very unlikely that their atmospheres would be isothermal; indeed, radiative equilibrium grid models predict a much steeper temperature profile for ROXs 42B b (e.g. the ATMO and Sonora Bobcat model grids.Phillips et al. 2020;Marley et al. 2021a,b).The changing col-ors of brown dwarfs as a function of effective temperature, as well as the high frequency of rotational variability near the L-T transition, all provide strong evidence that clouds should be ubiquitous in the atmospheres of objects like ROXs 42B b (Bailer-Jones & Mundt 1999; Gelino et al. 2002;Marley et al. 2010;Apai et al. 2013;Radigan et al. 2014;Vos et al. 2019).
We also consider fits where we fix the P-T profile to a self-consistent Sonora model (Marley et al. 2021a,b) with log(g) = 3.5 and an effective temperature of 2100 K, matching the spectroscopically and photometrically derived parameters for ROXs 42B b (Currie et al. 2014b,a).With this fixed P-T profile, we find that we are no longer able to adequately fit our low-resolution data using a cloud free model, as there are no combination of parameters that can reproduce the data.With the P-T profile fixed, we find a smaller radius and T ef f than in our free P-T retrieval case, indicating that is trading off with the radius in an attempt to conserve total luminosity.We additionally find a higher reddening coefficient, indicating the need for extra absorption to match our observed spectrum.
When we include gray clouds in our fixed P-T profile retrievals, we are able to match our low-resolution spectrum nearly as well as the retrievals with the free P-T profile, with the free P-T profile model preferred only slightly at 2σ.We find that the cloud base becomes 1 .

. A
2 .7 2 .8 2 .9 3 .0 R pl 1 8 0 0 1 8 5 0 1 9 0 0 1 9 5 0 2 0 0 0 T eff 0 .9 0 1 .0 5 1 .2 0 1 .3 5 1 .5 0 [Fe/H] 0 .6 5 0 .7 0 0 .7 5 0 .8 0 C/O 3 .0 1 .5 0 .0 1 .5 3 .0 logP 0 1 .2 1 .8 2 .4 3 .0 3 .6 A v Free Spline P-T Fixed Sonora P-T Fixed Sonora P-T, fixed A V constrained in the retrievals, but the optical depth of the clouds trades off with the reddening coefficient.We therefore try an additional fit where we fix the reddening value to the value calculated by Bowler et al. (2014) for the primary binary.In Figure 4 we compare the posteriors for our fixed P-T profile retrievals to our free P-T profile retrieval using the gray cloud model.We find that with the reddening and P-T profile fixed, cloud opacity becomes important to match our observed spec-trum, and the metallicity, log(g) and planetary radius values all decrease substantially, while the C/O ratio increases only slightly.We conclude that there is a degeneracy between our retrieved chemistry and atmospheric temperature structure.It is most strongly observed to effect our retrieved metallicity.We find that our retrieved metallicity increases or decreases as the slope of our P-T profile changes from more isothermal to less.This makes it evident that the model is using the effects of the P-T profile to account for the effects of cloud on absorption depth, as a more isothermal atmospheres makes it harder to have deep absorption features.The metallicity as a result is driven up to account for the observed absorption features.
To confirm this, we perform similar tests restricting our metallicity to values lower than 0.5.In this case, the P-T structure is less isothermal.We observe the worst fit to occur in the H-band peak, suggesting this driving this degeneracy (Fig. 2).Since this feature is also a strong indicator of gravity, we therefore conclude that we cannot trust our retrieved gravity value either.We additionally observe a degeneracy between our optical extinction coefficient, A V , and the cloud properties.For our free P-T profile retrievals, A V = 2.43±0.41,and for our fixed P-T profile retrievals, it increases slightly to 2.67±0.25.We find that the retrievals prefer to increase the A V value rather than add clouds, likely because this involves toggling only a single parameter verses a combination of parameters, as the net effect of silicate clouds is to redden the observed spectrum.
In all versions of the fit, we consistently struggle to fit the J-band data with our models, particularly at the blue edge.This may be related to the extended wings of the Na and K lines.We compare retrievals using three different wing treatments described in §4.1, but are still unable to replicate the observed J-band shape.TiO also has absorption features around 1.2 microns, however we find that even when we include TiO with free abundance, it does not improve the quality of our fit.Based on the observed degeneracies between various parameters in our low-resolution retrievals, we conclude that our retrieved abundances and other properties are likely unreliable.

High-resolution Retrievals
In this section, we present the results of our retrievals on the high-resolution data and compare with the results from our retrievals using the low-resolution data.We run the same suite of cloud models as we did on our low-resolution data and additionally fit for a projected rotational velocity (vsini) and a radial velocity (RV) offset.The best-fit values and uncertainties for key parameters including the C/O ratio, [Fe/H], vsini, log(g) and T ef f are listed in Table 3.
For our high-resolution data, we also find no difference in the quality of the fit between models with and without clouds.We compare the posteriors for the clear, grey cloud, and EddySed cloud models in Figure 5 and find that they all overlap.As a result, the Bayes factor prefers the simpler cloud-free model.Since our inferred parameters are not sensitive to our choice of cloud model, we use the parameters from the cloud-free model moving forward.We retrieve a moderately substellar metallicity of [Fe/H] = −0.67 ± 0.35, rather than the super-stellar metallicity preferred in our low-resolution retrievals.We find a C/O ratio of 0.505 ± 0.05, which is consistent with the solar C/O ratio of 0.59 ± 0.13 (Asplund et al. 2021).We find a radial velocity value rv = 1.44 ± 0.42 kms −1 .We additionally constrain the projected spin rate vsini to be 10.52±0.92km s −1 , which is in good agreement with the value of 9.5 +2.1 −2.3 km s −1 found by Bryan et al. (2018) for these same data using a radiative equilibrium model and calculating the autocorrelation function.It is important to note that we utilized the instrumental broadening value reported by Bryan et al. (2018) in our fits rather than re-deriving our own estimate of this parameter; this means that our result is not a fully independent confirmation of the measurement reported in this study.
Unlike with the low-resolution data, the P-T profile in the cloud-free retrieval does not appear to be compensating for the effects of clouds by adopting an isothermal stratosphere.In Fig. 3 we show that the shape of our derived P-T profile for cloud free retrieval agrees with predictions from the cloudless Sonora Bobcat forward model grid for an object of the same effective temperature and log(g) (Marley et al. 2021a,b), though it is possible that the presence of clouds would alter this profile.For models with clouds included, we find that the cloud parameters are unconstrained.This indicates that our high-resolution data are not biased in the same way as the low-resolution retrievals by the presence of clouds, and are instead relatively unaffected by the presence of clouds.
In order to investigate why our high-resolution retrievals do not appear to be biased by the presence of clouds the same way our low-resolution retrievals are, we examine where the flux originates in our atmosphere relative to the expected positions of cloud layers.In Fig. 6 we plot the flux contribution functions for our best-fit models for our high-resolution and low-resolution retrievals.In the low-resolution retrievals, we see that the flux primarily originals at pressures greater than 10 −1 bars, with some smearing out to lower pressures in the strong water features.For our high-resolution data, a substantial portion of the flux is emitted higher in the atmosphere, in the cores of individual lines.In Fig. 3, we show the contribution compared to our P-T profiles and condensation curves.We see that the intersection between the P-T profiles and condensation curves occurs deeper than where the flux contribution peaks in our high-resolution data.Based on this, is seems that the high-resolution data is less sensitive to clouds because the cores of the absorption lines probe higher in the atmosphere, above the clouds.In other words, the wavelength-averaged contribution function for our high resolution data lies above the predicted cloud base for all three cloud species considered here (see Fig. 3).While the continuum is probably still affected by clouds, we lose continuum information in our data analysis.Larger wavelength coverage out to other bands, or flux calibrated high-resolution data should improve the sensitivity of high-resolution data to cloud properties.

Joint Retrievals
In addition to fitting both our high-resolution and lowresolution data sets for ROXs 42B b individually, we fit both together in a joint retrieval.As with the individual retrievals, we consider all three types of cloud model, and fit for all the parameters shown in Table 2.We show a subset of our retrieved values for these retrievals in Table 3 and  In this joint fit, we find a lower metallicity and better constrained cloud properties for both our gray clouds and EddySed models, which were unconstrained in the fits using only the low-resolution data.We additionally find that our retrieved parameters depend strongly on the cloud model used.Like in other retrievals, we observe a trade-off between retrieved radius and T ef f , which is expected as those parameters together determine the total luminosity of the planet.For our cloudfree case, we find a multi-modal posterior, and that it is disfavored over either of our cloudy models.
We find that the addition of the high-resolution data forces the model P-T profiles to be less isothermal than the low-resolution data alone.As discussed in §5.1, it is highly unlikely for clouds not to be present in the atmosphere of a young hot object like ROXs 42B b, and more likely degeneracies in our models that resulted in our low-resolution retrievals favoring cloud free models.As a result, the Bayes factor strongly favors cloudy models, as cloud free models cannot provide a good match to both the shape of the low-and high-resolution spectra.Likely because it has fewer degrees of freedom and due to the lack of strong cloud features in the considered wavelength range, we find that our grey cloud model is preferred from the Bayes factor.
In the third panel of Fig. 3, we show our retrieved P-T profile for our preferred model.We find our P-T profile is consistent in the deep atmosphere with our high-resolution retrievals, but prefers a hotter upper atmosphere than the high-resolution retrievals alone.Our retrieved value for v sini is also sensitive to our choice  orange), compared with the retrieved cloud opacity for our grey slab cloud model (green) as a function of pressure, for our low-resolution only fits (dashed lines) and our joint high-resolution and low-resolution fits (solid lines).The grey shaded region represents the region of the atmosphere where the total contribution to flux is greater than 0.01%.For both cloud models we see that the in the low-resolution only case, the clouds are placed deep in the atmosphere where they have minimal impact on the flux, and the inclusion of the high-resolution data requires the presence of clouds to explain the observed data.
of cloud model in the joint fits.This is concerning, as the low resolution data do not contain any additional information about this parameter.For our EddySed cloud model, our retrieved value agrees with our highresolution only retrievals and the value from Bryan et al. (2018), while the clear and grey cloud models find a lower value.This suggests that the need to match both data sets simultaneously alters the preferred solution in a way that biases our measurement of v sini away from the true value.
In Fig. 7 we compared our retrieved cloud opacity for our retrievals on our low-resolution data only (dashed lines), and our joint retrievals (solid lines) for both our grey cloud models (green) and our EddySed cloud models (orange).We find that when we fit just the lowresolution data, the clouds are forced deep into the atmosphere where they do not affect the spectrum, while the P-T profile becomes isothermal to compensate for their effect (Fig. 3).When we jointly fit the low and high-resolution data, clouds are required to produce the observed absorption features of the high-resolution data and the shape of the low-resolution spectrum, forcing them into the visible region of the atmosphere.Given the strong dependence of cloud model on our retrieved abundances and planet properties, we decide to adopt the parameters from our high-resolution-only retrieval for subsequent analysis.

HOST STAR ABUNDANCES
We fit for host star abundances by performing a 'gridretrieval' where we interpolate the SPHINX model grid from Iyer et al. (2023).The SPHINX model grid spans the relevant parameter space for M-type stars in T ef f (2000 − 4000 K), gravity (log(g) between 4 − 5.5), C/O (0.3 − 0.9), and metallicity (log(Z) between −1.0 − 1.0).The SNIFS optical spectrum (see §3.3) contains the blended light from both binary components, so we model the spectrum as the sum of the flux contributions from each binary member.We then fit for the stellar radius, R * , effective temperature, T ef f and surface gravity, log(g) of each binary component.At each step in the fit, we scale our models to our flux calibrated spectrum using the Gaia measured distance of our system (146.447Gaia Collaboration 2022) and our stellar radii (see Table 1).We place a uniform prior of 0.5 − 3.5 on the binary flux ratio based on the K-band ratio reported by Kraus et al. (2014).
We assume that both components of the binary share a single C/O ratio and bulk metallicity.Published studies have found that the metallicities of wide separation binaries can differ by up to 0.03 − 0.1 dex, but this decreases with decreasing binary separation (e.g.Hawkins et al. 2020;Behmard et al. 2023).In this case, the binary components are only separated by ∼10 au (83 mas) (Kraus et al. 2014), and any differences in composition are therefore likely to be smaller than our measurement errors.We additionally fit for an optical extinction coefficient, A V , to account for extinction from dust and gas in the star forming complex.We also include an error inflation term as defined in Eq. 3 to allow for the possibility of data-model mismatches.Iyer et al. (2023) found that their models differed from the measured spectral shapes more at shorter wavelengths, suggesting that this region may be particularly challenging from a model fitting perspective.We use nested sampling with 1000 initial live points.
We list the retrieved values for each component of the binary in Table 1.We obtain an optical extinction coefficient of A V = 1.4 ± 0.1, which is consistent with the value reported by Bowler et al. (2014).Our retrieved stellar radii are 1.42±0.01R ⊙ and 1.59±0.02R ⊙ .Both of these values are consistent with predictions from the BHAC15 evolutionary model grids for low mass stars at the approximate age of these system (Baraffe et al. 2015) using the measured masses of the binary components from Kraus et al. (2014).However, when we invert our posteriors for our log(g) and radius, we find mass values of: M 1 = 1.12 ± 0.13 M ⊙ and M 2 = 1.29 ± 0.26 M ⊙ .While the mass of the more massive component is consistent within 2 σ, the less massive component is inconsistent at 3.5σ.This could be potentially due to flux  2001) (dashed lines).The grey box represents the photometry-derived mass and radius from previous studies (Currie et al. 2014a;Daemgen et al. 2017).The grey point on the left is calculated using the radius and log(g) values from our joint retrieval.The dark grey point on the right is calculated using the radius and log(g) values from our lowresolution only retrieval.calibration errors, a slightly incorrect distance, or slight issues with the models leading to an incorrect radius.Alternatively, since this is a very young system, activity of the stars could be contributing.
We note the disagreement between our models and data from 7000 -9000 nm.This could be due to contamination from the strong telluric bands present at these wavelengths, missing opacity in the model, or interpolation errors from the limited grid resolution.Regardless, we overall find a decently good fit to our data, with values that match predictions for this system.We retrieve a C/O ratio of 0.50 ± 0.05 for ROXs 42B b from our high-resolution fits, in good agreement with the measured C/O ratio of 0.54±0.01for its host binary, ROXs 42B A+B.We find a similarly consistent sub-solar metallicity of −0.67±0.35for the planet and −0.30±0.03for the host binary, respectively, although we note that our value for the planet is poorly constrained in the high-resolution retrieval.Our retrieved metallicity for the host binary is in good agreement with the small number of published metallicity measurements for other stellar members of ρ-Ophuchius complex, which range from [Fe/H]= −0.3 to +0.05 (Spina et al. 2017).Other young star forming regions with more extensive metallicity measurements span a similar range of values (Spina et al. 2017).The fact that the primary in this system is a close binary is also consistent with a metallicity on the low end of this range.Both surveys and simulations of star formation have shown that the frequency of close binaries increases with decreasing stellar metallicity (Moe et al. 2019;Bate 2019;Moe & Kratter 2021).
We next consider whether or not our inferred mass and radius for ROXs 42B b are consistent with the predictions of evolutionary models.Our high-resolution retrievals give a log(g) value of 3.49 ± 0.48 which is consistent with model predictions for an object of this age and mass, as well as previously published gravity values for ROXs 42B b, which were derived by matching its photometry with spectroscopic model grids sampling effective temperature and log(g).As discussed earlier, our high-resolution data are continuum normalized and therefore do not constrain the planet radius, which is derived from the overall luminosity.If we take the retrieved log(g) and radius from our low-resolution fits and use them to calculate a mass we find a value of M p = 16 +11 −7 M J for our free P-T profile retrievals, and M p = 6.5 +1.6  −0.3 M J for our fixed P-T and A V retrievals.When we include our high-resolution data in the joint retrievals, this value becomes significantly smaller and more precise at M p = 4.1 +0.9 −0.9 M J .We compare this mass and radius to predictions from the COND and DUSTY evolutionary model grids in Figure 9.As a member of the ρ-Ophiucus complex, ROXs 42B has an estimated age between 1-5 Myr (Kraus et al. 2014).We therefore expect the radius of ROXs 42B b to be significantly larger than that of older objects with equivalent masses.We find our low-resolution retrievals give results consistent with previous studies and evolutionary model grids, while our joint retrievals give a mass and radius that imply a planet even younger than 1 Myr.It is possible that this object is younger than 1 Myr, as planet formation can take several Myr, thus the age of the companion may be younger than the isochronal age derived for stellar members of ρ-Ophiuchus.However, given the degeneracies and issues discussed above in both these retrievals, and their consequences on the retrieved radii, we cannot be sure either value reflects the true properties of this system.

Constraints on Formation and Migration History
There have been multiple studies of directly imaged companions that have attempted to leverage their atmospheric compositions to constrain their formation and migration histories.Whiteford et al. (2023) found a super-solar C/O ratio of 0.97 +0.09 −0.2 , and a poorly constrained, but broadly consistent with solar, metallicity of [Fe/H] = −0.04+0.95  −0.49 for 51 Eri b (Macintosh et al. 2015), but note possible degeneracies with clouds in their models.Brown-Sevilla et al. (2023) reported a sub-solar C/O = 0.38 ± 0.09 and a metallicity [Fe/H] = 0.26 ± 0.30 for this same planet, which they argue is evidence in favor of formation via core accretion.However, their argument assumes that the host star has a solar C/O ratio.
The planets in the HR 8799 system are considered strong candidates for formation via gravitational instability, as it is difficult to produce four relatively massive planets around a low metallicity star via core accretion unless it hosted an unusually large protoplanetary disk (Mollière et al. 2020;Ruffio et al. 2021;Wang et al. 2020).Atmospheric retrievals of HR 8799 e by Mollière et al. (2020) andHR 8799 b,c,d (Ruffio et al. 2021) found that all of the planets in this system have C/O ratios consistent with the stellar value (Wang et al. 2020), in agreement with expectations for formation via disk instability.Ruffio et al. (2021) did not fit for metallicity for HR 8799 b,c,d, but found that solar metallicity templates were consistent with their data.HR 8799 is a λ Boötis type star, with a highly sub-solar iron abundance of [Fe/H] = −0.65 +0.02 −0.01 (Swastik et al. 2021), and C/H and O/H ratios consistent with solar values (Wang et al. 2020).Retrievals by Mollière et al. (2020) find a moderate metallicity enhancement of 0.48 +0.25  −0.29 for HR 8799 e, the inner planet of this system, which has a similar orbital distance to 51 Eri b at 16 au.There is evidence that the recently discovered AF Lep b (Franson et al. 2023;De Rosa et al. 2023;Mesa et al. 2023), orbiting at around only 9 au, has a substantial metal enrichment ([Fe/H] > 1) relative to its host star ([Fe/H] = −0.27± 0.31), indicating substantial planetismal accretion, consistent with the observed debris disk around the star (Zhang et al. 2023).
Our results indicate that ROXs 42B b's C/O ratio and metallicity are also consistent with the stellar value, suggesting that it may share the same formation mechanism as the outer planets of the HR 8799 system.ROXs 42B b orbits at a distance much greater than any of the HR 8799 planets, which are all within 70 au.The CO ice line for an A type star like HR 8799 could lie anywhere between ∼50-hundreds of au depending on the disk properties (Oberg et al. 2011;Qi et al. 2015;Ruffio et al. 2021), so it is possible the planets in this system could have formed beyond it and then migrated inward afterward.
While it is often assumed that stellar C/O ratios are more likely when planets form via gravitational instability, there is one important caveat to this picture.At large separations where virtually all of the carbon-and oxygen-bearing species have condensed out into solids, the solid component of the gas will have a roughly solar C/O ratio.The gas in this region will be metal-poor, with a C/O ratio of ∼1 due to a small amount of residual CO in the gas phase.As a result, planets formed in this region should have stellar C/O ratios as long as they accrete any amount of solids, whether they form from core accretion or disk instability (Turrini et al. 2021;Chachan et al. 2023).In Fig. 10 we show the expected atmospheric C/O ratio for ROXs 42B b as a function of final atmospheric metallicity, and the carbon abundance of the gas accreted, assuming formation beyond the C/O snowline.For our retrieved atmospheric metallicity constraints, we find that non-stellar C/O ratios are possible, but only for much larger than expected C abundances in the gas phase.
Our observations may also be consistent with a scenario in which the planet accreted most of its mass at smaller orbital separations before migrating outward and accreting its uppermost atmospheric layers beyond the CO ice line.If the planet's atmospheric envelope is not well mixed and instead has a layered structure similar to that of Jupiter (Debras & Chabrier 2019;Stevenson 2020), the observed C/O ratio would only reflect the material accreted towards the end of the planet formation process.It is possible that dynamical interactions with the primary binary during and after formation (e.g.Kozai-Lidov cycles) could have caused ROXs 42B b to migrate outward, akin to the dynamical evolution of a triple star system.In these three body systems, the or-bit of the third body is unstable for orbital separations of less than ∼3 times the orbital separation of the primary binary (Tokovinin & Moe 2020).Using the present day projected binary separation, we find that the orbit of ROXs 42B b would have become unstable if it was located within ∼ 30 au of the primary binary; this is well outside the predicted location of the CO ice line.While it is possible that ROXs 42B b formed in-situ at its currently observed location of 140 au (Bryan et al. 2018), the low expected disk surface densities at these large separations make it difficult to form such a massive planet through any formation channel.If it instead formed closer in (but still beyond 30 au) and then migrated outward, this would also be consistent with our observed C/O ratio.
The atmospheric metallicities of these objects provide us with complementary constraints on their formation and migration histories.Disk instability should produce planets with stellar compositions, although the presence of pressure bumps and spiral structures (e.g.Boley et al. 2011) can result in localized enhancements or reductions of metals compared to the surrounding nebula.Additionally, disk instabilities are most likely to occur early on, when the disk is more massive.If the protoplanet remains embedded in the disk after its formation, it could accrete additional solids and become enriched in metals.This may be more challenging for relatively massive gas giants like ROXs 42B b, which would need to accrete a significant fraction of the total solid budget of the disk in order to appreciably enhance its atmospheric metallicity (∼ 2 M J of solids for 10× metallicity predicted by our low-resolution retrievals).In the solar system, there is an ongoing debate over how to supply Jupiter with enough solids to produce its relatively modest metallicity of 3× solar (e.g., Shibata & Helled 2022).Planets that migrate through the disk are predicted to end up with greater metal enhancements, as both pebble accretion (Humphries & Nayakshin 2018) and planetesimal accretion (Shibata et al. 2020;Turrini et al. 2021) become more efficient when the planet moves radially through the disk.Morbidelli et al. (2023) show that giant planets forming in the inner regions of the disk can incorporate significant quantities of dust into their atmospheres, but this process becomes much less efficient in the outer disk where pressure bumps and gaps cut off the supply of pebbles to the giant planet.
Our retrieved metallicity for ROXs 42B b is both subsolar and slightly sub-stellar, consistent with expectations for in situ formation via gravitational instability.Low metallicity gas cools more quickly due to the lower gas opacity, and low metallicity disks are therefore more likely to fragment (Moe et al. 2019).Given the small (∼10 au) orbital separation of the primary binary (Kraus et al. 2014), it is likely that the host stars formed via disk fragmentation.This would mean that either the original disk was fairly massive or that it had high stellar accretion rates in order to produce two separate fragmentation events that formed massive companions (Tokovinin & Moe 2020).However, gas in the outer disk is also expected to be metal-poor due to the condensation of most carbon-and oxygen-bearing species, and our observations could therefore also be explained by accretion of metal-poor gas onto a solid core located in the outer disk.Because small solids tend to migrate inward over time, there might be relatively little solid mass left in the outer disk by the time the planet was accreting the outermost layers of its envelope.
It is also possible that rather than forming from within the circumstellar disk, ROXs 42B b could have form via turbulent fragmentation during the initial cloud collapse stage, making it analogous to wide binary stars.In this case, it is more surprising that it would have a composition similar to its host star, as wide binaries have been observed to have larger chemical variations (e.g.Hawkins et al. 2020;Behmard et al. 2023), but not inconsistent with this formation mechanism.However, given the very low mass of this companion, this is a less likely scenario as cloud collapse events occur when there is a significant gas reservoir, meaning that wide companions with extreme mass ratios are rare (Fisher 2004).
Lastly, we consider whether our retrieved radius for ROXs 42B b might provide additional constraints on its formation mechanism.The amount of internal energy at formation is determined by the rate at which the planet forms.'Hot start' models assume that the planets form quickly without sufficient time to cool; this is broadly consistent with a process like disk instability, which is expected to occur on relatively short timescales Burrows et al. (2003); Marley et al. (2007).On the other hand, 'cold start' models assume a relatively slow formation process, more analogous to core accretion, though core accretion planets could potentially fall in the hot start regime, given that types of models depend on poorly constrained accretion processes.Both the COND and DUSTY models shown in Fig. 9 fall in the hot start regime.We compare our measured mass and radius for ROXs 42B b to the models presented in Spiegel & Burrows (2012) and find that we are unable to distinguish between these scenarios with the current large uncertainties in the planet mass and system age.For masses on the high end of our allowed range we can still match the planet's measured radius with cold start models, while masses on the lower end of our range are most consistent with hot start models.

CONCLUSIONS
In this paper we present the results of atmospheric retrievals on the young directly imaged planet ROXs 42B b using low-and high-resolution spectroscopy.We find that our low-resolution spectra are sensitive to the presence of clouds, which are degenerate with the retrieved temperature structure, composition, and radius.We see no sign of this degeneracy in our high-resolution retrievals, which return consistent constraints regardless of our choice of cloud model.We retrieve a C/O ratio of 0.504 ± 0.048 and a subsolar metallicity of −0.67 ± 0.35 for ROXs 42B b using our high-resolution data.We additionally constrain the projected spin rate vsini to be 10.52 ± 0.92 km s −1 , which is consistent with previous measurements.We conclude that high-resolution retrievals offer a promising avenue for obtaining robust abundance constraints for cloudy objects like ROXs 42B b.Future high-resolution studies of this planet would benefit from broader wavelength coverage, which should provide tighter constraints on cloud properties.
We also derive abundances for the unresolved binary host, ROXs 42B, using low-resolution SNIFS optical spectroscopy and the SPHINX M dwarf model grid from Iyer et al. (2023).We retrieve a C/O ratio of 0.54 ± 0.01 and metallicity of −0.30 ± 0.03 for the binary, which are consistent with our retrieved planetary values within 1σ.This result is consistent with expectations for both disk instability and core accretion models given ROXs 42B b's wide orbital separation, as it likely formed beyond the CO snow line where all major carbon-and oxygencarrying species have condensed out of the gas phase.However, the low retrieved metallicity of both the host star and planet, as well as the retrieved C/O ratio, is most consistent with formation in the outer disk via gravitational instability.Measurements of the orbital eccentricity or obliquity of ROXs 42 B b would provide another dimension that could help to better constrain its origins, as high eccentricities and misaligned obliquities are predicted to be common for planets that form via gravitational instability (Bowler et al. 2020a;Bryan et al. 2021).While both an eccentricity (Bowler et al. 2020a) and variability measurement (Bowler et al. 2020b) for this system exist, they are both only upper limits.Mapping out the orbit of the primary binary would additionally provide extra information on the geometry of this system.
If we wish to obtain better constraints on the cloud properties of ROXs 42B b, mid infrared coverage with JWST/MIRI (5-16 µm) could provide access to features diagnostic of individual clouds species (Wakeford & Sing 2015), including silicate features between 8-10 µm.A direct measurement of this silicate feature could help place tighter constraints on the location and scattering properties of cloud particles in ROXs 42B b's atmosphere, potentially mitigating the cloud-temperature degeneracy in the current near-infrared low-resolution data.Similar features were observed in 2M2224-0158 with Spitzer, which Burningham et al. (2021) were able to reproduce in their models using a combination of silicate and quartz clouds.Absorption features from silicate cloud have also be observed in the companion VHS 1256-1257 b with JWST (Miles et al. 2023).These observations demonstrate the power of mid-infrared observations in constraining clouds in young isolated objects.

ACKNOWLEDGEMENTS
This research was carried out at the Jet Propulsion Laboratory and the California Institute of Technology under a contract with the National Aeronautics and Space Administration and funded through the President's and Director's Research & Development Fund Program.The computations presented here were conducted in the Resnick High Performance Center, a facility supported by Resnick Sustainability Institute at the California Institute of Technology.Some of the data presented herein were obtained at the W. M. Keck Observatory, which is operated as a scientific partnership among the California Institute of Technology, the University of California and the National Aeronautics and Space Administration.The Observatory was made possible by the generous financial support of the W. M. Keck Foundation.The authors wish to recognize and acknowledge the very significant cultural role and reverence that the summit of Maunakea has always had within the indigenous Hawaiian community.We are most fortunate to have the opportunity to conduct observations from this mountain.

Figure 1 .
Figure 1.Cross-correlation functions (CCFs) showing detections of CO and H2O using two orders (2.27 − 2.38 µm) from the high-resolution NIRSPEC K-band spectrum.The significance is computed by dividing the CCF by the standard deviation of the out-of-peak baseline.

Figure 2 .
Figure 2. Retrieved best-fit model (green) compared to our low-resolution JHK-band spectrum from Bowler et al. (2014) (top panel) and error-weighted residuals (lower panel).Our full low-resolution retrievals are compared to the best fit model (yellow) from our retrievals where our P-T profile is fixed to a Sonora Bobcat P-T profile from(Marley et al. 2021b).The horizontal black line indicates the wavelength coverage of our Keck/NIRSPEC high-resolution K-band data for comparison.

3.
ARCHIVAL DATA USED IN THIS STUDY 3.1.Low-resolution Spectroscopy of ROXs 42B b Bowler et al. (

Figure 3 .
Figure3.Retrieved pressure-temperature (P-T) profiles for our best-fit models (bold in Table3) for our low-resolution data (left), high-resolution data (center) and both combined (right).Randomly sampled P-T curves are plotted in green.Condensation curves for important cloud species in young hot objects, Fe, Al2O3, TiO2 and MgSiO3 are shown for comparison (dotted lines).We overplot a Sonora Bobcat model(Marley et al. 2021a,b)  corresponding to the photometrically derived temperature and log(g).The grey gradient corresponds to the value of the wavelength-integrated flux contribution function.
are required in order to accurately model their lowresolution spectra (e.g.Burningham et al. 2017Burningham et al. , 2021;;Mollière et al. 2020;Lueber et al. 2022).Both Bowler  et al. (2014)  andCurrie et al. (2014a) found evidence for the presence of clouds in the atmosphere of ROXs 42B b when comparing to grid models.Spitzer mid-infrared spectroscopy of isolated brown dwarfs with spectral types similar to that of ROXs 42B b indicate that absorption from silicate grains is ubiquitous in these atmospheres(Suárez & Metchev 2023).There are many cloud models of varying complexity in the literature, ranging from one parameter opaque cloud decks, to multiple cloud decks of different scale heights, pressure bases, and scattering properties.We consider two different cloud models in our retrievals: a simple, 3 parameter gray cloud deck, and the more complicated, physically motivated EddySed cloud model(Ackerman & Marley 2001;Mollière et al. 2020).

Figure 4 .
Figure 4. Corner plot comparing the posterior probability distributions of key parameters from our fixed and free P-T profile retrievals on our low-resolution spectrum using gray cloud model and a) unrestricted spline pressure-temperature (P-T) profile, b) the P-T profile fixed to a Sonora P-T profile (Marley et al. 2021a,b), and c) a P-T profile fixed to a Sonora model P-T profile and the reddening coefficient fixed to the best fit stellar value from Bowler et al. (2014).

Figure 5 .
Figure 5. Corner plot comparing the posterior probability distributions of key parameters from retrievals on our high-resolution spectrum for three different cloud models: a clear sky, a simple gray cloud deck, and EddySed condensate clouds composed of Fe and MgSiO3.We find identical posterior probability distributions regardless of the cloud model used.

Figure 6 .
Figure 6.Contribution functions for the best-fit models for our low-resolution (left) and high-resolution (right) retrievals.
the full posteriors are shown in Fig 11.

Figure 7 .
Figure7.The retrieved cloud opacity for our EddySed cloud model (orange), compared with the retrieved cloud opacity for our grey slab cloud model (green) as a function of pressure, for our low-resolution only fits (dashed lines) and our joint high-resolution and low-resolution fits (solid lines).The grey shaded region represents the region of the atmosphere where the total contribution to flux is greater than 0.01%.For both cloud models we see that the in the low-resolution only case, the clouds are placed deep in the atmosphere where they have minimal impact on the flux, and the inclusion of the high-resolution data requires the presence of clouds to explain the observed data.

Figure 8 .
Figure 8. Best fit model to the SNIFS optical spectrum of the unresolved binary ROXs 42B (top panel) and error-weighted residuals (lower panel).The best fit model is shown in green, with random drawn samples shown in gray.

Figure 9 .
Figure 9. Radius as a function of mass at multiple epochs from multiple evolution model grids: the COND model grid (solid lines) and the DUSTY model grid from Allard et al. (2001) (dashed lines).The grey box represents the photometry-derived mass and radius from previous studies(Currie et al. 2014a;Daemgen et al. 2017).The grey point on the left is calculated using the radius and log(g) values from our joint retrieval.The dark grey point on the right is calculated using the radius and log(g) values from our lowresolution only retrieval.
Properties of the ROXs 42B System

Figure 10 .
Figure10.Predicted C/O ratio of ROXs 42B b as a function of final atmospheric metallicity and the carbon abundance of the gas accreted by the planet, assuming formation outside the CO snowline.Our derived metallicity constraints from our high-resolution fits are shown as white lines.

Figure 11 .
Figure 11.Corner plot comparing the posterior probability distributions of key parameters from joint retrievals on our lowresolution and high-resolution data sets for our three considered cloud models, a clear sky, a simple gray cloud deck, and EddySed condensate clouds composed of Fe and MgSiO3.

Figure 12 .
Figure 12.Corner plot comparing the posterior probability distributions of key parameters from retrievals on our low-resolution spectrum for our three considered cloud models, a clear sky, a simple gray cloud deck, and EddySed condensate clouds composed of Fe and MgSiO3.

Table 3 .
Best-fit values and confidence intervals for key parameters from ROXs 42B b retrievals.