The GALAH survey: Elemental abundances in open clusters using joint effective temperature and surface gravity photometric priors

The ability to measure precise and accurate stellar effective temperatures ($T_{\rm{eff}}$) and surface gravities ($\log(g)$) is essential in determining accurate and precise abundances of chemical elements in stars. Measuring $\log(g)$ from isochrones fitted to colour-magnitude diagrams of open clusters is significantly more accurate and precise compared to spectroscopic $\log(g)$. By determining the ranges of ages, metallicity, and extinction of isochrones that fit the colour-magnitude diagram, we constructed a joint probability distribution of $T_{\rm{eff}}$ and $\log(g)$. The joint photometric probability shows the complex correlations between $T_{\rm{eff}}$ and $\log(g)$, which depend on the evolutionary stage of the star. We show that by using this photometric prior while fitting spectra, we can acquire more precise spectroscopic stellar parameters and abundances of chemical elements. This reveals higher-order abundance trends in open clusters like traces of atomic diffusion. We used photometry and astrometry provided by the \textit{Gaia} DR3 catalogue, Padova isochrones, and Galactic Archaeology with HERMES (GALAH) DR4 spectra. We analysed the spectra of 1979 stars in nine open clusters, using MCMC to fit the spectroscopic abundances of 26 elements, $T_{\rm{eff}}$, $\log(g)$, $v_{\rm{mic}}$, and $v_{\rm{broad}}$. We found that using photometric priors improves the accuracy of abundances and $\log(g)$, which enables us to view higher-order trends of abundances caused by atomic diffusion in M67 and Ruprecht 147.


INTRODUCTION
Open clusters provide a unique environment to study the chemical abundances of stars.With open clusters, we are given a set of tens to a few thousand stars that were born in the same star forming region, thus, they are chemically homogeneous (De Silva et al. 2006, 2007;Feng & Krumholz 2014).Open clusters are quickly disrupted but they remain kinematically homogeneous for a few hundred million years, with the oldest open clusters observed being 2-3 Gyrs (Bubar & King 2010;Rangwal et al. 2019;Sariya et al. 2021).This allows for stars in the open cluster core to be easily distinguished from field stars using their kinematics.The kinematic and chemical homogeneity means open clusters have been used as a place to benchmark distances (Bailer-Jones et al. 2021), measure their ages with high precision * E-mail: klbeeson@gmail.com(Jeffery et al. 2016), study the role of physical processes such as atomic diffusion that will affect the chemical abundances of stars (Liu et al. 2019), examine the possibility of strong chemical tagging (Casamiquela et al. 2021a), study stellar rotation rates of entire stellar populations (Sun et al. 2019;He et al. 2023), and study the chemical trends of the galactic disk (Neyer et al. 2023).
Chemical tagging is the idea that by measuring chemical abundances, one can group stars with similar chemical signatures into physically meaningful populations (Freeman & Bland-Hawthorn 2002).There are two types of chemical tagging: weak and strong.Weak chemical tagging groups together stars that originated from the same galactic environment.An example is tagging to find the remnants of disrupted satellite galaxies (Freeman & Bland-Hawthorn 2002;Buder et al. 2022).The second type is strong chemical tagging, the grouping of stars that originated from the same birth cluster.The possibilities of strong chemical tagging have been explored in Casamiquela et al. (2020); Dotter et al. (2017); Ting et al. (2019); Casamiquela et al. (2021b).If strong chemical tagging can be done, it will give major insights into the dynamical history of stars in our Galactic disk.
The extent of chemical homogeneity and the uniqueness of each open cluster's abundance pattern are essential in determining how viable chemical tagging is.Open clusters are believed to be chemically homogeneous when initially created, as any chemical signatures in the star forming region have time to homogenise and star formation has finished before any supernovas can occur, which can change the chemical composition of the star forming region (Bland-Hawthorn et al. 2010;Feng & Krumholz 2014).However, during the star's life, some effects can cause chemical inhomogeneities to occur.One of the causes of chemical inhomogeneities is the existence of planets around the star.As rocky planets are formed, they will be made out of elements with a high condensation temperature, causing the abundance of these elements in the star to be lower.As some of the planets have a highly eccentric orbit, they will be reabsorbed during the star's life cycle, which causes the surface abundances of the elements with a high condensation temperature to increase (Meléndez et al. 2009;Liu et al. 2016;Spina et al. 2018).
Atomic diffusion is another factor contributing to the chemical inhomogeneities of stars within open clusters.Atomic diffusion is a physical process where gravitational settling driven by temperature and pressure gradients concentrates heavier elements towards the centre of the star while radiative acceleration pushes elements away from the centre (Michaud et al. 1984(Michaud et al. , 2015)).The effects of atomic diffusion are most significant as a star reaches the turn-off-point on the colour-magnitude diagram.As a star reaches its turn-off point, the effects of gravitational settling will be greater compared to the radiative acceleration, and consequently the concentration of heavy elements will decrease as they sink from the surface layer to the convection region.After the star has passed the turn-off point, the convection zone will deepen.As a result, the elements that have sunk to the convection region will now be found in the surface layer.This change will increase the concentration of these elements once again on the surface layer.Atomic diffusion is one of the drivers that reduces the chemical homogeneity of stars in open clusters.In M67, atomic diffusion will create inhomogeneity to a 0.2 dex level for certain elements (Liu et al. 2019).
Surface gravity is used as a marker of how far along the star is in its evolutionary stage.The uncertainty of spectroscopic measurements of log() is typically on the order of 0.1-0.25 dex (Jofré et al. 2019).This is because log() only has a weak effect on the observed spectra.An uncertainty of 0.25 dex in log() will significantly affect where we view the star in its evolutionary stage.If the measured log() is imprecise, the effect of atomic diffusion will be observed as scatter in abundances rather than a trend in abundances with respect to log().
Photometry has been used to measure much more accurate and precise log() than spectroscopy for stars in open clusters.In Kos et al. (2019Kos et al. ( , 2021)), they fitted Padova (Bressan et al. 2012;Chen et al. 2014Chen et al. , 2015;;Marigo et al. 2017;Pastorelli et al. 2019;Tang et al. 2014) isochrones to HR diagrams of open clusters.The isochrones were fitted very precisely, as the open clusters had stars at various evolutionary stages.The nearest point in Gaia's three photometric bands (,   , and   ) space from the star to the isochrone is used to measure  eff and log().Using the photometric  eff and log() as priors when fitting abundances and stellar parameters to spectra increased the accuracy of log() and the precision of abundances.
Gaia (Gaia Collaboration 2016;Gaia Collaboration et al. 2023) has transformed the study of open clusters.The precise astrometry has significantly improved cluster membership identification, leading to the rejection of 50% of the pre-Gaia era open cluster listings (Cantat-Gaudin et al. 2018).Furthermore, Gaia's precise kinematic data has provided unique insights into the three-dimensional structure of open clusters (Armstrong et al. 2022).By combining precise photometry and astrometry, the mission has enabled accurate age determinations for open clusters (Bossini et al. 2019).In the third data release, Gaia has released the full astrometric solution (positions on the sky, parallax, and proper motion) for 1.46 billion sources and photometry in its three bands for 1.54 billion sources.
Many large spectroscopic surveys with a high resolution (R> 20 000) have targeted open clusters as part of their observing time.A notable example is the Gaia-ESO survey (Randich et al. 2013;Gilmore et al. 2012) which has dedicated a significant fraction of time to target open clusters.Gaia-ESO has provided a homogeneous set of 65 open clusters (Bragaglia et al. 2022).GALAH (De Silva et al. 2015) and APOGEE (Majewski et al. 2017) have targeted open clusters as part of their calibration process (Kos et al. 2018;Donor et al. 2018) and have often observed open cluster stars serendipitously.These large spectroscopic surveys produce cutting-edge abundance measurements and spectral parameters for these stars.Consequently, they enable the comprehensive exploration of abundance trends and the assessment of homogeneity within a diverse range of open clusters.
This paper aims to explore the effect of using a joint  eff and log() photometric prior on spectroscopic  eff , log(), micro-turbulence ( mic ), broadening velocity ( broad ), and 26 elemental abundances.We first explore how to calculate better photometric  eff and log() by improving the calculated absolute magnitude.The absolute magnitude is improved by optimising the precision and accuracy of how we measure individual distances to stars in open clusters.Then, we examine how the joint photometric prior changes between stars at different evolutionary stages.To determine the effect of using a joint  eff and log() for spectroscopic fitting, we fit the spectra of 1979 stars in nine open clusters with and without a photometric prior.We compare the scatter in abundances in these two methods and determine whether higher-order trends such as atomic diffusion are visible in both methods.We examine the validity of the precision of abundances and stellar parameters calculated using Markov chain Monte Carlo (MCMC) and we examine how well GALAH DR4 measures its precision.
The structure of the paper is as follows: Sec. 2 describes how we selected the members of the open clusters using astrometry and photometry from the Gaia DR3 catalogue, our method to improve Gaia DR3 distances to stars in open clusters using a cluster centre distance prior, our technique to calculate the  eff and log() joint probability from isochrones fitted to HR diagrams, and our approach to generate synthetic spectra and fit stellar parameters and elemental abundances to GALAH spectra using the joint  eff and log() photometric prior.Sec. 3 describes the distance improvements after using the cluster centre prior, the best-fitting isochrones, and the resulting photometric  eff and log() joint probability distributions, and the effect of the photometric  eff and log() joint probability prior on spectroscopic abundances.The section also includes a comparison between our abundances and GALAH DR4 (Buder et al. 2023, in preparation).Sec. 4 describes our spectroscopic precisions and the ways we verified them, we also examine how well GALAH DR4 estimates their abundance precision.Sec. 5 is our discussion of the implications of our results, and Sec.6 collects our conclusions.

METHODS AND DATA
To create a joint  eff and log() photometric prior to get better abundances for stars in open clusters, we first have to tackle the problem of how to acquire the best photometry, specifically the best absolute magnitudes given the measured observed magnitudes and parallaxes.This process will be elaborated upon in the next section, 2.1.We describe selecting the open cluster stars through Gaia and which priors we used to make the distance measurements more accurate and precise.After acquiring these improved absolute magnitudes, we need to be able to get representative stellar parameters and their uncertainties.In 2.2, we describe how we calculated photometric stellar parameters and their precision from individual isochrones and how to construct a joint  eff and log() probability distribution from the ranges of ages, metallicities, and extinction obtained from the fitting isochrones to HR diagrams of open clusters.Lastly in Sec.2.3, we describe how we synthesised spectra and how we fitted spectra using photometric stellar parameters as priors.

Calculating better distances to open clusters
Using the Gaia DR3 catalogue, we get access to photometry in the ,   , and   bands, and the astrometry (ranging from proper motions and parallax to positions) of over 1.46 billion objects using 34 months of observation.The catalogue gives us an excellent way to probe open clusters with high completeness of objects brighter than  = 19 (Fabricius et al. 2021).The Gaia DR3 catalogue provides excellent photometry with an average uncertainty of 1, 12, and 6 mmag for the ,   , and   bands respectively at  = 17 mag (Riello et al. 2021).The parallax provided has a median uncertainty of 0.07 mas at  = 17 (Lindegren et al. 2021).
Using absolute magnitudes of stars in open clusters, we can make HR diagrams of said clusters and fit isochrones to them.Using the isochrones, we can calculate the  eff and log() of the stars.The two sources of uncertainties in the absolute magnitude come from the measurement uncertainty of apparent magnitudes and the uncertainty in the distance of the star (the parallax).The latter is the main contributor to the absolute magnitude uncertainty.Even in a nearby cluster such as Melotte 22 (∼ 130 pc), the contribution from the distance uncertainty is around 13 times larger than the contribution from the apparent magnitude measurement.
In the next subsection, we explain our selection function to acquire Gaia DR3 open cluster stars, and in 2.1.2we explain our updated cluster distance prior to increase the accuracy and precision of the parallax.

Selecting open cluster members
We decided to only use the stars that are easily differentiable from field stars in proper motion space to minimise contamination.The population obtained will mainly comprise stars from the open cluster core.We selected the stars that belong to each open cluster from the Gaia DR3 archive.To do this, we use several criteria, we represent the searched parameters in brackets: • Using a conical search around the centre of the cluster to limit ( (ra),  (dec)) of each star.The size of the conical search was determined by eye using the Gaia data.
• Constraining the parallax by introducing a minimum and a maximum parallax.The parallaxes and their maximum and minimum values were selected by eye using the Gaia data.
• Limiting   cos() (pmra) and   (pmdec) using maximum   and   cos().This is done as open cluster members still share the same kinematic values.The   cos() and   and their maximum and minimum values were selected by eye using the Gaia data.
We also implement quality cuts to make sure the chosen observations of cluster members have the required quality: • Visibility periods (visibility_periods_used) ≥ 7 as recommend in Lindegren et al. (2018).
• Limits on precision on the blue and red magnitudes (G BP and G  ) excess factors (phot_bp_rp_excess_factor) as recommend in Gaia Collaboration et al. (2018).
• Limits on the goodness of fit of the parallaxes using the chi squared fit on the astrometry (astrometric_chi2_al) as recommend in Gaia Collaboration et al. (2018).
The ADQL code for selection is provided in Appendix A. The values used in the selection criteria and quality cuts are shown in table 1.To create the list of open clusters, we selected the nine clusters with the highest number of observed stars in GALAH DR4.

Calculating distances to open clusters
The recommended method to calculate distances for individual stars is to use the likelihood and priors in Bailer-Jones et al. (2021).The likelihood is shown in equation 1.The paper introduces a geometric prior and a photometric prior.The geometric prior uses our knowledge of the empirical distribution of stars based on their celestial position, and the photometric prior uses the fact that the colour space of the stars is not uniformly distributed with respect to distance.We have decided to only use the geometric prior.The photometric prior, as described in Bailer-Jones et al. (2021) applies to individual stars rather than a cluster.
The following equations are used for estimating distances to individual stars using the method outlined in Bailer-Jones et al. (2021).
Equation 2 describes the probability of a star being at a distance , given its parallax(), uncertainty in parallax (  ), , , and ., , and  are the parameters of the empirical probability distribution of stars in the galaxy modelled using a three-parameter Generalised Gamma Distribution, their values depend on the galactic longitude and latitude.Thus, for every star with a different line of sight their , , and  values will be different.A fuller description of , , and  can be found in Bailer-Jones et al. (2021).The first component of equation 2 is likelihood shown in equation 1 for an individual star at , with  and  0 (zero point correction), N is a normal distribution, and  is the normalising constant.The zero point correction is used as the zero point of the parallax in Gaia is not at 0. The zero point correction is dependent on the celestial position and the number of  (Ren et al. 2021).Geometric prior is shown in equation 3.
To decrease the distance uncertainty we will use the fact that the stars are in the open cluster's core.If we assume the distribution of stars in the cluster is a normal distribution around the cluster centre and if we know the distance to the centre of the cluster () and the radial size of the cluster (), we will be able to create a cluster distance prior for the cluster.We decided to use a normal distribution to model the open cluster core rather than a more complicated distribution such as the Elson, Fall, and Freeman profile (Elson et al. 1987), as the difference between these profiles in the resulting cluster centre distance and size will not be large enough to significantly affect the resulting absolute magnitude.
Therefore we shall first calculate the probability distribution of  and .We introduce another prior for the radial size of the cluster.This is done so the radial cluster size can not be negative or too large; the prior used is a gamma distribution as proposed in Luri et al. (2018).The cluster distance prior and the cluster size prior are shown below.
Where shape () and scale () are the parameters of the cumulative distribution function of the Gamma distribution.We have chosen a  and  that make the mean of the Gamma distribution 10 pc and a variance of 0.05 pc, which are the recommended values in Luri et al. (2018).By combining equation 2, 4, and 5, marginalising over  we can get the probability distribution of  and  for a single star: To calculate the probability distribution of  and  for a cluster, we convolve the probability distribution of each star to make: With said probability distribution, we can now find more accurate individual distances by combining equations 2 and 4 with  (, ) and marginalising a star's radial position through  and .

L(𝑟 |𝜛, 𝜎
To implement these equations, we used the MCMC package emcee (Foreman-Mackey et al. 2013).We first sampled the probability space of  and  using equation 7. We used four walkers in total and multiprocessed the integration process for each star.To know if the space was sampled correctly, we required the sampling iteration over autocorrelation time to be at least 17 iterations.With a 64-core computing cluster, even with the most numerous open clusters, it takes around 2 hours to sample.For equation 8 we used the same convergence limits as for the previous equations.Like the distance probability distributions found in Bailer-Jones et al. ( 2021), we found that they do not follow a normal distribution; however, as the spread of the distances is so small, we still treated them as normal distributions and found our uncertainty in distance and our peak using a normal distribution fit.

Calculating photometric stellar parameters
In this section, we describe the theory and implementation behind calculating photometric  eff and log() and their errors for individual stars from an isochrone.In section 2.2.2, we explain how by determining the ranges of metallicity, ages, and extinctions of isochrones that will fit the HR diagrams of an open cluster; we can generate the joint  eff and log() probability distribution of an individual star.

Calculating 𝑇 eff and log(𝑔) from individual isochrones
Using the more precise and accurate absolute magnitudes, we now better fit isochrones to the open cluster HR diagrams.We have decided to fit the Padova CMD 3.7 isochrones by eye; this method has been shown to be highly effective for fitting in Kos et al. (2021Kos et al. ( , 2019)).We chose to do this rather than using Bayesian fitting programs like BASE-9 (von Hippel et al. (2006) and see also Jeffery et al. (2016)) as we could not provide accurate complementary data, such as a binary star indication or individual reddening values.Another problem is that the Padova isochrones still do not fit the HR-diagram in certain sections, such as the lower part of the main sequence, even when using Bayesian fitting programs (Brandner et al. 2023).Irrespective we are confident in the fitting and the probability distribution that comes with it.When fitting by eye, we use isochrones with a spacing of 0.01 dex for both log ages and metallicity.
Using an isochrone we can find the  eff and log() for an individual star by using: Where  is the initial mass of a star in the open cluster it is used as a variable to parameterise the shape of the isochrone.() is the density of stars per unit  that we should observe at that point in the isochrone and  is the normalisation constant. is the absolute  magnitude or the  −  colour, depending on the subscript.  is the uncertainty in absolute magnitude.() is included as the theoretical density of stars along the isochrone is not constant.We integrate along the isochrone.An analogous equation is used for log().Note that in the equation, we are combining   and   bands into  − unlike in Kos et al. (2019Kos et al. ( , 2021)), where they used the nearest point in all three photometric bands.We did this as our testing shows at the turn-off point, some stars' absolute magnitude's can be close to one of the   and   bands but not close to the   −   axis, therefore creating anomalous results when viewed on a colour-magnitude diagram.This line integral takes into account the photometric uncertainty and the number density of stars one should observe at that point in the isochrone.
After acquiring the  eff and log(), we can calculate the precision of the derived parameters from the magnitude uncertainties by modifying the equation above: The Padova isochrone is sampled at discrete intervals.To make sure that the sampling along the isochrone does not affect our measurement, we interpolated the provided isochrone.We measured the change in  eff or log() between the interpolated isochrone and non-interpolated one.If the change was below 1% of the precision, we consider the isochrone to be well sampled.If not, the interpolation process is repeated using the integrated isochrone as a starting isochrone.When interpolating we do it with respect to the initial starting mass of the star.For a cluster of 1000 stars, it takes, on average, 10 to 20 minutes to calculate the parameters and their associated precision on a 144-core computer cluster.When fitting the isochrone, we vary three main parameters: age, metallicity, and extinction.We start by finding the optimum values of parameters, and then we vary parameters one by one until around 85% of the stars that are in the area of high sensitivity to the change are encompassed (an example is shown in Fig. 1).These areas are normally around the turn-off point or the red giant clump.The bestfitted isochrone and the two extreme isochrones define an asymmetric normal distribution of parameters.We use an asymmetric normal distribution as the range of metallicities, ages, and extinctions can differ depending on whether you are increasing or decreasing the parameter.These ranges are wide enough to encompass the extended main sequence turn-off stars.By using the range of isochrones, we can sample the probability density (( eff , log(g))), as each isochrone will generate a particular  eff and log(g).Each of these samples will have its own precision associated with it, which will differ depending on the shape of the isochrone which depends on the metallicity, age, and extinction.Thus when calculating the probability of the star having a  eff =  1 and log(g) = g 1 from the probability density (( eff , log(g))) each sample will contribute a probability of (11) To find the overall probability we marginalise over  eff and log(g): We found that the uncertainty we got from each isochrone is much smaller than the spread of  eff and log(g) from varying ages, metallicities, and extinctions.As a result the normal distributions act like delta functions around  1 and  1 so we can approximate the equation as: where  is obtained using scipy's Gaussian KDE fitting function (Virtanen et al. 2020).To take into account the individual precisions obtained during fitting, we used them as weights during the Gaussian KDE fitting.Using equation 13, we have a fast way to sample the probability space of photometric stellar parameters.We decided to use 1000 isochrones to sample the space generated from the asymmetric normal distribution of ages, metallicity, and extinction.It took 2 hours for a 1000-star open cluster to be fully sampled on a 72 core computing cluster.

Spectroscopic fitting
We have chosen to use the GALAH survey as our source of spectroscopic data.GALAH is a spectroscopic survey employing the HERMES fibre-fed multi-object spectrograph, which is installed on the 3.9-meter Anglo-Australian Telescope (AAT).With the release of GALAH DR4, the survey has observed more than 900 000 objects and provided stellar parameters  eff , log(), [Fe/H],  mic ,  broad and radial velocity ( rad ), and abundances of 30 elements.The survey observes in 4 bands: 4718-4903 Å (blue band), 5649-5873 Å (green band), 6481-6739 Å (red band), and 7590-7890 Å (IR band).Each band has a nominal resolving power of  = 28 000.

Creating synthetic spectra
This subsection gives an overview of creating the spectra, from preparing the training data to training the neural network and evaluating the neural network's performance and quality.
To maximise the speed of synthesising spectra, we used the Payne algorithm (Ting et al. 2019).This algorithm relies on an artificial neural network to generate synthetic spectra.After it is trained, it can generate a high-resolution spectrum with an average error of ≲ 10 −3 in normalised flux (Ting et al. 2019).With PySME, we need around 4 minutes to synthesise all four HERMES bands, but using Payne, it only takes 0.01 s while preserving the accuracy needed for spectroscopic fitting.
We chose to use Payne and did not use the pre-made grids method used in Kos et al. (2021) as it would be computationally too intensive to compute a grid that spans the 36 labels (stellar parameters and elemental abundances) we would like to optimise.We chose not to use a generative model system as used in Rix et al. (2016); Ness et al. (2015) as it has been shown in Ting et al. (2019) that it cannot generate precise spectra (relative error of < 10 −3 ) of normalised flux when generating spectra over 25 labels (stellar parameters and elemental abundances).
By using a neural network, we can swiftly and precisely generate spectra to effectively address the issue of blended lines.While other methods involve restricting the analysis to specific segments of spectra with no line blending issues (e.g., Buder et al. 2021;Kos et al. 2021).The approach runs into some problems.First, we are not using all the available information in the observed spectra.Second, if that a specific point on the observed spectra is contaminated (for example, by cosmic rays).In that case the ability to fit that element will be lost, and lastly, a problem will be encountered if there is a strong line just out of our specific region.This line will affect the line inside the region, but it is not taken into account.Hence, for these reasons, we will be fitting the majority of the wavelength range and all the parameters at once.
We produced the training spectra using PySME (Wehrhahn et al. 2022) which is a Python package based on the SME (Spectroscopy Made Easy; Valenti & Piskunov (1996); Piskunov & Valenti (2017)).PySME is open source, free to use, and as powerful as the old SME package.
To make sure we account for as many non-local thermodynamic equilibrium (non-LTE) effects as practically possible, we used all the available non-LTE elemental model grids in the PySME large data server1 .The list of the models is shown in table 2.An explanation of the grids can be found in Amarsi et al. (2020).In short, these non-NLTE models contain grids of pre-calculated line-by-line intensity corrections that are used to correct the intensity of synthesised LTE lines.
Our line list is acquired from VALD (Ryabchikova et al. 2015) 2 and a full list of references of the line list used is available in Appendix B. To accurately generate synthetic spectra while cutting down on computing time, we wanted a complete but not superfluous line list.To reduce the number of superfluous lines, we requested a line list with an intensity of at least 0.005 in normalised flux (this value was chosen so the errors of the GALAH spectra are always significantly larger than that), and to make sure our line list is complete, we submitted this request using multiple stellar parameters that will cover the parameter space of the stars that we wish to analyse.We requested a line list using stellar parameters ( eff , log()): (4500 , 4.5), (4750 , 2.4), (6000 , 4.1), and (6000 , 4.1); for each stellar  eff , log() pair, we then requested them with three different metallicities (−1, 0, 1).Thus, we had 12 line lists in total that we joined to make our final line list.
We decided to train the Payne on four stellar parameters:  eff , log(),  mic ,  broad and 32 abundances ( Buder et al. (2021) and DR4, we have set macro-turbulence ( mac ) to 0 as the resolution of GALAH  broad and  mac are degenerate broadening influences.We created a training set that is representative of the parameter space of the stars that we will analyse.As we are fitting GALAH spectra, we chose to use GALAH DR4 to create the parameter space of our training set.By using the values and uncertainties measured in GALAH DR4 of the stars in our open clusters, we were able to generate the probability space of the training set.Our training set is more densely sampled in areas in which there are more stars, as we would like our model to be better trained at these points.When creating the training set, we selected maximum and minimum values for abundances and stellar parameters, as we are not expecting to fit any stars that have extreme abundances or stellar parameters.To make sure we have created a training set that will span the parameter space of stars that we want to observe, we overlay the Kiel diagrams of the fitted isochrone for the open cluster we want to analyse.The parameter space of our training set is shown in Fig. 2, with contours representing the density of the points made with a Gaussian kernel density estimator.
The number of training spectra used was 10 000 as recommended in Ting et al. (2019).We synthesised spectra with 0.004 Å steps, so we have a sample rate of at least 10 times finer than the GALAH spectra.We chose wavelength limits for each band to allow for at least ±200 km s −1 of stellar radial velocity.
The complexity of the neural networks depends on parameters called hyperparameters.One of the hyperparameters that we can change is the number of neurons per layer.If we have a number that is too large, we will overfit the model, or if we do not give enough neurons, the model cannot simulate the complexity of the training set.So, we have done hyperparameter tuning (i.e., trying to find the best value for a hyperparameter that will create a model that fits the validation data the best) on the number of neurons per layer and found that the default 300 neurons per layer is the optimum number.
Hyperparameter tuning of the number of layers was already done in Ting et al. (2019), and it was found that extra layers only led to overfitting of the spectra.
From our overall training data, 20% was used for our validation set and the rest for our training set.The actual training took around 20 thousand iterations to converge, which took around 2 hours per band to finish.The training was done on NVIDIA Tesla P100 GPU provided by the free online computing cluster Kaggle 3 .We found that the average difference in flux between our neural network model and our validation set is 0.0056 in the blue band, 0.0060 in the green band, 0.0069 in the red band, and 0.0046 in the IR band.This is in line with the expected values in Ting et al. (2019) of 0.007.
These high-resolution synthetic spectra then need to be degraded to the resolution of the observed spectra.The observed spectra have a nominal resolution of 28000.However, this varies with wavelength, fibres, and time of observation.To precisely degrade the spectra, we used the resolution profile for each observed spectrum in each band.This contains information on the resolution at each wavelength.The resolution profile is of a generalised Gaussian profile.By using photonic combs and the Thorium-Xenon arc lamp, Kos et al. (2017) was able to measure the resolution profile.A photonic comb can generate spectra that are predictably spaced out with a known Lorentzian profile.The time needed to degrade the resolution of the synthetic spectra to that of the observed spectra is similar to the time needed to synthesise the high resolution spectra with Payne.Some observed spectra do not have the resolution profile available or have an invalid resolution profile (e.g., they have values that are too large or have a negative value); thus, we used the resolution profile of the closest observation in time done on the same fibre as the spectrum in question.This incorrect resolution profile happens in around 8% of spectra.For more information on GALAH resolution profiles, see Buder et al. (2023, in preparation).

Fitting procedure
To combine both spectroscopic and photometric stellar parameters, we decided to use a Bayesian fitting scheme.Pinsonneault et al. (2004) have shown how photometric  eff and spectroscopic  eff derived without using a photometric prior might differ.However, in our case, we found that there were no overall strong trends in the difference between spectroscopic temperatures derived without using a 3 https://www.kaggle.com/photometric prior and photometric temperatures, so we decided not to shift the temperatures.The spread of the temperature differences is lower than in Kos et al. (2021) where the shifting of the temperature scale was necessary.
The likelihood used to fit stellar parameters and abundances to spectra is expressed as: where x is the vector of stellar parameters and abundances,  i is the flux of an observed spectrum at wavelength , and   is the observational error of the normalised flux at wavelength .
We have included two priors in the fitting.The first one is the photometric stellar parameters prior, derived from equation 12, and the other is a mask.The mask will prevent the program from fitting wavelength ranges that we do not want to fit as we know our models do not accurately model them, while ensuring we always fit wavelength ranges of strong non blended absorption lines.A full description of the mask is found in Appendix C1.
The fitting is done in four steps: The first step is an initial check of whether the GALAH reduction process produced an estimate for  eff and log().Estimates for  eff and log() are made for each band of each spectrum during the GALAH data reduction process unless the data quality is too poor.We do not use any band that does not have these initial estimates.Then, if there is no valid resolution profile, we acquire one.For the infrared band, we discard the first 25% of the wavelength range as it is prone to having extreme values in it, as the infrared is susceptible to be completely dominated by the telluric A band.
In the second step, we find the radial velocities of the individual bands.We synthesise stellar spectra using GALAH DR4 values as starting parameters, and if there are no abundances available in the GALAH DR4 catalogue, we use solar abundances.We vary the radial velocities of each band individually to find which radial velocity for each band has the highest likelihood value.These radial velocity values are kept for the rest of the analysis process.In this work, we found that the average difference in radial velocities between the bands is 0.89 km s −1 , this is the expected value as it is around the expected radial velocity uncertainty of GALAH DR4.
The third step is to do an initial fit of the spectra using GALAH DR4 as the starting value.After an initial test, we chose not to fit [Rb/Fe], [Sr/Fe], [Mo/Fe], [Ru/Fe], [La/Fe], and [Ce/Fe].The fitting is done by using Bayesian sampling from the MCMC package emcee.As we have 30 parameters, we run the sampler using the minimum recommended 60 walkers.
While the GALAH reduction process provides us with prenormalised spectra, we opt to normalise spectra using our synthetic spectra.We did this as our method to generate spectra differs from the reduction process, and the values used to generate the synthetic spectra to normalise the observed spectra are different.We normalise the spectra at the beginning of this step.The normalisation is done using the same methods described in the reduction process of GALAH (Kos et al. 2017).In short, we use a univariate spline function over the entire spectrum.
The fitting process ends when the burn-in has finished for  eff , log(),  mic ,  broad , and [Fe/H] plus an additional 50 iterations.To check whether the burn-in has finished, we fitted a 1D polynomial to each walker's samples (chain) for these five parameters.As the values of the parameters are vastly different, we normalised them using their mean value before fitting the polynomial.We checked every 40 iterations to see if the gradient was below 0.01, which corresponds to a 1% change every 100 iterations.If 90% of the chains have achieved this value, we consider the sampler to be burned in.This first process takes around 410 iterations to finish, which is around 6-7 minutes when using 18 cores.We then create an additional mask, as described in Appendix C1.
Using the three combined masks, we do the final fitting run.In this run, we re-normalise the spectra once at the beginning using the values acquired during the mask run.Our starting parameters for the main fit come from the last iteration of the mask fitting run.As we have just introduced a new mask, we let the sampler run until burn-in is achieved again.We detect when burn-in is achieved using the same method as in the previous step.
To check whether the sampler has converged, we use autocorrelation time.When using an MCMC sampler, each sample is not independent from one another; auto-correlation time is a measure of how independent the samples are from one another.To calculate the number of independent samples, we divide the total number of samples by the auto-correlation time.When the sampler has converged, it means it has successfully explored the underlying distribution and thus the samples are representative of the underlying distribution.By accurately calculating the number of independent samples, we have a quantitative measure of how well the sampler has sampled the underlying distribution.We use an auto-regression model to calculate our auto-correlation time.A full discussion of why is available in Appendix C2.We found that 400 independent samples were sufficient for calculating the mean value of the parameter and the uncertainties associated with it.Thus, the program will stop sampling once a mean average of 400 independent samples across the 30 parameters has been achieved.However, even with 100 independent samples, it was already sufficient to sample the mean value of the parameter (as the number of independent samples only contributes an extra 10% to the uncertainty; Goodman & Weare 2010a).
After the initial burn-in, we estimated the auto-correlation for the first time after 100 iterations and recalculated the auto-correlation time for every 80 independent samples.We did not recalculate the auto-correlation time after each iteration, as it was computationally expensive.This process continued until an average of 400 independent samples was obtained.After completing the sampling, we calculated the number of independent samples for each parameter, which served as a quality metric.The sampling process averaged 15 000 iterations and took approximately 4 hours to compute using 18 cores.We had set a maximum iteration limit of 40 000.If the maximum iteration is reached, we assume that the fitting method will not converge, so we will stop sampling.After the fitting process is finished a mean value and precision are calculated for each fitted parameter.

RESULTS
The results section is divided into three parts.The first section, 3.1, discusses how well the distance measurements are using a cluster centre distance prior.The next section 3.2 discusses the photometric stellar parameters and the fits of the isochrone.The last section discusses the effect of using photometric stellar parameters as priors on the spectroscopic stellar parameters and abundances of stars in open clusters.

Distance improvements
We compared our cluster distance centres and sizes obtained by using equation 7 to geometric and photo-geometric distances obtained in Bailer-Jones et al. (2021).We calculated the cluster distance centres and sizes from the distances in Bailer-Jones et al. ( 2021) by fitting a normal distribution to the geometric and photo-geometric distances of the open cluster members.The results are shown in Table 3.We found that faint stars' photo-geometric and geometric distances differ by a significant amount, with some stars having up to ∼ 7 000 pc in difference.An example of this difference is shown in Fig. 3. Thus, we have excluded stars that have more than a 100 pc difference between their photo-geometric and geometric distances when calculating the distance and size of the open cluster.
We observed that the geometric and the photo-geometric distances to the cluster centre were within one cluster size for all open clusters except for ASCC 16.We find that our distances to the cluster centre Distance/ pc = 183.86+0.13 −0.14 1 8 3 . 6 1 8 3 . 8 1 8 4 . 0 1 8 4  We found that the cluster sizes calculated directly from geometric and photo-geometric distances are larger compared to the cluster sizes calculated using equation 7.For Trumpler 10, M67, and NGC 2516 we find that our cluster sizes are significantly smaller, we think this is caused by our prior on cluster size (i.e., equation 5).
We Further compared our cluster centre distances and sizes obtained by using equation 7 to two different catalogues Bossini et al. (2019) and Hunt & Reffert (2023); called BO19 and HR23 hereafter.We have chosen these two catalogues because BO19 uses an automated isochrone fitter to get distances; hence, it is relevant to see how different our distance results and isochrone parameters are.We chose HR23 as it uses a clustering algorithm on Gaia DR3 data to find distances; hence, we should find similar results as we have the same data.The tabulated distance results with these two catalogues are shown in table 4. We found that the majority of our calculated cluster centres are within 3 pc of BO19 and HR23 values.In BO19, M67 and Trumpler 10 were outliers; this could be caused by the difference in priors, methods, and the raw data used (as we used Gaia DR3 rather than Gaia DR2, which BO19 used, which has 20% smaller uncertainties than Gaia DR2 (Lindegren et al. 2021)).M67 is also the furthest cluster we studied in this paper at 839 pc.Our values correspond more with HR23, as we both use the same data from Gaia DR3.The cluster with the largest difference was ASCC 16.
We decided not to study a specific group in the Upper Scorpius region but to study it as a whole.Our Upper Scorpius distances are within the distances of the groups inside the Upper Scorpius region.The distances of the groups inside the Upper Scorpius regions range from 142 pc to 159 pc in Ratzenböck et al. (2022) or ranges from 126 pc to 153 pc in Miret- Roig et al. (2022).Our distance of 146 pc lies within both of these ranges.
Our radial cluster sizes are as expected, with all but one of the clusters being around 10 pc.M67 does have a much larger cluster size; this could be caused by the pencil effect that happens when the distance to the cluster centre increases.The increase in distance increases the uncertainty in the parallax.Comparing our radial cluster sizes with the HR23 size values, we found that the sizes of our clusters are within the bounds of the core radius and the tidal radius for all but M67.
One of the reasons that our distances and cluster sizes could differ  is the different membership of the open clusters.We have compared our membership with the membership in HR23 in table 5. We expect HR23 to have a higher membership count than us, as their membership includes stars in the tidal tail, whereas ours focuses on stars in the open cluster core.The possible field stars are the stars in our study but not found in HR23.The amount of possible field stars does not exceed more than 4 % of the total member stars in our study in all open clusters except for ASCC 16 and Trumpler 10.In ASCC 16, the possible field stars lie on the best-fitting isochrone; thus, we think these possible field stars are open cluster members.However, in Trumpler 10, these possible field stars do not lie on the best-fitting isochrone; thus, we think our membership criteria for Trumpler 10 are not strict enough.Even though 39 % of stars in Trumpler 10 are possible field stars, we found that our distance to the cluster core is within 3 pc compared to the distance in HR23.Thus, we do not think that the field stars have impacted the distance in a significant way.
We also confirmed that none of these possible field stars in ASCC 16 and Trumpler 10 are members of any other cluster studied in HR23.
Overall, we found that we estimated our cluster core distances and sizes well for our purpose of calculating absolute magnitudes.Even though some of our cluster core distances and sizes are not within the ranges in BO19 and HR23, the resulting distance distribution of the stars in the open clusters will be similar to our values.Furthermore  shown in blue and after using the cluster prior (i.e., equation 8) shown in yellow.The red line indicates the centre of the cluster according to the cluster distance prior and the yellow lines are the radial size of the cluster according to the cluster distance prior the difference between our cluster core distances and the catalogues are within one cluster size.
The corner plots of the probability distribution of the cluster distance priors (e.g., Fig. 4) are as expected, with the probability centred around one point.If there was a lot of contamination with other field stars or other clusters, we could have found multiple peaks in the PDF.
After the introduction of the cluster distance prior, the stars are normally distributed within the calculated size of the cluster; this is shown in Fig. 5.The new distribution of stars is in line with our expected results when using the cluster distance and shows how our cluster distance prior is working as intended.
By using the distance cluster prior we saw an average increase in the precision of the individual star distance of 31% compared to the distances calculated without using the distance cluster prior.i.e., the geometric distances calculated in Bailer-Jones et al. (2021).We calculated the geometric distance precision of individual stars by using: Where r_hi_geo and r_lo_geo are the 84th and 16th percentiles of the distance posterior calculated using the geometric prior.
The stars in Upper Scorpius were the only ones that did not see an average increase in precision.We think that this is caused by the size of the region estimated by the cluster distance prior (8.7 pc), which simulates well the original size of the region, thus leading to the prior having a negligible effect on this cluster.The radial cluster size was expected, as Upper Scorpius is a large region with multiple groups in it, and we did not choose a specific group to study.In Miret-Roig et al. ( 2022) they estimates the groups having sizes of ∼ 1 pc to ∼ 10 pc.Our estimation of 8.7 pc is within the ranges of these groups.
Our method of using a cluster distance prior to fit individual distances has increased the accuracy of the individual distances as the distances now lie inside the expected size of an open cluster core.The method has increased the precision of the individual distance measurement.With both improvements to the distance measurements, it will improve our absolute magnitudes, thus improving the photometric  eff and log() measurements.

Isochrone fitting and photometric stellar parameters
Using the method explained in Sec.2.2.1, we fitted isochrones to the HR diagrams and selected appropriate ranges for the ages, metallicities, and extinctions for each cluster.The ranges are in the expected bounds for an open cluster.The ages are younger than 10 10 years, and the metallicities are around solar metallicity.The ranges selected are shown in table 6.The HR diagrams fitted best fitting isochrone are shown in Appendix D.
We did extensive checks of the validity of the ranges of ages, metallicities, and extinctions for each cluster, as demonstrated in Appendix E. We also verified the method of calculating photometric  eff and log() (i.e., equation 9) in Appendix F.
We constructed a joint PDF for  eff and log() for each star in the cluster.An example for M67 is shown in Fig. 6.We found that for stars that are in the lower half of the main sequence, the PDFs were uncorrelated in  eff vs. log().This is as expected because when we plot a Kiel diagram, the gradient of  eff and log() with respect to the starting masses of the stars at that point along the isochrone is small, so when we change the isochrone parameters, the change in  eff and log() will be quite small.Another factor is that the isochrone changes shape in a symmetrical way when increasing or decreasing a parameter in the isochrone.Further along the isochrone, the correlation of  eff and log() becomes stronger.Stars at the turnoff point have a very unsymmetrical PDF shape, which is because of the complex shape of the isochrone at the turn-off point.Therefore, when we change the parameters of the isochrones, the newest closest point to the star can have a very different  eff and log().In the lower red giant branch, the trends become very strong as shifts in the isochrone parameters cause large changes in the shape of the isochrone, thus causing a large change in  eff and log().
The average photometric precision of  eff and log() is 38.2K and 0.031 dex.This precision is calculated from PDF in equation 13.The average precision measured when using an individual isochrone (i.e., equation 10) is 3.15 K and 0.0016 dex.As the final photometric precision is much worse than the precision measured using an individual isochrone, it shows that the ranges of metallicities, ages, and extinctions are a much larger source of imprecision than the absolute magnitudes.
Spectroscopic uncertainty in GALAH is 70 K in  eff and 0.064 dex in log().The size of GALAH uncertainty is comparable to the size of the joint  eff and log() probability distribution.This comparable size is an indication that the shape of the photometric prior will have an impact on our spectroscopic fit.

Abundances
Table 7 shows the overall number of stars that were fitted for each cluster and how many stars were successfully fitted.To see whether the star is successfully fitted, we used some basic cuts.The cuts we used are  mic > 0 km s −1 , 15 km s −1 >  broad > 0 km s −1 , 5 dex > log() > 2 dex.We chose these values for the quality cuts as the stars outside of these ranges have unreliable abundances, thus contributing erroneous scatter to our data.As we are looking at the trends of abundances, we decided to only use stars that was fitted with more than 100 independent samples on average, as we found it to be a sufficient number to compare abundance trends.In ASCC 16 and Upper Scorpius, our fitting software struggled to fit spectra successfully.This is because these two clusters are our two youngest clusters at 10 7.10 and 10 6.90 years, respectively; thus, the stars will be more likely to have a higher rotation (Nielsen et al. 2013;Godoy-Rivera et al. 2021), as a result not pass our  broad of our quality cuts.The other reason is that the SNRs for those clusters are among the lowest, at 47.0 and 35.5, respectively.SNR is defined as the average ratio of the uncertainty over normalised flux in the spectra.
In Fig. 7, we can see an example of the effect of using a joint  eff and log() prior when fitting spectra.The probability distributions Table 7.An overview of the number of stars successfully fitted by the cluster fitting process. GALAH is the total number of spectra we fitted from the DR4 GALAH catalogue. 100np> and  400np> are the number of stars with more than 100 and 400 independent samples on average for each fitted parameter without using the prior. 100p> and  400p> are the number of stars with more than 100 and 400 independent samples on average for each fitted parameter using the prior.are displayed using a Gaussian KDE, of a star that fitted with more than an average of 400 individual samples for each parameter.We can clearly see that the photometric prior affects the value of  eff and log().As the fit using the prior has a different  eff and log() to the fit without using the prior, we can see that the photometric prior has affected the probably distribution of [Fe/H], [O/Fe], and [Si/Fe].We chose these three abundances as they show dependence on  eff and log() most clearly.Fig. 7 also demonstrates that the  eff and log() prior cannot be approximated by a multivariate normal distribution.M67 and Ruprecht 147 fitted abundances and stellar parameters can be seen in Fig. 9 and Fig. 10, the other clusters can be seen in Appendix G.In the figures comparing stellar parameters and abundances fitted with and without the photometric prior, we only show stars that have passed the quality cuts of both types of fitting.We see a large effect on the accuracy of log(), as seen in Fig. 9.This is especially true in areas that are not most sensitive to isochrone changes (i.e., not at the turn-off point).This increase in accuracy causes a new population of stars located at 4.20 − 4.55 dex to appear, as shown in Fig. 11.The log() change in M67 is mostly below a log() of 0.1, with a small population of stars that has a change in log() above 0.1 dex.This shift in log() will be the source of the different abundance trends in the abundances fitted using the photometric prior and without.Thus, we do not expect a change in abundance in stars between 3.5 < log() < 4.20 as the majority of the stars have the same log() when fitted with or without the photometric prior.The effect of the photometric prior on the fitting regime will be most apparent in the 4.20 < log() < 4.55 range as there lies the shifted population.From the Kiel diagrams, we found that our fitting regime struggled to fit stars with  eff <4 500 K and a log() >4.20 dex.Our model tended to vastly underestimate the log() of those stars.This underestimation is also shown in Fig. 8.The figure shows the difference between photometric log() and  eff to spectroscopic log() and  eff calculated with and without the prior, in all open clusters.We see that when calculating spectroscopic log() without using the photometric prior, we underestimate log() of stars with a log() >4.20 dex.We found that for stars that have a photometric temperature of lower than 5 800 K, the photometric prior had a more substantial effect on spectroscopic  eff compared to stars with a photometric temperature of more than 5 800 K.

Cluster
The average spectroscopic values of [Fe/H] did not change significantly when comparing stars fitted with or without the photomet-Table 8. Precision values of spectroscopic abundances and stellar parameters calculated using different methods and a comparison with GALAH DR4.The MCMC columns show the average uncertainty acquired from MCMC fit when fitting using the photometric prior, and no photometric prior.The overall scatter shows the mean scatter of the parameters when fitted using the prior in each cluster weighted with the number of stars.M67 scatter is the spread of the parameters in M67 with 4.0 < log() < 4.1.Precision GALAH is the precision given in GALAH DR3.Accuracy GALAH is the estimated accuracy of the parameters in GALAH DR4.Uncertainty GALAH is the total uncertainty estimation in GALAH DR4 acquired by adding in quadrature the precision and the accuracy.In clusters with stars with a small range of log(), the effect of the photometric prior is large enough that there is no overlap in log() within the population fitted with and without the photometric prior, thus making it hard to compare trends in those clusters.Consequently, we have concentrated our analysis mostly on M67 and Ruprecht 147, which have a wide range of stars in log() and so a large overlap.

Parameter
Within each open cluster, our abundances fitted with or without the photometric prior do not have a linear trend with respect to  eff or log().We attribute this to using non-LTE models to create the training set data and fitting the majority of the wavelength range.We found that we fit most abundances within the ranges set out in the training set of our neural model.[Eu/Fe] and [Zr/Fe] were the elements that were most likely to fit with a value that was outside of our training set.The [Fe/H] of M67 and Ruprecht 147 decreases as log() decreases, which we attribute to systematic errors in our model.The higher-order abundance trends in M67 and Ruprecht 147, we attribute to atomic diffusion.This is because the higherorder trends present themselves as dips around the turn-off point, which is at a log() of ∼ 4 for M67 and Ruprecht 147 (Liu et al. 2019;Gao et al. 2018).These dips are present in studies that have modelled atomic diffusion in M67 (Liu et al. 2019;Gao et al. 2018).In M67 there is an increased range in log() in the data fitted using the photometric prior compared to the data fitted without the photometric prior.The increased range in log() enables the observation of how the trends in abundances at a log() larger than 4.2 dex.In most of the abundances, the trends above a log() of 4.2 dex in the fit using the photometric prior are just a continuation of the trends in the fit without using the photometric prior.However, in [Si/Fe] and [Nd/Fe], the trend differs.Furthermore the stars that were analysed without using the photometric prior and were shifted to higher than 4.2 dex in the analysis using the photometric prior, will add scatter to the abundances.As a result, it becomes more challenging to discern higher-order trends in the analysis without the photometric prior.
In Ruprecht 147, the effect of the photometric prior on the spread of log() is also observable.Stars with 4.0 < log() show that the fit without the photometric prior underestimates log().The ranges of log() of the stars fitted using the prior and without are similar in Ruprecht 147.This stands in contrast to M67 which has a population of stars with a log() of 4.5 in the analysis using the photometric prior which is not present in the analysis without the photometric prior, as illustrated in The abundances calculated using the photometric prior in the M67 and Ruprecht 147 open clusters were both more accurate than the abundances calculated without using the photometric prior.In M67, the increase in accuracy was caused by the population's log() of 4.2 − 4.55 dex, which only occurs when fitting using the photometric prior; however, other than the stars that get shifted to this population, the rest of the population's log() did not change significantly.The new population causes the effects of atomic diffusion to be more visible, as we could see the effect of atomic diffusion on stars with a log()> 4.2.Unlike in M67 in Ruprecht 147, most of the stellar population shifted its log() when fitted using the photometric prior and without.This caused larger differences in the abundance trends.We could see evidence of atomic diffusion more clearly using the The bottom is a scatter plot of photometric  eff vs spectroscopic  eff minus photometric  eff .For both panels the spectroscopic log() in the blue points are calculated using the photometric prior and the red points without.For both panels we used all the stars from all open clusters that passed the quality cuts.The solid lines are the median of a bin containing 5% of the stars in the cluster.The coloured area shows ± 1  photometric prior compared to without.These two clusters show that using photometric priors causes better log() compared to the analysis without using the photometric priors, thus enabling us to see atomic diffusion.
A comparison of our stellar parameters and abundances fitted using the photometric prior (blue) and GALAH DR4 (pink) in M67 and Ruprecht 147 can be seen in Fig. 12 and Fig. 13, and for the other clusters they can be seen in Appendix G.Both data set uses the same quality cuts, but with the GALAH DR4 data has an additional quality cut of flag_sp == 0. The medians and standard deviations of the stellar parameter and abundances in Fig. 12 and Fig. 13 differs to Fig. 9 and Fig. 10 slightly.This is because the Fig. 9 and Fig. 10 the data has to pass the quality cuts for both the data analysed with and without the photometric prior, but in Fig. 12 and Fig. 13 it only has to pass the quality cuts of the data analysed with the photometric prior.
Comparing our results to GALAH DR4, we found that GALAH DR4  eff and log() followed the Kiel diagram of the best fitting isochrone used in getting the photometric prior better than our work.This could be caused by how in GALAH DR4, a different neural network is used to calculate stellar parameters and abundances depending on its  eff , log(), and [Fe/H].i.e., a different neural network is used to analyse Sun-like stars, red clump stars, etc.Unlike in this work, where we used a single neural network per band for all the stars analysed.The difference between our log() and GALAH DR4 log() could be due to GALAH DR4 using astrometry from Gaia and photometry from 2MASS to calculate log(), which is different from this work.A 0.1 dex decrease in [Fe/H] was found in most clusters.The absolute average values of [Mn/Fe], [K/Fe], and [Ni/Fe] are significantly different.For Ni, Mn, and K, this can be explained by this work not using a non-LTE model for these specific elements when generating spectra for training our neural network.We also found significant differences in the trends of Carbon and Nitrogen; this is explained by the differences in the methods of measuring Carbon.GALAH DR4 uses molecular features such as the C 2 and CN molecules, and this work uses weak Carbon and Nitrogen lines.Thus leading to the better abundances in GALAH DR4 for those two elements.This work's lithium spread is also much higher than GALAH DR4.When comparing the abundances of stars in M67 with log() above 4.

SPECTROSCOPIC PRECISION
MCMC provides an opportunity to more meticulously sample the probability space while fitting, as it gives the exact shape of the PDF compared to methods such as using the covariance matrix.Thus, we have explored how well MCMC estimates precision.In this work we only measure the precision, defined as the statistical variability of a measurement.We do not measure accuracy, which is defined as how close a measurement is to the true value.
We first investigated the role that the SNR of spectra has on the precision and the scatter of the fitted spectroscopic parameter.We investigated this by picking 10 spectra with an SNR of higher than 100 with 6100  >  eff > 5000  and 3.9 dex > log() > 2.9 dex.We added Gaussian noise to the spectra to create spectra with an SNR ranging from 10 to 90 in steps of 10.We fitted them without using the photometric prior.To investigate the effect of SNR on the average precision, we took the average precision of [Ti/Fe] in bins of 10 in SNR, as shown in the top panel in Fig. 14.In these spectra the deepest blended Titanium lines are ∼ 0.25 and ∼ 0.15 in normalised flux for non-blended lines.When the SNR is above ∼ 30, there is a minimal decrease in uncertainty with the increase in SNR.To examine the change in scatter, we first calculated the mean [Ti/Fe] for each star.Subsequently, we measure the absolute difference between the mean [Ti/Fe] and the corresponding fitted [Ti/Fe] value at different SNRs.Lastly, we calculate the average change in [Ti/Fe] values within bins of 10 SNR units.The average change is shown in the bottom panel in Fig. 14.At all SNRs, the average change is smaller than the average uncertainty.Under an SNR of 30, there is a significant increase in uncertainty compared to the higher SNR spectra.The effect of SNR on the other fitted parameters is similar to [Ti/Fe] except for the abundances of elements with the weakest lines.
Table 8 shows the effect of the prior on the precision of individual abundances.These precisions are the average precision of the spectra that fitted with more than 400 individual samples.We do not see worse precision of the abundances fitted using the photometric prior compared to abundances fitted without using the photometric prior.This is because even though the photometric prior's spread is much larger than the value of the precision in the spectroscopic fit without using the photometric prior, their most probable values differ from each other.Therefore, the overlap of the probability space is smaller.This is shown in the precision of log().The difference between the photometric log() and the log() obtained using spectroscopy without using the photometric prior is large.Hence, we see a decrease in the uncertainty in log() when fitting using spectroscopy without the photometric prior.As the precision in  eff and log() do not change significantly, we do not observe a significant change in the precision of the abundances when fitting with the photometric prior compared to without using the photometric prior for the rest of the parameters.
To validate our spectroscopic precision calculated using MCMC, we have estimated precision in two additional ways.The first is to use the scatter of abundances as a measure of precision.To take into account the trends caused by effects such as atomic diffusion, we have selected stars within a narrow range of log() where their abundances should not change significantly.We selected the range between 4.0 < log() < 4.1, as the abundances should theoretically change by less than 0.005 dex (Liu et al. 2019).Thus, by calculating the scatter of abundances in that section, we can compare the precision from MCMC and the scatter.We decided to only use M67 as the abundance trends calculated in Liu et al. (2019) are specifically made for the ages and metallicity of M67, and as we are only using a small range of log(), all the other open clusters do not have enough fitted members in this range.To reduce the scatter introduced by the range of SNR, we have only used stars with an SNR of 35 − 45, decreasing the role the SNR will have on the scatter of abundances.Using those cuts we have 88 stars to calculate the spread.The spread of abundances is shown in Table 8.We found that the median abundance precision estimated by MCMC is underestimated by 30% compared to precision measured from the scatter in M67.Thus MCMC is more optimistic in precision compared to the precision calculated using M67 scatter.
The second method to evaluate our abundance precision uses the scatter in abundances derived from repeat observations of stars.We selected repeat observations where their SNR only changes by 10% between the observations.We found that the median precision estimated by MCMC is underestimated by 9% compared to the precision estimated by the repeated measurements.However, if we only compare abundances, the precision is only underestimated by 1%.
To compare precisions we are using the median value rather than the mean as there is an outlier with the estimate of the precision of [Li/Fe].We found that these two results show that the abundance precision calculated using MCMC is accurate, as their value is comparable to the repeat observation.The precision calculated by MCMC for  eff , [Fe/H] and  mic is underestimated.Thus MCMC is more optimistic in the precision of these parameters compared to the precision calculated in the repeat observations.
In GALAH DR4, we calculated the total uncertainty of all fitted parameters by adding in quadrature, its precision, and its accuracy.Note that accuracy is only available for  eff , log(),  mic , [Fe/H], and  broad .In this work, we only measure precision, so we will not compare accuracy.GALAH measures the precision of the fitted parameters in two main ways.The first is by using repeat observations and seeing how the fitted values differ in this observation.The second method is by using the precision derived from the covariance matrix calculated by SME while fitting.Whichever of the two methods produces the biggest value becomes precision.The average precision, accuracy, and total uncertainty for the stars used in this work and GALAH DR4 are shown in table 8.We find that GALAH DR4 precision is 25% worse compared to the precision calculated by MCMC, 20% better compared to our precision calculated using repeat observations, and 17% better compared to the precision calculated by scatter in M67.
MCMC provides a more meticulous way to measure precision as it gives the exact shape of the probability distribution compared to using a covariance matrix like in GALAH.We find that GALAH estimates its precision well in abundances and other stellar parameters by combining both the precision acquired using repeat observations and its fitting procedure.GALAH has a good estimate of both abundance and the stellar parameters' precision.

DISCUSSION
Calculating accurate and precise photometric  eff and log() was one of the key reasons we were able to measure accurate abundances for open cluster stars.One of the ways we increased the accuracy and precision of the photometric  eff and log() measurements was to use a cluster distance prior.This method will only be valid when determining distances for stars that are inside the open cluster core.However, with the increased accuracy and precision of astrometry provided by Gaia DR3, Hunt & Reffert (2023); Meingast et al. (2021); Tarricq et al. (2022) have shown the possibility of determining members that are in the tidal tail of the open cluster.With these members, our method of determining distance might not be applicable as the members can be many pc away from the cluster centre.
Our method of using the cluster distance prior relies on having an accurate membership of each open cluster.Upper Scorpius and Orion (which contains the open cluster ASCC 16) contain multiple groups of open clusters with a very complex spatial structure.In Upper Scorpius, we did not pick a specific group inside; thus, the cluster distance prior did not succeed in decreasing the uncertainty of the stars in that cluster.In these complex regions, we note the importance of having radial velocities to be able to calculate accurate memberships to the open clusters (Kos et al. 2019;Miret-Roig et al. 2022).
The complex relationship between  eff and log() in the photometric prior shown in this work is the result of how varying ages, metallicities, and extinction affect the shape of the isochrone.Fu et al. (2018) has shown that the −element abundance can have a significant effect on the shape of the isochrone.Further studies should also be done into how changing the -element abundances in stellar models will affect the shape of the isochrone, thus affecting the shape of the joint  eff and log() probability distribution.
We have chosen our stars to be far from the galactic plane reducing the effect of the reddening.We have also assumed that the extinction is the same for all stars in the open cluster.However, if we would like to more accurately fit isochrone to the HR diagram of these stars, especially those that are closer to the galactic plane.In that case, we should take into account the effects of differential extinction.
The accuracy of generating synthetic spectra is greatly affected by the line list from which the synthetic spectra are generated from.As discussed in Jofré et al. (2019), many transition data (log(  ) values) are not known accurately, and the line list available is incomplete with transitions missing.It is crucial to have an accurate and complete line list since we are fitting the majority of the wavelength range, rather than just the areas with the strongest non-blended lines.We also do not quantify the uncertainty that is associated with inaccurate atomic characteristics, such as the wavelength, transition probabilities, and properties of the atomic states responsible for these atomic transitions.
To increase the accuracy of generating synthetic spectra, we would also need to increase the accuracy of stellar models.Effects such as magnetic fields and stellar spots are not taken into account in this work.Depending on the spectral type, magnetic fields, and stellar spots can affect the equivalent width and depth of the absorption lines.The strength of magnetic fields and stellar spots varies during the activity cycle.Thus, measurements of  eff , [Fe/H],  mic , and chemical abundances will vary through the activity cycle (Spina et al. 2020).When not taken into account, the magnetic fields and stellar spots can increase the scatter of the measured abundances.
Another effect that we did not take into account is the effect of diffuse interstellar bands (DIBs).These bands can affect the observed spectra at visible and near-infrared wavelengths.These effects although small (∼ 0.5 per cent of normalised flux (Vogrinčič et al. 2023)) are still measurable in high precision spectroscopy.Further studies should use catalogues such as Vogrinčič et al. (2023) to correctly model DIBs when generating synthetic spectra.
These inaccuracies when generating synthetic spectra could be one of the reasons why we overestimated the precision of  eff , log(),  broad , and  mic using MCMC compared to the repeat precision measurements.With further improvements to the accuracy of generating synthetic spectra, we can reduce the need to mask certain wavelengths of the spectra, allowing us to use more of the wavelength range.
With the continued use of Bayesian statistics in fitting spectra, as demonstrated in Buder et al. (2021); Gent et al. (2022), works like this show that MCMC provides an accurate way to measure the probability space of the fitted spectra.However, MCMC is very computationally heavy, making it impractical to use in large surveys compared to our work.In GALAH DR4, an average spectrum takes 2 minutes to fit, compared to our 4 hours.In our work, the two functions that consume the most time are scipy's fast Fourier transform, which is used when equalising the resolution of the synthetic spectra with the observed spectra.The second function is Numpy's einsum, which is used to multiply vectors and matrices to generate the synthetic spectra.These two functions are well optimised, so the way to increase the sampling speed must come from somewhere else.Hamiltonian Monte Carlo (HMC) is a more efficient sampling method compared to MCMC.This is because HMC uses the probability gradient at each point to calculate its next step.This causes the auto-correlation time to be much shorter, so fewer samples are needed to acquire one independent sample.This has not been used in fitting spectra, as the method to generate spectra has traditionally not been able to be analytically differentiated.However, with the use of neural networks to generate spectra, we can analytically differentiate the spectra with respect to its training variables, thus getting the gradient of the probability space while fitting analytically.In further studies, this fact should be used to increase the efficiency of the fitting procedure.Liu et al. (2019); Dotter (2016) and our work have further shown that the idea of chemically tagging stars with a wide range of log() and  eff will only be possible with a greater understanding of how abundances in stars change as they age.This is because effects such as atomic diffusion are large enough that without taking them into account, it will be impossible to accurately group stars that come from the same star forming region.The effects of atomic diffusion on abundances depend on many variables, such as the age of the star, which element is being studied, the metallicity of the star, and the current evolutionary stage of the star.This complex relationship means that modelling the effect of atomic diffusion is a non-trivial thing to do for a large range of stars.Our work shows the necessity of having spectroscopic observations of stars in different evolutionary stages in each open cluster to be able to see the effect.
The effects of atomic diffusion are clear when looking at the higherorder trends of abundances with respect to log().This further highlights the importance of getting an accurate log(); without the photometric prior, our log() would not have been accurate enough for us to see the effects of atomic diffusion.A better understanding of atomic diffusion will also allow us to measure the precision of abundances in open clusters, as we will be able to measure the scatter of abundances compared to the theoretical abundance trend lines.

CONCLUSIONS
In this paper, we examined the effects of using a joint  eff and log() photometric prior on spectroscopic  eff , log(),  mic ,  broad , and 26 elemental abundances of stars in open clusters.We used photometry and astrometry from the Gaia DR3 catalogue.We selected members in the core of the open cluster, which were selected by simple cuts in position and proper motion space.To generate more accurate and precise photometric priors, we first reduced the uncertainty of the absolute magnitude of the stars by reducing the uncertainty in their distance measurement.We achieved this by assuming that the stars are normally distributed around the cluster centre.We computed the joint probability distribution of the location of the centre of each cluster and the size of each cluster.Using this prior, we recalculated the distances of the stars, achieving a reduction in uncertainties by a factor of 31% compared to geometric distances in Gaia DR3.The reduction of the uncertainties is important as it allows us to fit isochrones more precisely to the HR diagrams of the open clusters and consequently it allows us to calculate more precise  eff and log() from each isochrone.
To create a joint  eff and log() photometric prior, we first fitted isochrones to HR diagrams of the open clusters to see which ranges of ages, metallicities, and extinctions would encompass the majority of stars in the regions sensitive to the change in the isochrone parameters in the HR diagram.By using the absolute magnitude of individual stars, we calculated  eff and log() and their precision for that star from an isochrone.By calculating the ranges of ages, metallicities, and extinctions for each open cluster, we were able to sample the joint  eff and log() probability spaces.There was a complex relationship between  eff and log() that differed depending on where the star was located on the HR diagram.We concluded that the shape of the  eff and log() joint probability distribution was primarily due to the size of the ranges of ages, metallicities, and extinctions rather than the contribution of the precision of  eff and log() from individual isochrones (i.e., equation 10).
We used a single neural network generated using Payne for each spectral band and trained the neural network on spectra that are representative of the population of stars in the open clusters.We fitted GALAH spectra of 1979 stars across nine open clusters with and without using the joint photometric prior.We found that using photometric prior led to a more accurate and precise log().This allowed us to see higher-order trends like the signature of atomic diffusion in the abundances analysed using the photometric prior.We validated the uncertainty generated by MCMC using a variety of methods.We compared the precision to the spread of abundances in M67 in a small range of log().We also compared our preci-sion to the precision calculated using repeated measurements.We found that the estimate of the precision of abundances is well estimated by MCMC, but tends to inflate the precision values of  eff , log(),  mic , and  broad .We investigated the precision of GALAH values calculated for DR4 by comparing it to our measures of precision.GALAH's method of picking the largest precision between the precision calculated using repeat observations and the precision calculated from its fitting procedure provides a reliable value for precision.

C1 Masking
The mask is composed of three different components.The first one masks out the areas of the spectra that we would never like to fit; this includes, for example, areas around the Hydrogen Balmer lines H and H lines.We mask these lines because our stellar atmosphere models do not accurately model them.This mask is a modified version of the same mask used in GALAH DR4.As we are using different neural networks compared to GALAH DR4 to synthesise spectra, We added extra wavelengths to mask by comparing our synthetic spectra to some high signal to noise ratio (SNR) GALAH spectra and concluded that areas with large differences in normalised flux will be areas that we cannot synthesise accurately.This can be caused by missing or bad line data (e.g., bad atomic transition values) or our atmosphere model failing to calculate accurately how the spectra will behave.The second mask bounds the area that we will always want to include in the fit, i.e., areas around important lines.These will be areas where there are strong absorption lines that are not blended, or they will be the only area to detect certain absorption lines of a specific element.The last mask is created after the first round of Bayesian fitting (the rounds of fitting are explained in the next paragraph).Using the best-fitting spectra from the first round, we take the difference between them and the observed spectra.Wherever the difference in normalised flux is above 0.3 and 5 times the difference in flux over uncertainty, we do not think that that point in the spectrum will ever converge, so we mask it out.The cut off points are set high to allow areas with strong lines to converge.If the normalised flux is above 1.05, we also mask it out, regardless of the previous criterion.This can occur, for example, if there are problems in the reduction of spectra where strong telluric emission lines or cosmic rays are not filtered out in their entirety.

C2 Auto-correlation
Emcee uses the method outlined in Goodman & Weare (2010b) to calculate auto-correlation time.However when auto-correlation is calculated using short chains (chains below 50 times the auto-correlation length), the method used in emcee will underestimate the auto-correlation time.As we are using 60 walkers, the 400 independent samples are obtained long before an individual chain reaches more than 50 auto-correlation time (if it is above 50 by definition, we will have at least 3000 samples, which is far too much for our needs).By fitting an auto-regression model to our chain, we can get a more accurate auto-correlation time with much shorter chains.We can see that the auto-correlation time calculated using emcee converges when the iterations are around 50 times the auto-correlation time.The auto-regression model gives a far better estimate of the auto-correlation time using a shorter chain.Therefore, we chose to use the auto-regression model to estimate our auto-correlation time.The difference between the converged auto-correlation time estimated by emcee and the auto-regression was typically small enough for our purposes.

APPENDIX G: ABUDANCES COMPARISON
Given the limited number of observed member stars in these clusters, we plotted all points in both the data set reduced using photometric priors and without that passed their own individual quality cuts.

Figure 2 .
Figure 2. The parameter space of the 10 000 spectra used for the training set.Each black dot represents a value used to generate a training spectrum.The bottom 26 panels are a scatter plot of [Fe/H] against [x/Fe], with the element indicated in the top right of the panels.

Figure 4 .
Figure 4. Corner plot of the probability distribution of the cluster distance prior calculated for NGC 2632.The vertical dashed lines in the histogram show the mean and ±1 for each parameter

Figure 5 .
Figure 5. Histogram showing the distance distribution of stars in M67 without the cluster distance prior (i.e., geometric distances, shown in equation 2)shown in blue and after using the cluster prior (i.e., equation 8) shown in yellow.The red line indicates the centre of the cluster according to the cluster distance prior and the yellow lines are the radial size of the cluster according to the cluster distance prior

Figure 6 .
Figure 6. eff and log() joint probability distribution for four different stars in M67.The four stars represent the typical PDF for different types of stars in the cluster.The blue line is the best-fitting isochrone.

Figure 7 .
Figure 7. Corner plot of a star with a Gaia id = 604907110979352576.The photometric prior is shown in green with it being marginalised values on the  eff and log() histogram plots.The probability distribution of the fit with and without the photometric prior is shown in blue and red respectively.

Figure 8 .
Figure8.The top panel is a scatter plot of photometric log() vs spectroscopic log() minus photometric log().The bottom is a scatter plot of photometric  eff vs spectroscopic  eff minus photometric  eff .For both panels the spectroscopic log() in the blue points are calculated using the photometric prior and the red points without.For both panels we used all the stars from all open clusters that passed the quality cuts.The solid lines are the median of a bin containing 5% of the stars in the cluster.The coloured area shows ± 1 4 dex, we can see that the trends of [Si/Fe], [Ni/Fe], [Cu/Fe], [Sc/Fe], [Ti/Fe] and [Cr/Fe] are significantly different.Atomic diffusion is much more visible in this work in [Mg/Fe], [Si/Fe], [Ni/Fe], [O/Fe], [Sc/Fe], [Ti/Fe], [Cu/Fe], [Sm/Fe], [Ba/Fe], and [Al/Fe] in M67.In Ruprecht 147, the difference is larger, with atomic diffusion only visible in this work in [Cu/Fe], [Co/Fe] and [Ni/Fe].The spread of Calcium in all open clusters is lower in this work compared to GALAH DR4.

Figure 9 .Figure 9 .
Figure9.Stellar parameters and abundance spread with respect to log() for M67.Blue dots are the stars that were analysed using the photometric prior and red without the prior.The number on the top right corner of each graph indicates the number of stars present in each graph.The Kiel diagram panel has the best fitting isochrone used in getting the photometric parameters.The solid lines are the median of a bin containing 10% of the stars in the cluster, except for the Li panel where it is 5% of the stars in the cluster.The coloured area shows ± 1 .

Figure 10 .Figure 11 .
Figure 10.Stellar parameters and abundance spread with respect to log() for Ruprecht 147.Blue dots are the stars that were analysed using the photometric prior and red without the prior.The number on the top right corner of each graph indicates the number of stars present in each graph.The Kiel diagram panel has the best fitting isochrone used in getting the photometric parameters.The solid lines are the median of a bin containing 7 stars, with the coloured area showing ± 1 .

Figure 12 .Figure 12 .
Figure12.Stellar parameters and abundance spread with respect to log() for M67.Blue dots are the stars that were analysed using the photometric prior and green dots are from GALAH DR4.The number on the top right corner of each graph indicates the number of stars present used in the photometric prior graph.The Kiel diagram panel has the best fitting isochrone used in getting the photometric parameters.The solid lines are the median of a bin containing 10% of the stars in the cluster, except for the Li panel where it is 5% of the stars in the cluster.The coloured area shows ± 1 .

Figure 13 .Figure 14 .
Figure 13.Stellar parameters and abundance spread with respect to log() for Ruprecht 147.Blue dots are the stars that were analysed using the photometric prior and green dots are from GALAH DR4.The number on the top right corner of each graph indicates the number of stars present used in the photometric prior graph.The Kiel diagram panel has the best fitting isochrone used in getting the photometric parameters.The solid lines are the median of a bin containing 7 stars, with the coloured area showing ± 1 .

Figure D1 .
Figure D1.HR diagram of all the open clusters studied in this work.The best fitting padova isochrone is shown in by the blue line.

Table 1 .
Paunzen (2008)(2000)for finding cluster members.The centre of our positional conical limits is indicated by the  and  values, and the radius of the conical search by .Our centre values and limits for pmra, pmdec, and parallax are indicated in the   cos(  ),   , and  columns.The values of the centres of the clusters are taken fromWenger et al. (2000)except for ASCC 16 which was taken fromPaunzen (2008). Gaia and  GALAH are the number of observations from Gaia and GALAH respectively.The last column indicates the number of unique stars observed by GALAH.Note that the parallax centres are not the actual centres of the cluster; they are just used as a boundary to exclude stars that are not in the cluster.
astrometry points.It varies between −0.150 and +0.130 mas (Lindegren et al. 2021), and it varies as a function of stellar type

Table 2 .
Non-LTE and atmospheric models used in the creation of the training set.

Table 3 .
Comparison between our cluster centres and cluster sizes to cluster distances and sizes calculated directly from geometric and photo-geometric distances.

Table 4 .
Comparison between our cluster centre, the size, and the values given in BO19, HR23.

Table 5 .
Membership numbers from our work compared to the membership numbers in HR23, showing the possible field stars.The second and fifth columns shows the number of member stars in our study obtained from Gaia and GALAH catalogues, respectively.The third column shows the number of open cluster members from HR23.The fourth and last columns show the possible field stars in our study from Gaia and GALAH catalogues, respectively.

Table 6 .
The parameters and their ranges for isochrones for each open cluster.Age is given in log(age).

Table E1 .
The number of members calculated using the Gaia, ALLWISE, and Pan-STARRS catalogues for each open cluster.Cluster Gaia  ALLWISE  Pan−STARRS G BP G RP