11institutetext: Universidade de São Paulo, IAG, Rua o Matão 1226, Cidade
Universitária, São Paulo 05508-900, Brazil
11email<EMAIL_ADDRESS>22institutetext: Max Planck Institute for
Astronomy, Königstuhl 17, D-69117 Heidelberg, Germany
22email<EMAIL_ADDRESS>33institutetext: INAF-Osservatorio di Padova, Vicolo
dell’Osservatorio 5, I-35122 Padova, Italy 44institutetext: AURA for the
European Space Agency (ESA), Space Telescope Science Institute, 3700 San
Martin Drive, Baltimore, MD 21218, USA 55institutetext: Università di Padova,
Dipartimento di Astronomia, Vicolo dell’Osservatorio 2, I-35122 Padova, Italy
66institutetext: Centro di Ateneo di Studi e Attività Spaziali “Giuseppe
Colombo” – CISAS, Via Venezia 15, 35131 Padova, Italy 77institutetext:
Universidade Estadual de Santa Cruz, Departamento de Ciências Exatas, Rod.
Jorge Amado km 16, Ilhéus 45662-900, Bahia, Brazil 88institutetext: Instituto
de Astronomía, Universidad Nacional Autónoma de México, A. P. 106, C.P. 22800,
Ensenada, B. C., México 99institutetext: Astronomical Observatory, University
of Warsaw, Al. Ujazdowskie 4, 00-478 Warszawa, Poland 1010institutetext:
Universidade Federal do Rio Grande do Sul, Departamento de Astronomia, CP
15051, Porto Alegre 91501-970, Brazil 1111institutetext: Dipartimento di
Fisica, Università di Ferrara, Via Giuseppe Saragat 1, Ferrara I-44122, Italy
1212institutetext: Universidad Andres Bello, Facultad de Ciencias Exactas,
Departamento de Ciencias Físicas, Instituto de Astrofísica, Av. Fernández
Concha 700, Santiago, Chile

# Combined Gemini-South and HST photometric analysis of the globular cluster
NGC 6558 ††thanks: Observations collected at the Gemini South Telescope, under
programme GS-2020A-Q-121 (PI: L. Kerber), and at the _Hubble_ Space Telescope
under programs GO-15065 (PI: R. Cohen) and GO-9799 (PI: Rich)

The age of the metal-poor population of the Galactic Bulge

S. O. Souza 1122 M. Libralato 3344 D. Nardiello 335566 L. O. Kerber 77 S.
Ortolani 335566 A. Pérez-Villegas 88 R. A. P. Oliveira 99 B. Barbuy 11 E. Bica
1010 M. Griggio 331111 B. Dias 1212

(Received 20/05/2024 ; accepted 19/07/2024)

###### Abstract

Context. NGC 6558 is a low-galactic latitude globular cluster projected in the
direction of the Galactic bulge. Due to high reddening, this region presents
challenges in deriving accurate parameters, which require meticulous
photometric analysis. We present a combined analysis of near-infrared and
optical photometry from multi-epoch high-resolution images collected with
Gemini-South/GSAOI+GeMS (in the $J$ and $K_{S}$ filters) and HST/ACS (in the
F606W and F814W filters).

Aims. We aim to refine the fundamental parameters of NGC 6558, utilizing high-
quality Gemini-South/GSAOI and HST/ACS photometries. Additionally, we intend
to investigate its role in the formation of the Galactic bulge.

Methods. We performed a meticulous differential reddening correction to
investigate the effect of contamination from Galactic bulge field stars. To
derive the fundamental parameters age, distance, reddening, and total-to-
selective coefficient, we employ a Bayesian isochrone fitting. The results
from high-resolution spectroscopy and RR Lyrae stars were implemented as
priors. For the orbital parameters, we employ a barred Galactic mass model.
Furthermore, we analyze the age-metallicity relation to contextualize NGC 6558
within the Galactic bulge history.

Results. We studied the impact of two differential reddening corrections on
the age derivation. When removing as much as possible the Galactic bulge field
star contamination, the isochrone fitting combined with synthetic colour-
magnitude diagrams gives a distance of $8.41^{+0.11}_{-0.10}$ kpc, an age of
$13.0\pm 0.9$ Gyr, and a reddening of E($B-V$)$\,\,=0.34\pm 0.02$. We derived
a total-to-selective coefficient R${}_{V}=3.2\pm 0.2$ thanks to the
simultaneous near-infrared$-$Optical synthetic colour-magnitude diagram
fitting, which, aside from errors, agrees with the commonly used value. The
orbital parameters showed that NGC 6558 is confined whitin the inner Galaxy
and it is not compatible with a bar-shape orbit, indicating that it is a bulge
member. Assembling the old and moderately metal-poor ([Fe/H]$\,\,\sim-1.1$)
clusters in the Galactic bulge, we derived their age-metallicity relation with
star formation stars at $13.6\pm 0.2$ Gyr and effective yields of
$\rho=0.007\pm 0.009\,\,Z_{\odot}$.

Conclusions. The derived old age for NGC 6558 is compatible with other
clusters with similar metallicity and a blue horizontal branch in the Galactic
bulge, which compose the moderately metal-poor globular clusters. The age-
metallicity relation shows that the starting age of star formation is
compatible with the age of NGC 6558, and the chemical enrichment is ten times
faster than the ex-situ globular clusters branch.

###### Key Words.:

Galaxy: bulge – globular clusters: individual: NGC 6558

##  1 Introduction

The in situ Galactic bulge globular clusters (GCs) are very likely the first
objects formed in the early Galaxy. They should have formed in the early
building blocks that merged into a proto-Milky Way (MW) within the
$\Lambda$CDM scenario (White & Rees, 1978; White & Frenk, 1991). The important
discriminator of the phase, when they formed, is their very old age $>10$ Gyr
(Kruijssen et al., 2019; Kerber et al., 2019; Ortolani et al., 2019; Forbes,
2020; Souza et al., 2021, 2023), older than the thick disk ($\sim 6-9$ Gyr;
Pinna et al., 2024) and bar formation (Barbuy et al., 2018a). The Galactic bar
is supposed to have been formed 8 Gyr ago (Bovy et al., 2019; Wylie et al.,
2022) with evidence of a recent burst of star formation 3 Gyr ago (Nepal et
al., 2024).

The present composition of the Galactic bulge is far more complex than was
thought previously, with a mix of stellar populations (e.g. Barbuy et al.,
2018a; Queiroz et al., 2020, 2021). The present Galactic bulge includes the
presence of a bar and a modified bulge or pseudo-bulge, inner thin and thick
disc (Nogueras-Lara et al., 2023b), inner halo (Pérez-Villegas et al., 2017),
a nuclear star cluster (Nogueras-Lara et al., 2023a), as well as accreted
structures such as Heracles (Horta et al., 2021), Kraken (Kruijssen et al.,
2020), and a smaller contribution from _Gaia_ –Enceladus–Sausage (Belokurov et
al., 2018; Helmi et al., 2018).

The GCs located in the inner Galaxy, as listed by (Bica et al., 2016, 2024,
their Table 3) and classified as Galactic bulge clusters based on orbital
analysis (Pérez-Villegas et al., 2020) are also identified as formed in-situ
by Belokurov & Kravtsov (2024). In particular, it is not possible to define
the most recently detected clusters (Bica et al., 2024; Garro et al., 2024) as
in-situ or ex-situ because there is not enough information to classify them
(e.g., chemical abundances, ages, orbital properties). Regarding their orbit
shapes, they would be modified by the gravitational force induced by the bar
formation, with some of them trapped in one resonance of the bar. Simulations
of the bar effects on the kinematics and structure of the Galactic box/peanut
bulge can be found in Debattista et al. (2017), Fragkoudi et al. (2020),
Moreno et al. (2022), among others.

In the present work, we carry out a Colour-Magnitude Diagram (CMD) study of
the GC NGC 6558. The cluster is projected on the Galactic bulge, with
equatorial coordinates (J2000) $\alpha=18^{\rm h}10^{\rm m}18.4^{\rm s}$,
$\delta=-31^{\rm o}45^{\prime}49^{\prime\prime}$, and Galactic coordinates
$l=0.201^{\circ}$, $b=+6.025^{\circ}$ (Harris, 1996, 2010 edition). In Rich et
al. (1998), NGC 6558 was analysed and suggested to belong to a new (at that
moment) class clusters in the Galactic bulge characterized by having a clear
blue extended horizontal branch and a poorly populated giant branch. The
cluster metallicity of $-1.17\pm 0.10$ was recently derived from high-
resolution spectroscopy (Barbuy et al., 2018a; González-Díaz et al., 2023).
Photometric and spectroscopic analyses have shown that the Galactic bulge GCs
have a peak in metallicity around [Fe/H]$=-1.1$ (Bica et al., 2016, 2024),
completing the characterisation of this class of clusters. So far, a dozen
clusters have been identified with a metallicity of [Fe/H]$\sim-1.1$ together
with a very old age and located in the Galactic bulge (e.g. Garro et al.,
2023; Bica et al., 2024).

Pérez-Villegas et al. (2018) integrated the NGC 6558 orbit, based on the Rossi
et al. (2015) proper motions, combined with the radial velocity of $-194.45$
km s-1 from Barbuy et al. (2018b),indicating that it shows a prograde orbit.
The orbit also seems to follow the bar shape in the x–y projection and with a
boxy shape in the x–z projection (in a bar co-rotating frame), indicating that
NGC 6558 is trapped by the Galactic bar. Afterwards, Pérez-Villegas et al.
(2020, hereafter PV20), using _Gaia_ DR2 proper motions (Gaia Collaboration et
al., 2018a), computed the orbits of 78 Milky Way GCs listed in Bica et al.
(2016, their tables 1 and 2), which includes NGC 6558. Using a heliocentric
distance of $8.26\pm 0.53$ kpc (Barbuy et al., 2018b) for NGC 6558, the
cluster was identified as a current bulge/bar member with a $\sim 99\%$
probability.

Massari et al. (2019), using the McMillan (2017) Galactic model, associated
NGC 6558 with the main-bulge progenitor (in-situ) by means of the age-
metallicity relation (AMR) and the total orbital energy and angular momentum
in the z-direction. Callingham et al. (2022) have reached the same result
through a robust statistical analysis of the AMR. More recently, Belokurov &
Kravtsov (2024) classified NGC 6558 as an in-situ cluster following a
classification method using the AMR and also detailed chemistry and dynamical
properties.

It is important to stress the crucial role of distance in the orbital
integration and, therefore, in the classification of NGC 6558 as a Galactic
bulge member and in-situ cluster. In the literature, the heliocentric distance
of NGC 6558 ranges from $\sim 6.3$ kpc (Rich et al., 1998) to $\sim 8.3$ kpc
(Barbuy et al., 2018b). Therefore, a comprehensive study of NGC 6558 supported
by high-quality data is needed to consolidate the recent findings concerning
its nature.

In the present work, we analyse NGC 6558 with deep images in the NIR obtained
with Gemini-South/GSAOI and in the optical with ACS/HST. The simultaneous
isochrone fitting in the two wavelength ranges allows better fixing the total-
to-selective extinction ratio RV. In Section 2 the observations and data
reduction are described. In Section 3 the RR Lyrae are identified and used to
derive the magnitude level to be used as a prior to the distance. In Section 4
the isochrone fitting is applied and described. In Section 5 the orbital
analysis is presented. In Section 6 the results are discussed, and in Section
7 conclusions are drawn.

##  2 Observations

The adopted HST data consists of two epochs of observations collected with the
ACS/WFC imager: (i) GO-9799 data-set (PI: Rich) contains 1$\times$ 340 s
F606W, 2$\times$10 s $+$ 1$\times$340 s F814W images; (ii) GO-15065 data-set
(PI: Cohen) contains 1$\times$10 s $+$ 4$\times$498 s F606W, 1$\times$10 s $+$
4$\times$498 s F814W images. The difference between the first and the second
epoch is $\Delta t\simeq 15.9$ yrs. The HST image of the cluster combining the
ACS/WFC filters used in this work, is shown in the left panel of Figure 1.

The GSAOI images of NGC 6558 were collected on 2020 March 3 as part of the
program GS-2020A-Q-121 (PI: L. Kerber). They covered a field of view (FoV) of
about 85 $\times$ 85 arcsec2, with a pixel scale of 20 mas pixel-1. The field
centered on NGC 6558 was observed in $J$ and $K_{\rm{s}}$ filters with a
dithering pattern of 5 images with 4 coadds of 50 s, totalizing 1000 s of
exposure time in each filter. Additional $J$ and $K_{\rm{s}}$ images with an
exposure time of 10 s were obtained to extend the analysis to bright stars
otherwise saturated in longer exposures. The median FWHM value for the $J$ and
$K_{\rm{s}}$ images is about 0.10 arcsec. The Gemini image of the cluster
combining the GSAOI $J$ and $K_{S}$ filters used in this work, is shown in the
right panel of Figure 1.

Figure 1: Images of NGC 6558. Left: $F606W/F814W$ combined colour image from
the HST ACS/WFC camera for NGC 6558 ($202\times 202$ arcsec2). The green
square represents the FoV of GSAOI ($85\times 85$ arcsec2). Right: $J/K_{S}$
combined colour image from the Gemini GSAOI camera. North is at the top, and
east is to the left for both images.

###  2.1 Data reduction and proper-motion computation

The GSAOI data reduction was performed following the procedure described in
Kerber et al. (2019), consisting in empirical-point-spread-function (ePSF)
fitting to obtain positions and magnitudes. The main differences with respect
to Kerber et al. are: (i) we implemented a second-step photometry stage
adapting for the GSAOI data the FORTRAN software KS2 (Nardiello et al., 2018;
Libralato et al., 2022, and Anderson et al., in preparation). KS2 is
specifically designed to improve the finding of faint sources (by using all
images at once) and the photometry in crowded environments (by ePSF
subtracting all neighbors to each source prior to measure its position and
flux); (ii) we used the _Gaia_ DR2 catalog (Gaia Collaboration et al., 2018b)
to set the reference frame system with x and y axes pointing towards North and
West, respectively, and an arbitrary pixel scale of 40 mas pixel-1. The
photometry was calibrated on the Two Micron All Sky Survey (2MASS; Skrutskie
et al., 2006) photometric system with a simple zero-point, and corrected for
the effects of differential reddening as in Milone et al. (2012) and Bellini
et al. (2017). The HST data reduction was performed following Nardiello et al.
(2018) and Libralato et al. (2022), again by means of first- and second-step
photometric methods.

Proper motions were obtained following Libralato et al. (2021), summarized as
follows. KS2 also delivers single-exposure catalogs, one for each image,
containing raw deblended position and flux of each detected source. For each
star in each HST and GSAOI KS2-based raw catalog, we used six-parameter local
linear transformations to obtain its position onto the reference frame system
of the KS2-based HST master catalog. We used only cluster stars to compute the
coefficients of these transformations, meaning that our proper motions are
measured relative to the bulk motion of the cluster. Also, positions were
corrected by applying local adjustments in order to mitigate the possible
presence of small, uncorrected systematic residuals (the so-called boresight
correction; Anderson & van der Marel, 2010). The final position of a star in
each epoch was estimated as the robust average of the transformed positions in
all images of that epoch. At odds with Libralato et al. (2021), we used the
HST and not the _Gaia_ catalog as a reference because of the few sources in
common between the latter and the GSAOI catalogs that would have prevented us
from using a local-transformation approach. This process might seem redundant
for the HST data since the KS2-based positions are computed by averaging the
KS2 single-exposure raw catalogs once on to the same reference system.
However, this is needed because KS2 does not give output positional
uncertainties, which are needed to estimate the proper-motion errors and
discern between well- and poorly-measured objects. Finally, proper motions
were then defined as the displacements multiplied by the pixel scale (40 mas
pixel-1) and divided by the temporal baseline ($\sim$16.5 yr). Proper-motion
errors were computed as the sum in quadrature of the positional errors of the
two epochs, again multiplied by the pixel scale and divided by the temporal
baseline.

###  2.2 Membership probability

The membership probability for each star was derived using the HST proper
motions and RA and DEC values. We fitted a double Gaussian in each dimension
of the vector-point diagram (VPD) to find the peak of the cluster distribution
and the contribution of the high-spread background. Each star was assigned a
Gaussian probability using the cluster mean and standard deviation in the
proper motion distribution (top left panel of Figure 2). Since some background
and foreground stars can have similar proper motions as the cluster and be
wrongly assigned as members, we also combined the proper motion membership
with a membership probability concerning the distance from the cluster centre
(bottom left panel of Figure 2). The top middle panel shows the membership
probability for the HST catalog. As cluster members, we assume all stars with
probabilities above $80\%$. To remove the outlier stars that survived the
membership selection, we performed some steps of the method applied by Maia et
al. (2010) and briefly described as follows (bottom middle panel of Figure 2):
in the same sky region, a sample of field and cluster stars are selected, here
we adopted stars with probabilities between $10\%$ and $20\%$ as the field
reference, and probabilities above $80\%$ as cluster members; the CMD is
divided in a grid with $\Delta=0.08$ and $\Delta=0.25$ mag in colour and
magnitude, respectively, which are equivalent to $3$ times the standard
deviation in colour and $6$ times the standard deviation in magnitude; the
density of field and cluster points in each cell are then compared; a
probability is assigned for each cell as $P=(N_{\rm cluster}-N_{\rm
field})/N_{\rm cluster}$ being $0$ when the number of field stars is larger
than the cluster stars and removing cells with only one cluster star. In our
case, this method was applied to remove as many outlier stars as possible.
Therefore, the reference field must not be highly populated. The final CMD in
the right panel of Figure 2 appears less contaminated after the cleaning
method. The combined GSAOI+HST catalog is then obtained by cross matching both
catalogs.

Figure 2: Membership probability derivation. The top left and bottom left
panels show VPD and spatial position from the cluster centre coloured by the
membership probability value. The corner upper and right panels show the
double Gaussian fitting to the distributions. The top middle panel shows the
membership distribution before (red) and after (blue) the cleaning method. The
cyan region shows the membership range of reference field stars while the
magenta one is the cluster members probability region. The bottom middle
panels show the reference field and cluster stars on the left and right,
respectively. The cleaned CMD is shown in the right panel. The red star
symbols show the OGLE RR Lyrae classified as members following the membership
method.

###  2.3 Differential reddening correction

We corrected the data from differential reddening using the method commonly
applied in the literature (Piotto et al., 1999; Alonso-García et al., 2012;
Milone et al., 2012; Hendricks et al., 2012; Bellini et al., 2017) and briefly
described as follows: a sample of reference stars is selected, sometimes
between the magnitudes where the angle between the reddening vector and the
CMD is higher; a fiducial line is derived from this selection of stars; the
distance of each reference star and the fiducial line is measured along the
reddening vector; this distance is translated into the reddening of each
reference star; the final step is, for each star in the catalogue, a number of
neighbour stars of the reference sample are selected and the final reddening
of the specific star is the median of the reddening distribution of the
neighbours. Some authors perform the method several times until the variation
on the fiducial line becomes negligible. The differential reddening correction
aims to reduce the spread along the CMD, bringing the stars as close as
possible to the fiducial line. Therefore, creating the fiducial line is a
crucial step for the differential reddening correction.

We derived the fiducial line in two different situations to show its influence
on the final result of the differential reddening correction (Figure 3).
First, we selected reference stars in the final combined GSAOI+ACS catalog,
which is limited to the GSAOI FoV of $85\times 85$ arcsec2 (left panels of
Figure 3). In this representation, cyan dots denote field stars, while magenta
dots represent cluster stars, consistent with Figure 2. Since the half-light
radius of the cluster is $\sim 45.1$ arcsec (Baumgardt et al., 2020), the
GSAOI FoV has more cluster members as field stars, which is reflected in our
selection of reference stars where we have $7\%$ of field stars (left panels
of Figure 3). The differential reddening map obtained from this less
contaminated selection is shown in the bottom-left panel of Figure 3. Along
this work, we will call this differential reddening correction from fiducial
line 1 as DRCFL1.

In another test, we selected the reference stars on the entire ACS/WFC FoV
(middle panels of Figure 3). Since the centre of the cluster is imaged in one
of the two ACS/WFC chips (see Figure 1), the ACS/WFC images cover a large
portion of the field outside the half-light radius of the cluster and, thus,
more field stars are present in our catalog. Indeed, for this reference
sample, we have $43\%$ of field stars. We corrected for the effects of the
differential reddening as before and obtained the map shown in the bottom-
middle panel of Figure 3. For a direct comparison with the previous test,
DRCFL1, the panel only shows the same region covered by the GSAOI
observations. We will refer to this differential reddening correction from
fiducial line 2 as DRCFL2.

A similar approach as DRCFL2 was used by Alonso-García et al. (2012) for NGC
6558, from observations in $B$, $V$, and $I$ bands obtained with the
_Magellan_ $6.5$ m Telescope and the HST. They covered a circular area of
radius approximately $217$ arcsec from the centre of the cluster, covering
almost the same area as ACS/WFC FoV. Their resulting differential reddening
map is shown in Figure 4. For a direct comparison, the three differential
reddening maps cover the same area (GSAOI FoV) and have the same colour scale.

Both DRCFL1 and DRCFL2 maps show a consistent general behaviour as observed in
Alonso-García et al. (2012): the southern region of the cluster exhibits
positive differential reddening, whereas the northern region experiences
negative differential reddening. Nevertheless, a systematic variation of
approximately $+0.05$ mag is observed in the differential reddening when
utilizing GSAOI FoV stars (DRCFL1). This discrepancy arises from a $0.05$ mag
difference in the turn-off (TO) colour between the two fiducial lines, where
the TO of fiducial line 2 is 0.05 magnitudes redder than the TO of fiducial
line 2. The direct comparison of the resulting CMD using DRCFL1 (blue) and
DRCFL2 (red) is shown in the right panel of Figure 3. This visualization
underscores the pivotal role of the fiducial line, particularly for clusters
located within the galactic disc or projected towards the Galactic bulge,
where the density of background stars is significantly higher, making the
fiducial line redder.

For the subsequent analysis, we adopt the NGC 6558 results obtained by
employing the DRCFL1, which takes into account less field star contamination
in the differential reddening correction procedure. Nevertheless, we will
compare them with the results using the DRCFL2 to emphasize the possible
biases resulting from the contamination by background field stars on the
fiducial line creation. Figure 5 shows the three CMDs that will be employed in
this work: GSAOI [$J$, $J-K_{S}$] (left panel); HST/ACS [$m_{\rm F606W}$,
$m_{\rm F606W}-m_{\rm F814W}$] using DRCFL1 (middle panel) and using DRCFL2
(right panel).

Figure 3: Differential reddening correction procedure. The top left panels
show the CMDs with the selected reference stars (field as cyan dots and
cluster as magenta dots, same as Figure 2) to generate the fiducial line
(black line, left) and the corrected CMD (right). The differential reddening
maps are at the bottom with the positions with respect to the cluster centre.
Both density maps have the same colour code and scale and are limited to the
GSAOI FoV. On the left panel is shown the differential reddening correction
using the fiducial line constructed from the sample within the GSAOI FoV
(DRCFL1), and in the middle panel the differential reddening correction
constructing the fiducial line using stars within the HST/ACS FoV. The right
panel directly compares the cluster member stars using DRCFL1 (blue) and
DRCFL2 (red). Figure 4: Differential reddening map for NGC 6558 by Alonso-
García et al. (2012). The density map has the same colour code and scale, and
region as Figure 3. Figure 5: Final CMDs with selected cluster members. The
left panel is the GSAOI [$K_{S}$,$J-K_{S}$] CMD. The middle and right panels
show the HST/ACS [$m_{\rm F606W}$,$m_{\rm F606W}-m_{\rm F814W}$] employing the
DRCFL1 and DRCFL2, respectively. The green star symbols are the RR Lyrae
members of the cluster within the GSAOI FoV.

##  3 RR Lyrae magnitude level

RR Lyrae stars from Clement et al. (2001) and OGLE-IV (Soszyński et al., 2014)
databases were used as in Oliveira et al. (2022), in order to provide a prior
distribution to the cluster distance. Clement et al. (2001, updated in Apr
2016) contains 11 RR Lyrae with periods, amplitudes, and mean magnitudes in
the $I$ band, with a note that all the data comes from OGLE-IV in this case.
Soszyński et al. (2014) lists seven RR Lyrae within a radius of
$2.1^{\prime}$, but a wider search of $10^{\prime}$ in OGLE Collection of
Variable Stars111http://ogledb.astrouw.edu.pl/~ogle/OCVS/ returns 22 RR Lyrae,
with the 11 more central ones in common with Clement et al. (2001). The latter
provided time-series photometry and mean $I$ magnitudes from $\sim 660$
epochs, and additional mean $V$ magnitudes from 42 epochs.

A cross-match with our HST/ACS catalog retrieved 5 of the 22 RR Lyrae with a
membership probability (derived in Section 2.2) larger than $80\%$, of which
three are within the GSAOI FoV. A weighted average of the mean RR Lyrae
magnitudes was obtained with membership values as weights, as presented in
Table LABEL:tab:rrlyr for the different filters. Figure 6 presents the mean
$V$ and $I$ magnitudes as a function of the period.

Table 1: Parameters of 5 RR Lyrae classified as members of NGC 6558 from their
membership probabilities. The last column is the weighted average of the RR
Lyrae mean magnitudes in different photometric systems.

OGLE ID | 14866 | 14886 | 14888 | 14892 | 14912 | $<\,\,>$
---|---|---|---|---|---|---
RA | $272.555$ | $272.565$ | $272.566$ | $272.568$ | $272.582$ | —
DEC | $-31.771$ | $-31.765$ | $-31.778$ | $-31.762$ | $-31.768$ | —
$\mu_{\alpha}^{*}$ | $-0.138$ | $0.113$ | $0.055$ | $0.281$ | $-0.273$ | —
$\mu_{\delta}$ | $-0.009$ | $-0.139$ | $0.008$ | $-0.026$ | $-0.087$ | —
$I$ (OGLE) | $15.548$ | $15.636$ | $15.633$ | $15.253$ | $15.418$ | $15.50\pm 0.03$
$V$ (OGLE) | $16.498$ | $16.619$ | $16.489$ | $16.234$ | $16.577$ | $16.49\pm 0.03$
$G$ (_Gaia_) | $16.297$ | $16.326$ | $16.251$ | $15.979$ | $16.291$ | $16.23\pm 0.03$
$m_{\rm F606W}$ | $16.058$ | $16.331$ | $16.343$ | $15.942$ | $16.377$ | $16.21\pm 0.04$
$m_{\rm F814W}$ | $15.622$ | $15.224$ | $15.583$ | $15.261$ | $15.422$ | $15.42\pm 0.03$
$J$ | — | $15.153$ | — | $14.560$ | $14.660$ | $14.79\pm 0.08$
$K_{S}$ | — | $14.616$ | — | $14.024$ | $14.111$ | $14.25\pm 0.08$
Period | $0.504$ | $0.467$ | $0.312$ | $0.756$ | $0.687$ | —
Type | RRab | RRab | RRc | RRab | RRab | —
$\mathcal{P_{\rm memb}}$ | $0.833$ | $0.923$ | $0.846$ | $0.845$ | $0.865$ | —

The derived magnitudes are converted to distance modulus in each iteration of
the isochrone fitting using the $M_{I}-$ and $M_{V}-\rm{[Fe/H]}$ relations
from Oliveira et al. (2022) obtained from BaSTI $\alpha$-enhanced models
(Pietrinferni et al., 2021) for the zero-age horizontal branch, providing a
variable prior in distance which vary with the reddening and metallicity of
each Markov chain Monte Carlo (McMC) iteration. The use of the magnitude level
appears to be a better constraint to the distance because the assumed
metallicity, reddening, and $R_{V}$ play a key role in the final distance. For
example, assuming a metallicity of ${\rm[Fe/H]}=-1.17\pm 0.10$ (Barbuy et al.,
2018b) the calibrations provide apparent distance moduli of
$(m-M)_{I}=15.30\pm 0.10$ and $(m-M)_{V}=15.86\pm 0.11$. Converting them to
absolute distance moduli using $E(B-V)=0.38\pm 0.05$ mag from Barbuy et al.
(2018b) the distances are $8.47\pm 0.52$ and $8.63\pm 0.73$ kpc are obtained
respectively from $I$ and $V$, whereas distances smaller by $0.4-0.7$ kpc are
derived with $E(B-V)=0.44$ mag from Harris (1996, 2010 edition). All values
are obtained assuming R${}_{V}=3.1$. Therefore, keeping the prior on the
magnitude value of the RR Lyrae, we avoid an erroneous distance determination
to the detriment of some specific set of metallicity, reddening, and $R_{V}$.

Oosterhoff (1939, 1944) classified the MW GCs into two classes based on the
mean of the pulsation periods of their RR Lyrae stars: Oosterhoff type I (OoI)
and Oosterhoff type II (OoII) group. In a nutshell (see also Prudil et al.,
2019a, b; Martínez-Vázquez et al., 2021), OoI GCs have metallicity values
above $-1.7$ and contain mainly RRab stars with a short average pulsation
period, commonly around $0.55$ day. The OoI GCs also present a low ($\sim
20\%$) of RRc type RR Lyrae. In turn, OoII GCs contain a significant number of
RRc stars ($\sim 40\%$), are more metal-poor than $-1.7$, and their RRab RR
Lyrae sample shows an average pulsation period of $\sim 0.65$ day. The mean
period of RRab stars of NGC 6558 is $0.61\pm 0.04$ days (Table
LABEL:tab:rrlyr). Even though the number of RR Lyrae stars selected as members
of the cluster is low, we can estimate that the sample has $20\%$ of first-
overtone pulsators (RRc). The average period of RRab and number of RRc in our
sample together with the cluster metallicity of $-1.18$ could indicate that
NGC 6558 is a OoI GC. Nevertheless, taking into account the low statistics,
the average period of RRab stars could also point out to OoII type if the
number of RRc stars would increase with more observations.

Figure 6: Mean $I$, $V$, and $G$ magnitudes versus the period of the RR Lyrae
sample. The dashed lines mark the weighted average given in Table
LABEL:tab:rrlyr and the dotted lines show the standard error.

##  4 Isochrone fitting

The fundamental parameters age, metallicity, distance, reddening, total-to-
selective extinction ratio RV, and binary fraction were derived using the
SIRIUS code (Souza et al., 2020). The code employs the Bayesian method of McMC
to obtain probability distributions for each parameter. The code compares the
observed CMD with synthetic CMDs constructed from each set of parameters
randomly drawn during the fitting process.

To construct the synthetic diagrams, SIRIUS utilizes isochrones from the
Dartmouth Stellar Evolution Database (DSED; Dotter et al., 2008), which
initially spans ages between 10 Gyr and 15 Gyr with intervals of 0.1 Gyr, and
metallicities between $-2.30$ and $0.0$ with intervals of $0.01$ dex. However,
the code interpolates different isochrones during the fitting process to
obtain the model with exact values. With the model constructed, the code
adopts the initial mass function of Chabrier (2003) to draw _N_ mass values.
These values are then interpolated to obtain the corresponding magnitude
values.

A fraction of these _N_ mass values are associated with spatially unresolved
photometric binary stars (stars close enough to have their flux
overestimated). While the first star has mass mA, the hypothetical secondary
star will have mass mB calculated as m${}_{B}=q\cdot m_{A}$, where q is the
mass ratio randomly selected between $0$ and $1$. The calculation of the final
magnitude of binary stars is computed from the sum of the flux of each star:

$M=-2.5\log\left(10^{(-M_{A}/2.5)}+10^{(-M_{B}/2.5)}\right)$ (1)

With the magnitudes of each star calculated, an error function is applied to
spread the points in the CMD. The error function is derived from the observed
data by calculating the median error in magnitude bins. The error function is
shifted to the position of the theoretical isochrone from the turn-off point
to ensure no bias in the position of the synthetic diagram relative to the
observed one. Thus, whatever set of parameters is drawn, the error function
will generate a synthetic CMD.

After spreading the stars according to the error function, the code calculates
the extinction coefficients following the extinction law (RV) of each
iteration. The extinction law is interpolated from the curves of Cardelli et
al. (1989), and the extinction coefficients for the $J$, $K_{S}$, F606W, and
F814W bands are obtained from this. Then, each absolute magnitude is converted
to apparent magnitude as follows:

$m_{\lambda}=M_{\lambda}+(m-M)_{0}+R_{V}\cdot E(B-V)\cdot A_{\lambda}$ (2)

where (m-M)0 is the intrinsic distance modulus, Aλ is the extinction
coefficient in band $\lambda$.

With the synthetic diagram already with the apparent magnitudes, a luminosity
function is applied to reproduce the observation conditions to which the data
were subjected. The luminosity function is calculated as the number of stars
in each magnitude bin. When applied to the synthetic diagram, some stars will
be excluded to make the synthetic diagram more similar to the observed one in
terms of the number of stars at each magnitude.

When the RV is a free parameter, the isochrone fitting is performed
simultaneously for the [$J$, $J-K_{S}$] and [$m_{\rm F606W}$, $m_{\rm
F606W}-m_{\rm F814W}$] diagrams. Simultaneous fitting allows the determination
of the extinction law since it will force the adjustment of a single set of
distance and reddening for the two diagrams. Another advantage of this
approach is that the age determination is not biased by the choice of the
photometric system.

As a proxy of distance, we are employing a prior to the distance according to
the magnitude level of RR Lyrae stars. For each McMC interaction, the values
of metallicity and reddening are used for the M${}_{I}-$[Fe/H] calibration by
Oliveira et al. (2022).

$M_{I}=A+B\cdot{\rm[Fe/H]}+C\cdot{\rm[Fe/H]}^{2}.$ (3)

where $A=(0.619\pm 0.028)$, $B=(0.455\pm 0.063)$, and $C=(0.075\pm 0.030)$.
Then, the expected distance for the previously RR Lyrae magnitude level,
reddening, and metallicity is calculated for each interaction. This calculated
distance is then compared with the distance value for the specific McMC
interaction.

The McMC was applied using the Python library emcee (Foreman-Mackey et al.,
2013) and the PyDE222https://github.com/hpparvi/PyDE, a global optimization
that uses differential evolution. The likelihood function is an adaptation of
Tremmel et al. (2013), which is basically a Poisson distribution comparing the
number of observed and synthetic stars in a colour and magnitude bin. The
adaptation includes a simple isochrone fitting component comparing the
isochrone to the two-dimensional distribution of observed points. This change
allows the code to reach the stability of the distance and reddening values
more quickly. Meanwhile, the likelihood component that compares the synthetic
diagram with the observed one allows for better age and binary fraction
calculation.

In the isochrone fitting procedure below, we applied the metallicity from
Barbuy et al. (2018a) and the RR Lyrae magnitude level from Section 3 as
priors. Figures 7 and 8 show the simultaneous isochrone fitting on the [$J$,
$J-K_{S}$] and the [$m_{\rm F606W}$, $m_{\rm F606W}-m_{\rm F814W}$] CMDs (the
corner-plots are shown in the Figure 11). Figure 7 shows the HST CMD with the
DRCFL1 and Figure 8 adopting DRCFL2. The distance values, d${}_{\odot}=8.41\pm
0.10$ and $8.44\pm 0.10$ kpc, respectively, are in excellent agreement between
each other. This agreement is, however, due to compensation in the reddening
value E($B-V$) and the extinction law RV parameter. The E($B-V$) values are
$0.34\pm 0.02$ and $0.42\pm 0.02$ for DRCFL1 and DRCFL2, respectively. More
important, is the difference in the RV values of $3.2$ and $2.9$. The low RV
is expected because the data of DRCFL2 include background Galactic bulge field
stars that are affected by dust (Minniti et al., 2014; Nataf, 2016). Removing
the Galactic bulge field stars, as is the case of DRCFL1, the relatively high
R${}_{V}=3.2$ is compatible with the Galactic latitude of NGC 6558
($l=-6.02^{\circ}$), which is outside the dark lane region (Minniti et al.,
2014; Nataf, 2016).

Finally, the difference in the derived ages, $13.0\pm 0.9$ and $13.4\pm 0.8$
Gyr, reflects the different morphology of the respective fiducial line and the
difference in the MSTO colour ($\sim 0.05$ mag).

Figure 7: Simultaneous isochrone fitting using the differential reddening
correction from fiducial line 1 (DRCFL1). The left panels show the NIR GSAOI
CMD, and the right panels show the optical F606W/F814W HST CMD. The small
panels show the Hess diagram of the data (upper) and model (best-fit synthetic
CMD, lower). In the bigger panel, the blue dots are the cluster member stars,
and the red line represents the isochrone of the best synthetic CMD fit and
the thin lines are solutions within the errors. The values obtained from the
simultaneous fitting are shown in the bottom left corner of the bigger panels,
with the respective binary fraction value highlighted. Figure 8: Same as in
Figure 7 but using the differential reddening correction from fiducial line 2
(DRCFL2).

##  5 Orbital parameters

We performed the orbital integration of NGC 6558 in order to derive the
orbital parameters apogalactic distance ($<r_{\rm apo}>$) and perigalactic
distance ($<r_{\rm peri}>$), eccentricity ($ecc=(<r_{\rm apo}>-<r_{\rm
peri}>)/(<r_{\rm apo}>+<r_{\rm peri}>)$), and the maximum absolute height
relative to the disc ($<|Z|_{\rm max}>$).

For the orbital integration, we adopted the Milky Way model from Portail et
al. (2017) by using the analytical approximation given by Sormani et al.
(2022) with the Action-based GAlaxy Modelling Architecture (AGAMA; Vasiliev,
2019), a Python package for orbital
integration333https://github.com/GalacticDynamics-Oxford/Agama. The Galactic
model of Portail et al. (2017) is composed of the x-shape peanut/bulge bar,
long bar, central concentration mass, disk, and dark-matter halo. This
Galactic model described well the complexity of the inner Galactic region
(within $\sim 5$ kpc), although further out is not very realistic. For the
case of NGC 6558, this potential is the most suitable since this cluster is
supposed to belong to the Galactic bulge (Bica et al., 2016; Pérez-Villegas et
al., 2018, 2020).

In this model, the position of the Sun is at a distance R${}_{0}=8.2$ kpc
(Bland-Hawthorn & Gerhard, 2016) from the Galactic centre. The bar rotates
with a pattern speed of $39$ km s-1 kpc-1 and is oriented at an angle of
$28^{o}$ with the Sun–Galactic centre line of sight. The mass distribution of
the model has a local circular velocity of $V(R_{0})=239.2$ km s-1. The
peculiar motion of the Sun with respect to the local circular orbit is
($U_{0}$, $V_{0}$, $W_{0}$)$=$($11.1$, $12.24$, $7.25$) km s-1 (Schönrich et
al., 2010).

The observational parameters RA, DEC, radial velocity, distance from the Sun,
and proper motions in the sky of the cluster, presented in the upper part of
Table 2, are converted to Cartesian Galactic phase-space positions and
velocities using the Astropy Python package Astropy Collaboration et al.
(2022). To take into account the uncertainties of the observational
parameters, we construct 1000 initial conditions using the Monte Carlo
approach, and integrate the orbits backwards in time for 13 Gyr. The median
orbital parameters and the probabilities of belonging to the Galactic bulge
and following the bar orbit are shown in the bottom part of Table 2. From the
values of apocentric distance $<r_{\rm apo}>$ and maximum height $<|Z|_{\rm
max}>$ together with the classification criteria of Pérez-Villegas et al.
(2020), NGC 6558 currently has a $99\%$ probability of belonging to the early
Galactic bulge. Our results are in good agreement with the calculations given
in Pérez-Villegas et al. (2020). Figure 9 shows the density probability map of
the orbits of NGC 6558 in the $x-y$ (upper left), $R-y$ (upper right), $x-z$
(bottom left), and $R-z$ (bottom right) projections. The space region in which
the orbits of NGC 6558 cross more frequently are shown in orange, and the
black curves are the orbits considering the central values of the
observational parameters. Regarding the sense of the orbital motion, we found
that NGC 6558 has prograde and retrograde at the same time. The
prograde–retrograde orbits, observed also in other MW GCs, are produced by the
presence of the Galactic bar and this behavior could be connected with chaos,
but still it is not well-understood yet (Pichardo et al., 2004; Allen et al.,
2006; Pérez-Villegas et al., 2018).

Table 2: Observational parameters used as input to the orbital integration.
Orbital parameters on the present calculations (adopting fiducial lines 1 and
2) compared with results from Pérez-Villegas et al. (2020).

Param | DRCLF1 | DRCLF2 | PV20
---|---|---|---
| Observational Parameters
RA (deg) | $272.57397$
DEC (deg) | $-31.76451$
$V_{\rm rad}$ (km s-1) | $-194.45\pm 2.10$
$<\mu_{\alpha}^{*}>$ (mas yr-1) | $-1.75\pm 0.02$ | $-1.78\pm 0.05$
$<\mu_{\delta}>$ (mas yr-1) | $-4.17\pm 0.02$ | $-4.12\pm 0.04$
d⊙ (kpc) | $8.41\pm 0.10$ | $8.44\pm 0.10$ | $8.26\pm 0.53$
| Orbital Parameters
$<r_{\rm peri}>$ (kpc) | $0.05\pm 0.04$ | $0.04\pm 0.02$ | $0.10\pm 0.07$
$<r_{\rm apo}>$ (kpc) | $1.86\pm 0.23$ | $1.78\pm 0.22$ | $2.20\pm 0.31$
$<|Z|_{\rm max}>$ (kpc) | $1.45\pm 0.04$ | $1.52\pm 0.04$ | $1.27\pm 0.23$
$ecc$ | $0.95\pm 0.04$ | $0.96\pm 0.03$ | $0.92\pm 0.05$
$\mathcal{P}_{\rm bulge}$ (%) | $99$ | $99$ | $99$
$\mathcal{P}_{\rm bar}$ (%) | $0.0$ | $0.0$ | $19.3$

Figure 9: Density probability map for the $x-y$ (upper left), $R-y$ (upper
right), $x-z$ (bottom left), and $R-z$ (bottom right) projections of the set
of orbits for NGC 6558. Orange corresponds to higher probabilities, and the
black lines show the orbits using the main observational parameters.

##  6 Discussion

For the following discussion, we adopted the isochrone fitting results of
DRCFL1 as the final parameters for NGC 6558. In Table 3, we tentatively
identify a list of Galactic bulge clusters with characteristics similar to NGC
6558, which are probably the oldest objects in the Galaxy. A list of possible
members is also given for clusters that still do not have precise age
derivation and/or were classified as thick disk members by PV20. It is
important to point out that the classification as a bulge or thick disk member
depends crucially on the distance adopted, which may be uncertain with the
available data. A summary of the literature data for NGC 6558, including
reddening values, age, distance, the corresponding method employed, and
metallicity, is given in Table 4.

Table 3:  Family of Galactic bulge globular clusters with a metallicity of
[Fe/H]$\sim$-1.1, and very old age.

Cluster | $l$ | $b$ | Age | Ref. | d⊙ | [Fe/H] | Ref. | E(B-V) | HB | MV | mass | orbit
---|---|---|---|---|---|---|---|---|---|---|---|---
| deg | deg | (Gyr) |  | kpc |  |  |  |  |  | $10^{5}$M⊙ |
NGC 6256 | $347.79$ | $+3.31$ | $12.9\pm 0.1$ | 1 | $6.40\pm 0.64$ | $-1.05\pm 0.13$ | 10 | $1.10$ | blue | $-7.15$ | $0.72\pm 0.33$ | B
HP 1 | $357.42$ | $+2.12$ | $12.8\pm 0.9$ | 2 | $6.59\pm 0.65$ | $-1.01\pm 0.10$ | 11,12 | $1.19$ | blue | $-6.46$ | $1.11\pm 0.38$ | B
NGC 6401 | $3.45$ | $+3.98$ | $13.2\pm 1.2$ | 1 | $7.70\pm 0.77$ | $-1.00\pm 0.03$ | 10,12 | $0.53$ | red | $-7.90$ | $1.21\pm 0.21$ | B
Palomar 6 | $2.09$ | $+1.78$ | $12.4\pm 0.9$ | 3 | $7.67\pm 0.19$ | $-1.10\pm 0.09$ | 3 | $1.33$ | red | $-6.79$ | $0.86\pm 0.19$ | B
ESO456-SC38 (Djorg 2) | $2.76$ | $-2.50$ | $12.7\pm 0.7$ | 4 | $8.75\pm 0.20$ | $-1.07\pm 0.09$ | 13 | $0.89$ | blue | $-7.00$ | $1.34\pm 0.24$ | B
NGC 6522 | $1.02$ | $-3.93$ | $12.8\pm 1.0$ | 5 | $7.40\pm 0.19$ | $-1.05\pm 0.11$ | 14,15 | $0.48$ | blue | $-7.65$ | $3.92\pm 0.54$ | B
AL 3/BH 261 | $3.36$ | $-5.27$ | $13.4\pm 1.2^{*}$ | 6 | $6.50\pm 0.65$ | $-1.09\pm 0.05$ | 6,12 | $0.36$ | blue | $-4.19$ | $0.24\pm 0.06$ | B
NGC 6626 | $7.80$ | $-5.58$ | $12.8\pm 1.0$ | 5 | $5.34\pm 0.17$ | $-1.29\pm 0.01$ | 16 | $0.42$ | blue | $-8.16$ | $3.69\pm 0.38$ | B
NGC 6642 | $9.81$ | $-6.44$ | $12.7\pm 1.1$ | 1 | $8.10\pm 0.81$ | $-1.11\pm 0.04$ | 13 | $0.42$ | intermediate | $-6.66$ | $0.87\pm 0.55$ | B
NGC 6717 | $12.88$ | $-10.90$ | $13.5\pm 0.8$ | 7 | $7.14\pm 0.10$ | $-1.26\pm 0.07$ | 17 | $0.23$ | blue | $-5.66$ | $0.26\pm 0.02$ | B
Possible members
Terzan 1 | $357.57$ | $+1.00$ | $12.6\pm 1.3^{*}$ | 21 | $6.70\pm 0.7$ | $-1.06\pm 0.13$ | 10 | $2.48$ | red | $-4.41$ | $2.23\pm 0.66$ | B
UKS 1 | $5.13$ | $-0.76$ | $13.0\pm 1.2$ | 8 | $11.10\pm 1.80$ | $-0.98\pm 0.11$ | 18 | $2.62$ | — | $-6.91$ | $0.80\pm 0.01$ | —
NGC 6355 | $359.58$ | $+5.43$ | $13.2\pm 1.0$ | 0 | $8.54\pm 0.19$ | $-1.39\pm 0.08$ | 0 | $0.89$ | blue | $-8.07$ | $0.99\pm 0.03$ | B
NGC 6540 | $3.29$ | $-3.31$ | $12.6\pm 1.3^{*}$ | 21 | $5.20\pm 0.52$ | $-1.06\pm 0.06$ | 13 | $0.60$ | — | $-6.35$ | $0.56\pm 0.04$ | B
NGC 6638 | $7.90$ | $-7.15$ | $12.0\pm 1.0$ | 9 | $10.32\pm 1.03$ | $-0.99\pm 0.07$ | 17 | $0.07$ | intermediate | $-7.12$ | $1.24\pm 0.23$ | TD
NGC 6723 | $0.07$ | $-17.23$ | $12.6\pm 0.6$ | 7 | $8.17\pm 0.11$ | $-1.01\pm 0.05$ | 20 | $0.05$ | intermediate | $-7.83$ | $1.57\pm 0.13$ | TD

B: Bulge; TD: Thick disc. References: Ages: 0 Souza et al. (2023, S23);1 Cohen
et al. (2021, C21); 2 Kerber et al. (2019, K19); 3 Souza et al. (2021, S21); 4
Ortolani et al. (2019, Or19); 5 Kerber et al. (2018, K18); 6 Barbuy et al.
(2021b, B21b); 7 Oliveira et al. (2020, Ol20); 8 Fernández-Trincado et al.
(2020, FT20); 9 Meissner & Weiss (2006, M06); 21 Kharchenko et al. (2016,
K16). Metallicity: 10 Vásquez et al. (2018, V18); 11 Barbuy et al. (2016,
B16); 12 Geisler et al. (2023, Ge23); 13 Geisler et al. (2021, Ge21); 14
Barbuy et al. (2021a, B21a); 15 Fernández-Trincado et al. (2019, FT19); 16
Villanova et al. (2017, Vi17); 17 Carretta et al. (2009, C09); 18 Fernández-
Trincado et al. (2020, FT20); 19 Ernandes et al. (2019, E19); 20 Fernández-
Trincado et al. (2021, FT21); 21 Kharchenko et al. (2016, K16). Distances are
from PV20 except for Pal 6 from S21. Absolute magnitudes are from Harris
(1996). Masses are from Baumgardt & Hilker
(2018)444https://people.smp.uq.edu.au/HolgerBaumgardt/globular/. Note: *
indicates that the age was derived from the integrated magnitude and the
errors are assumed as 10% of the age value.

Table 4:  Literature ages and metallicities for NGC 6558.

E(B-V) | Age | d⊙ | Method | [Fe/H] | Reference
---|---|---|---|---|---
| (Gyr) | kpc |  |  |
0.43 | — | 6.6 | 1 | –1.65 | H96
0.50 | — | 6.3 | 2 | -1.2/-1.6 | R98
— | — | — | — | -1.5 | D04
0.38 | 14 | 6.4 | 2 | -0.97 | B07
0.44 | — | — | 2 | -1.21 | C10
0.44 | — | 7.4 | — | -1.32 | H10
— | — | — | — | -1.03 | S12
— | — | — | — | -1.012 | D15
— | — | 7.4 | 3 | — | R15
0.38 | — |  8.26$\pm$0.53 | – | -1.17 | B18
— | — |  7.474${}^{0.294}_{-0.282}$0.7 | 4 | — | BV21
— | — | — | – | -1.15 | GD23

Hazen (1996, H96); Rich et al. (1998, R98); Davidge et al. (2004, D04); Barbuy
et al. (2007, B07); Chun et al. (2010, C10); Harris (1996, H10); Saviane et
al. (2012, S12); Dias et al. (2015, D15); Rossi et al. (2015, R15); Barbuy et
al. (2018b, B18b); Baumgardt & Vasiliev (2021, BV21); Vasiliev (2019, VB21);
González-Díaz et al. (2023, GD23); Methods for age and distance derivation: 1
RR Lyrae; 2 isochrone fitting; 3 isochrone fitting on proper motion cleaned
CMDs; 4 _Gaia_ proper motions.

The metallicities derived from the isochrone fitting are in good agreement
with the value from Barbuy et al. (2018a); González-Díaz et al. (2023) since
it was adopted as a prior. The metallicity of NGC 6558 is therefore
consolidated from literature studies, as follows. Barbuy et al. (2007) carried
out a detailed abundance analysis of five stars with spectra obtained with the
GIRAFFE spectrograph at the Very Large Telescope (VLT) (see also Zoccali et
al., 2008). They obtained a mean metallicity of [Fe/H]$=-0.97\pm 0.15$ for NGC
6558. From CaT triplet lines based on FORS2/VLT spectra, Saviane et al. (2012)
derived [Fe/H]$=-1.03\pm 0.14$. Also based on FORS2/VLT spectra, Dias et al.
(2015, 2016) compared the observed spectra to grids of observed and synthetic
spectra and obtained [Fe/H]$=-1.012\pm 0.013$. Barbuy et al. (2018b) analysed
4 stars of NGC 6558 observed with the UVES spectrograph at the VLT. A radial
velocity of $194.45$ km s-1 and metallicity of [Fe/H]$=-1.17\pm 0.10$ were
obtained. González-Díaz et al. (2023) analysed 4 stars within the APOGEE-2S
CNTAC 2 CN2019B program (P.I: Doug Geisler) as part of the CAPOS survey
(Geisler et al., 2021). They obtained a radial velocity of $192.63$ km s-1 and
a metallicity of [Fe/H]$=-1.15\pm 0.10$. Therefore, the Gaussian metallicity
prior with mean $-1.17$ and standard deviation of $0.10$ is reasonable to
encompass the literature metallicity derivations.

The derived heliocentric distance of the cluster is
d${}_{\odot}=8.41^{+0.11}_{-0.10}$ kpc is larger than other data given in the
literature. Rich et al. (1998) observed NGC 6558 with the _New Technology
Telescope_ (NTT) at the European Southern Observatory using the ESO Multi-Mode
Instrument (EMMI) in the imaging/focal reducer mode, reaching a magnitude of
V$\sim 20.5$ in the CMD. They derived a lower distance of $6.3$ kpc and
metallicity between [Fe/H]$=-1.2$ to $-1.6$. Baumgardt & Vasiliev (2021) also
found a lower distance of d⊙ = 7.47 kpc, taking the average distance
determinations in the literature, which is in agreement with
d${}_{\odot}=7.4\pm 0.7$ kpc from Rossi et al. (2015) who used two epoch NTT
data. A larger distance of d${}_{\odot}=8.26$ kpc close to our determination
was given in Barbuy et al. (2018b) derived from proper motion cleaned NTT
photometry, in [$V$, $V-I$].

An important contribution of this work is the simultaneous isochrone fitting
using both the NIR and optical photometries. This approach allows the
determination of the total to selective coefficient RV (e.g. Pallanca et al.,
2021) by imposing one set of fundamental parameters to fit both CMDs. With the
DRCFL1, we derived R${}_{V}=3.2\pm 0.2$, and R${}_{V}=2.8\pm 0.1$ using the
DRCFL2. The lower value obtained with DRCFL2 reflects the presence of stars in
the dust dark lane (Minniti et al., 2014) given that a larger contribution of
field stars in the HST field of view (Figure 1). The variation in the RV value
also implies a reddening E($B-V$) value variation. In Table 4, the reddening
E($B-V$) literature values range from 0.38 to 0.50. Interestingly, the
isochrone fitting gives the values E($B-V$)$=0.34\pm 0.02$ and $0.42\pm 0.02$
for DRCFL1 and DRCFL2, respectively. This variation again shows that the
reddening tends to decrease to the value of E($B-V$)$=0.35$ when removing the
background Galactic bulge field stars behind the dust lane. The reddening in
infra-red bands $E(J-K_{S})$ can be obtained from the $E(B-V)$ and $R_{V}$
provided by our results using the following equation: $E(J-K_{S})=E(B-V)\cdot
R_{V}\cdot(R_{J}-R_{K_{S}})$. For the $R_{V}=3.24$ (our result),
$R_{J}=0.29186045$ and $R_{K_{S}}=0.11886802$. Therefore,
$E(J-K_{S})=0.34\cdot 3.24\cdot(0.29186045-0.11886802)=0.19$. The extinction
in each band is obtained from $A_{J}=R_{J}\cdot E(B-V)\cdot
R_{V}=0.29186045\cdot 0.34\cdot 3.24=0.32$.

The age determination also differs according to the adopted DRCFL1 or DRCFL2,
with values of $13.0\pm 0.9$ and $13.4\pm 0.9$ Gyr, respectively. There is a
trend toward older ages with DRCFL2 because of the higher contamination of
Galactic bulge field stars. This interesting trend indicates that the Galactic
bulge is even older than NGC 6558. Cohen et al. (2021), using the method of
relative age, derived an age of $12.3\pm 1.1$ Gyr for NGC 6558. They used the
same observations as those used in this work, which were reduced with a
different pipeline. The values derived in this work and by Cohen et al. (2021)
agree within the errors, even though the median values differ by $0.7$ Gyr.

To insert the results of this work in the context of the Galactic bulge
formation, we analysed the sample of moderately metal-poor (MMP,
[Fe/H]$\sim-1.10$) GCs of the Galactic bulge, which have available age
determination in the literature (Table 3). We selected the orbital parameters
of the clusters from Pérez-Villegas et al. (2020), while for NGC 6558, we
considered only the results from the present DRCFL1 (Table 2).

In the left panel of Figure 10 is the $ecc$ vs. $|Z|_{\rm max}$ plane divided
into nine cells named from A to I. This plane is a very good way to split as
much as possible the different populations of the inner Galaxy (Queiroz et
al., 2021). The important cells for this work are those with high eccentricity
because their shapes are supported by pressure, indicating a spheroidal
structure. Razera et al. (2022) analysed a sample of 58 stars from the
reduced-proper-motion (RPM) sample of the inner Galaxy (Queiroz et al., 2021)
with metallicity values around the peak of the Galactic bulge metallicity
distribution function ($\sim-1.1$; Bica et al., 2016). These stars are shown
in the left panel of Figure 10 as cyan squares symbols. After a meticulous
chemical analysis, the authors concluded that this star sample is a genuine
member of a spheroidal structure in the inner Galaxy. The MMP GCs are all
located in cells C and F, indicating they are also possible members of the
spheroidal Galactic bulge. Moreover, since all MMP GCs are located in cell F,
this cell probably represents the oldest population of the inner Galaxy.

Figure 10: Analysis of the moderately metal-poor side of the Galactic bulge
GCs. Left panel: $ecc$ vs. $|Z|_{\rm max}$ plane divided into 9 regions named
from A to I. The background density map shows the RPM sample (Queiroz et al.,
2021), the blue dots are the MMP GCs, and the cyan squares are the 58 Galactic
bulge spheroid stars from Razera et al. (2022). NGC 6558 is the green star
symbol. See Pérez-Villegas et al. (2020); Queiroz et al. (2021); Razera et al.
(2022) for the orbital parameters calculations. Right panel: derivation of the
AMR (red line) for the sample of GCs in Table 3 (blue dots), the thin red
lines correspond to the AMR varying the mean parameters within errors. The red
dashed line shows the AMR assuming a chemical enhancement 10 times slower than
the derived for the MMPGCs, while the cyan line is the AMR fitted to the ex-
situ GCs.

In principle, the age-metallicity relation (AMR) of the Galactic bulge MMP GCs
shows they are almost coeval among them (right panel of Figure 10). The grey
dots in the right panel of Figure 10 compose the sample of 96 Galactic GCs
collected by Kruijssen et al. (2019). The authors provide an average age for
all GCs using the three by Forbes & Bridges (2010), Dotter et al. (2010,
2011), and VandenBerg et al. (2013). In order to investigate the old and
spheroidal structure of the inner Galaxy (cell F), we fitted the AMR for the
MMP GCs using the leaky-box formalism often used in the literature (e.g.
Massari et al., 2019; Forbes, 2020; Limberg et al., 2022; Callingham et al.,
2022) with some modifications:

$\displaystyle Z=-\rho\cdot\ln{\left(\frac{t}{t_{f}}\right)}=Z_{\odot}\cdot
10^{\rm[M/H]}$ (4)

where $t_{f}$ is the lookback time when the stellar population starts to form
stars, $Z_{\odot}=0.019$ for the solar total metallicity, and $\rho$ is the
effective yield of the stellar population. The $\rho$ represents the mass
ratio of the new stars formed from the enriched gas expelled from supernovae,
being, therefore, a measure of chemical enrichment efficiency of the stellar
population and is in units of solar total metallicity ($Z_{\odot}$). We are
considering the relation ${\rm[M/H]}={\rm[Fe/H]}+\log_{10}\left(0.694\cdot
10^{\rm[\alpha/Fe]}+0.306\right)$. For the MMP GCs of the Galactic bulge we
assumed ${\rm[\alpha/Fe]}=+0.4$ (Barbuy et al., 2018a) and
${\rm[\alpha/Fe]}=+0.0$ for the ex-situ GCs (Helmi et al., 2018). Therefore:

$\displaystyle t=t_{f}\cdot\exp\left(-\frac{Z_{\odot}}{\rho}\cdot
10^{\rm[Fe/H]+\Delta}\right)\cases{\Delta}=0.312&\text{for MMPGCs}\\\
\Delta=0.0\text{for ex-situ GCs}{}$ (5)

For the MMP GCs Galactic bulge population (Table 3), we obtained a yield
$\rho=0.051\pm 0.014\,\,Z_{\odot}$ and $t_{f}=13.623\pm 0.196$ Gyr. The
derived $t_{f}$ value indicates that this population is among the oldest ones
in the Galaxy since their formation time is close to the age of the Universe
of $13.799\pm 0.021$ Gyr (Planck Collaboration et al., 2016). To investigate
the derived effective yield, we also fitted the ex-situ branch of the AMR. The
result is the cyan solid line in the right panel of Figure 10 with
$\rho=0.007\pm 0.009\,\,Z_{\odot}$ and $t_{f}=13.083\pm 0.124$ Gyr. The
effective yield is approximately $8$ times smaller than the value derived for
the MMP GCs. In the right panel of Figure 10, we also present as a red dashed
line the AMR with an effective yield 10 times smaller than the MMP GCs and
with the same $t_{f}$. It indicates that the spheroidal structure of the inner
Galaxy represented by cell F was formed at the beginning of the Galaxy at
$13.623\pm 0.196$ Gyr ago and has been chemically enriched approximately ten
times faster than the rest of the Galaxy (Barbuy et al., 2018a).

##  7 Conclusions

We have used high-quality photometric data from Gemini-South/GSAOI and HST/ACS
to derive the parameters distance, reddening, total-to-selective coefficient
and age for the Galactic bulge globular cluster NGC 6558. For the isochrone
fitting, the metallicity from high-resolution spectroscopy and the apparent
magnitude level of RR Lyrae were adopted as priors.

We demonstrated the importance of the adopted sample of stars in determining
the fiducial line for the differential reddening correction. In the NGC 6558
case, when background Galactic bulge field stars contaminate the sample, the
isochrone fitting results in a lower RV and higher extinction, compatible with
including Galactic bulge field stars behind a dust lane. Contrarily, removing
the Galactic bulge field stars, the results are more compatible with the
Galactic latitude of the cluster. The combination of near-infrared and optical
data allowed the estimation of the total-to-selective coefficient as R${}_{\rm
V}=3.2\pm 0.2$ once a fiducial line based on cluster stars with less
contribution of field stars was adopted.

The distance of d⊙ = 8.41${}^{+0.11}_{-0.10}$ kpc obtained is farther than any
other in the literature, exemplifying the difficulties for deriving distance
values in the literature, even in the _Gaia_ era, due to the high reddening in
the Galactic bulge (see also Vasiliev & Baumgardt, 2021). The reddening of
E($B-V$)$=0.34\pm 0.02$ is the lowest value relative to the literature,
obtained with the differential reddening correction based on reference stars
less contaminated by field stars. The age of 13.0$\pm$0.9 Gyr obtained is
compatible with the similarly MMP Galactic bulge clusters listed in Table 3.

Finally, combining NGC 6558 with the other MMP GCs of the Galactic bulge
located within the spheroidal inner structure (cell F in $ecc$ vs. $|Z|_{\rm
max}$ plane), we obtained a steep asymptotic trend indicating that the
formation time of this population is as late as $13.62$ Gyr and with a
chemical enrichment ten times faster than the rest of the MW, making clear
that this family of clusters includes the oldest objects in the Galaxy.

###### Acknowledgements.

The authors are grateful to the anonymous referee for his/her suggestions and
remarks, which greatly improved the paper. SOS acknowledges a FAPESP PhD
fellowship no. 2018/22044-3. APV and SOS acknowledge the DGAPA–PAPIIT grant
IA103224. SO acknowledges the support of the University of Padova, DOR
Ortolani 2020, Piotto 2021 and Piotto 2022, Italy and funded by the European
Union – NextGenerationEU” RRF M4C2 1.1 n: 2022HY2NSX. ”CHRONOS: adjusting the
clock(s) to unveil the CHRONO-chemo-dynamical Structure of the Galaxy” (PI: S.
Cassisi). BB and EB acknowledge partial financial support from FAPESP, CNPq
and CAPES - Financial code 001. B.D. acknowledges support by ANID-FONDECYT
iniciación grant No. 11221366 and from the ANID Basal project FB210003. L.O.K.
acknowledges partial financial support by CNPq (proc. 313843/2021-0) and UESC
(proc. 073.6766.2019.0013905-48). This research is based on observations made
with the NASA/ESA _Hubble_ Space Telescope obtained from the Space Telescope
Science Institute, which is operated by the Association of Universities for
Research in Astronomy, Inc., under NASA contract NAS 5–26555. The HST
observations are associated with programs GO-9799 (PI: Rich) and GO-15065 (PI:
Cohen). Based on observations obtained at the international Gemini
Observatory, a program of NSF NOIRLab, which is managed by the Association of
Universities for Research in Astronomy (AURA) under a cooperative agreement
with the U.S. National Science Foundation on behalf of the Gemini Observatory
partnership: the U.S. National Science Foundation (United States), National
Research Council (Canada), Agencia Nacional de Investigación y Desarrollo
(Chile), Ministerio de Ciencia, Tecnología e Innovación (Argentina),
Ministério da Ciência, Tecnologia, Inovações e Comunicações (Brazil), and
Korea Astronomy and Space Science Institute (Republic of Korea). The Gemini
observations are associated with the program GS-2020A-Q-121 (PI: L. Kerber).

## References

  * Allen et al. (2006) Allen, C., Moreno, E., & Pichardo, B. 2006, ApJ, 652, 1150
  * Alonso-García et al. (2012) Alonso-García, J., Mateo, M., Sen, B., et al. 2012, AJ, 143, 70
  * Anderson & van der Marel (2010) Anderson, J. & van der Marel, R. P. 2010, ApJ, 710, 1032
  * Astropy Collaboration et al. (2022) Astropy Collaboration, Price-Whelan, A. M., Lim, P. L., et al. 2022, ApJ, 935, 167
  * Barbuy et al. (2021a) Barbuy, B., Cantelli, E., Muniz, L., et al. 2021a, A&A, 654, A29
  * Barbuy et al. (2016) Barbuy, B., Cantelli, E., Vemado, A., et al. 2016, A&A, 591, A53
  * Barbuy et al. (2018a) Barbuy, B., Chiappini, C., & Gerhard, O. 2018a, ARA&A, 56, 223
  * Barbuy et al. (2021b) Barbuy, B., Ernandes, H., Souza, S. O., et al. 2021b, A&A, 648, A16
  * Barbuy et al. (2018b) Barbuy, B., Muniz, L., Ortolani, S., et al. 2018b, A&A, 619, A178
  * Barbuy et al. (2007) Barbuy, B., Zoccali, M., Ortolani, S., et al. 2007, AJ, 134, 1613
  * Baumgardt & Hilker (2018) Baumgardt, H. & Hilker, M. 2018, MNRAS, 478, 1520
  * Baumgardt et al. (2020) Baumgardt, H., Sollima, A., & Hilker, M. 2020, PASA, 37, e046
  * Baumgardt & Vasiliev (2021) Baumgardt, H. & Vasiliev, E. 2021, MNRAS, 505, 5957
  * Bellini et al. (2017) Bellini, A., Anderson, J., Bedin, L. R., et al. 2017, ApJ, 842, 6
  * Belokurov et al. (2018) Belokurov, V., Erkal, D., Evans, N. W., Koposov, S. E., & Deason, A. J. 2018, MNRAS, 478, 611
  * Belokurov & Kravtsov (2024) Belokurov, V. & Kravtsov, A. 2024, MNRAS, 528, 3198
  * Bica et al. (2016) Bica, E., Ortolani, S., & Barbuy, B. 2016, PASA, 33, e028
  * Bica et al. (2024) Bica, E., Ortolani, S., Barbuy, B., & Oliveira, R. A. P. 2024, A&A, 687, A201
  * Bland-Hawthorn & Gerhard (2016) Bland-Hawthorn, J. & Gerhard, O. 2016, ARA&A, 54, 529
  * Bovy et al. (2019) Bovy, J., Leung, H. W., Hunt, J. A. S., et al. 2019, MNRAS, 490, 4740
  * Callingham et al. (2022) Callingham, T. M., Cautun, M., Deason, A. J., et al. 2022, MNRAS, 513, 4107
  * Cardelli et al. (1989) Cardelli, J. A., Clayton, G. C., & Mathis, J. S. 1989, ApJ, 345, 245
  * Carretta et al. (2009) Carretta, E., Bragaglia, A., Gratton, R., D’Orazi, V., & Lucatello, S. 2009, A&A, 508, 695
  * Chabrier (2003) Chabrier, G. 2003, PASP, 115, 763
  * Chun et al. (2010) Chun, S. H., Kim, J. W., Shin, I. G., et al. 2010, A&A, 518, A15
  * Clement et al. (2001) Clement, C. M., Muzzin, A., Dufton, Q., et al. 2001, AJ, 122, 2587
  * Cohen et al. (2021) Cohen, R. E., Bellini, A., Casagrande, L., et al. 2021, AJ, 162, 228
  * Davidge et al. (2004) Davidge, T. J., Ledlow, M., & Puxley, P. 2004, AJ, 128, 300
  * Debattista et al. (2017) Debattista, V. P., Ness, M., Gonzalez, O. A., et al. 2017, MNRAS, 469, 1587
  * Dias et al. (2016) Dias, B., Barbuy, B., Saviane, I., et al. 2016, A&A, 590, A9
  * Dias et al. (2015) Dias, B., Barbuy, B., Saviane, I., et al. 2015, A&A, 573, A13
  * Dotter et al. (2008) Dotter, A., Chaboyer, B., Jevremović, D., et al. 2008, ApJS, 178, 89
  * Dotter et al. (2011) Dotter, A., Sarajedini, A., & Anderson, J. 2011, ApJ, 738, 74
  * Dotter et al. (2010) Dotter, A., Sarajedini, A., Anderson, J., et al. 2010, ApJ, 708, 698
  * Ernandes et al. (2019) Ernandes, H., Dias, B., Barbuy, B., et al. 2019, A&A, 632, A103
  * Fernández-Trincado et al. (2021) Fernández-Trincado, J. G., Beers, T. C., Minniti, D., et al. 2021, A&A, 647, A64
  * Fernández-Trincado et al. (2020) Fernández-Trincado, J. G., Minniti, D., Beers, T. C., et al. 2020, A&A, 643, A145
  * Fernández-Trincado et al. (2019) Fernández-Trincado, J. G., Zamora, O., Souto, D., et al. 2019, A&A, 627, A178
  * Forbes (2020) Forbes, D. A. 2020, MNRAS, 493, 847
  * Forbes & Bridges (2010) Forbes, D. A. & Bridges, T. 2010, MNRAS, 404, 1203
  * Foreman-Mackey et al. (2013) Foreman-Mackey, D., Hogg, D. W., Lang, D., & Goodman, J. 2013, PASP, 125, 306
  * Fragkoudi et al. (2020) Fragkoudi, F., Grand, R. J. J., Pakmor, R., et al. 2020, MNRAS, 494, 5936
  * Gaia Collaboration et al. (2018a) Gaia Collaboration, Brown, A. G. A., Vallenari, A., et al. 2018a, A&A, 616, A1
  * Gaia Collaboration et al. (2018b) Gaia Collaboration, Helmi, A., van Leeuwen, F., et al. 2018b, A&A, 616, A12
  * Garro et al. (2023) Garro, E. R., Fernández-Trincado, J. G., Minniti, D., et al. 2023, A&A, 669, A136
  * Garro et al. (2024) Garro, E. R., Minniti, D., & Fernández-Trincado, J. G. 2024, A&A, 687, A214
  * Geisler et al. (2023) Geisler, D., Parisi, M. C., Dias, B., et al. 2023, A&A, 669, A115
  * Geisler et al. (2021) Geisler, D., Villanova, S., O’Connell, J. E., et al. 2021, A&A, 652, A157
  * González-Díaz et al. (2023) González-Díaz, D., Fernández-Trincado, J. G., Villanova, S., et al. 2023, MNRAS, 526, 6274
  * Harris (1996) Harris, W. E. 1996, AJ, 112, 1487
  * Hazen (1996) Hazen, M. L. 1996, AJ, 111, 1184
  * Helmi et al. (2018) Helmi, A., Babusiaux, C., Koppelman, H. H., et al. 2018, Nature, 563, 85
  * Hendricks et al. (2012) Hendricks, B., Stetson, P. B., VandenBerg, D. A., & Dall’Ora, M. 2012, AJ, 144, 25
  * Horta et al. (2021) Horta, D., Schiavon, R. P., Mackereth, J. T., et al. 2021, MNRAS, 500, 1385
  * Kerber et al. (2019) Kerber, L. O., Libralato, M., Souza, S. O., et al. 2019, MNRAS, 484, 5530
  * Kerber et al. (2018) Kerber, L. O., Nardiello, D., Ortolani, S., et al. 2018, ApJ, 853, 15
  * Kharchenko et al. (2016) Kharchenko, N. V., Piskunov, A. E., Schilbach, E., Röser, S., & Scholz, R. D. 2016, A&A, 585, A101
  * Kruijssen et al. (2020) Kruijssen, J. M. D., Pfeffer, J. L., Chevance, M., et al. 2020, MNRAS, 498, 2472
  * Kruijssen et al. (2019) Kruijssen, J. M. D., Pfeffer, J. L., Reina-Campos, M., Crain, R. A., & Bastian, N. 2019, MNRAS, 486, 3180
  * Libralato et al. (2022) Libralato, M., Bellini, A., Vesperini, E., et al. 2022, ApJ, 934, 150
  * Libralato et al. (2021) Libralato, M., Lennon, D. J., Bellini, A., et al. 2021, MNRAS, 500, 3213
  * Limberg et al. (2022) Limberg, G., Souza, S. O., Pérez-Villegas, A., et al. 2022, ApJ, 935, 109
  * Maia et al. (2010) Maia, F. F. S., Corradi, W. J. B., & Santos, J. F. C., J. 2010, MNRAS, 407, 1875
  * Martínez-Vázquez et al. (2021) Martínez-Vázquez, C. E., Cerny, W., Vivas, A. K., et al. 2021, AJ, 162, 253
  * Massari et al. (2019) Massari, D., Koppelman, H. H., & Helmi, A. 2019, A&A, 630, L4
  * McMillan (2017) McMillan, P. J. 2017, MNRAS, 465, 76
  * Meissner & Weiss (2006) Meissner, F. & Weiss, A. 2006, A&A, 456, 1085
  * Milone et al. (2012) Milone, A. P., Marino, A. F., Cassisi, S., et al. 2012, ApJ, 754, L34
  * Minniti et al. (2014) Minniti, D., Saito, R. K., Gonzalez, O. A., et al. 2014, A&A, 571, A91
  * Moreno et al. (2022) Moreno, E., Fernández-Trincado, J. G., Pérez-Villegas, A., Chaves-Velasquez, L., & Schuster, W. J. 2022, MNRAS, 510, 5945
  * Nardiello et al. (2018) Nardiello, D., Libralato, M., Piotto, G., et al. 2018, MNRAS, 481, 3382
  * Nataf (2016) Nataf, D. M. 2016, PASA, 33, e024
  * Nepal et al. (2024) Nepal, S., Chiappini, C., Guiglion, G., et al. 2024, A&A, 681, L8
  * Nogueras-Lara et al. (2023a) Nogueras-Lara, F., Feldmeier-Krause, A., Schödel, R., et al. 2023a, A&A, 680, A75
  * Nogueras-Lara et al. (2023b) Nogueras-Lara, F., Schultheis, M., Najarro, F., et al. 2023b, A&A, 671, L10
  * Oliveira et al. (2022) Oliveira, R. A. P., Ortolani, S., Barbuy, B., et al. 2022, A&A, 657, A123
  * Oliveira et al. (2020) Oliveira, R. A. P., Souza, S. O., Kerber, L. O., et al. 2020, ApJ, 891, 37
  * Oosterhoff (1939) Oosterhoff, P. T. 1939, The Observatory, 62, 104
  * Oosterhoff (1944) Oosterhoff, P. T. 1944, Bull. Astron. Inst. Netherlands, 10, 55
  * Ortolani et al. (2019) Ortolani, S., Held, E. V., Nardiello, D., et al. 2019, A&A, 627, A145
  * Pallanca et al. (2021) Pallanca, C., Lanzoni, B., Ferraro, F. R., et al. 2021, ApJ, 913, 137
  * Pérez-Villegas et al. (2020) Pérez-Villegas, A., Barbuy, B., Kerber, L. O., et al. 2020, MNRAS, 491, 3251
  * Pérez-Villegas et al. (2017) Pérez-Villegas, A., Portail, M., & Gerhard, O. 2017, MNRAS, 464, L80
  * Pérez-Villegas et al. (2018) Pérez-Villegas, A., Rossi, L., Ortolani, S., et al. 2018, PASA, 35, e021
  * Pichardo et al. (2004) Pichardo, B., Martos, M., & Moreno, E. 2004, ApJ, 609, 144
  * Pietrinferni et al. (2021) Pietrinferni, A., Hidalgo, S., Cassisi, S., et al. 2021, ApJ, 908, 102
  * Pinna et al. (2024) Pinna, F., Walo-Martín, D., Grand, R. J. J., et al. 2024, A&A, 683, A236
  * Piotto et al. (1999) Piotto, G., Zoccali, M., King, I. R., et al. 1999, AJ, 117, 264
  * Planck Collaboration et al. (2016) Planck Collaboration, Ade, P. A. R., Aghanim, N., et al. 2016, A&A, 594, A13
  * Portail et al. (2017) Portail, M., Gerhard, O., Wegg, C., & Ness, M. 2017, MNRAS, 465, 1621
  * Prudil et al. (2019a) Prudil, Z., Dékány, I., Catelan, M., et al. 2019a, MNRAS, 484, 4833
  * Prudil et al. (2019b) Prudil, Z., Dékány, I., Grebel, E. K., et al. 2019b, MNRAS, 487, 3270
  * Queiroz et al. (2020) Queiroz, A. B. A., Anders, F., Chiappini, C., et al. 2020, A&A, 638, A76
  * Queiroz et al. (2021) Queiroz, A. B. A., Chiappini, C., Perez-Villegas, A., et al. 2021, A&A, 656, A156
  * Razera et al. (2022) Razera, R., Barbuy, B., Moura, T. C., et al. 2022, MNRAS, 517, 4590
  * Rich et al. (1998) Rich, R. M., Ortolani, S., Bica, E., & Barbuy, B. 1998, AJ, 116, 1295
  * Rossi et al. (2015) Rossi, L. J., Ortolani, S., Barbuy, B., Bica, E., & Bonfanti, A. 2015, MNRAS, 450, 3270
  * Saviane et al. (2012) Saviane, I., Da Costa, G. S., Held, E. V., et al. 2012, A&A, 540, A27
  * Schönrich et al. (2010) Schönrich, R., Binney, J., & Dehnen, W. 2010, MNRAS, 403, 1829
  * Skrutskie et al. (2006) Skrutskie, M. F., Cutri, R. M., Stiening, R., et al. 2006, AJ, 131, 1163
  * Sormani et al. (2022) Sormani, M. C., Sanders, J. L., Fritz, T. K., et al. 2022, MNRAS, 512, 1857
  * Soszyński et al. (2014) Soszyński, I., Udalski, A., Szymański, M. K., et al. 2014, Acta Astron., 64, 177
  * Souza et al. (2023) Souza, S. O., Ernandes, H., Valentini, M., et al. 2023, A&A, 671, A45
  * Souza et al. (2020) Souza, S. O., Kerber, L. O., Barbuy, B., et al. 2020, ApJ, 890, 38
  * Souza et al. (2021) Souza, S. O., Valentini, M., Barbuy, B., et al. 2021, A&A, 656, A78
  * Tremmel et al. (2013) Tremmel, M., Fragos, T., Lehmer, B. D., et al. 2013, ApJ, 766, 19
  * VandenBerg et al. (2013) VandenBerg, D. A., Brogaard, K., Leaman, R., & Casagrande, L. 2013, ApJ, 775, 134
  * Vasiliev (2019) Vasiliev, E. 2019, MNRAS, 482, 1525
  * Vasiliev & Baumgardt (2021) Vasiliev, E. & Baumgardt, H. 2021, MNRAS, 505, 5978
  * Vásquez et al. (2018) Vásquez, S., Saviane, I., Held, E. V., et al. 2018, A&A, 619, A13
  * Villanova et al. (2017) Villanova, S., Moni Bidin, C., Mauro, F., Munoz, C., & Monaco, L. 2017, MNRAS, 464, 2730
  * White & Frenk (1991) White, S. D. M. & Frenk, C. S. 1991, ApJ, 379, 52
  * White & Rees (1978) White, S. D. M. & Rees, M. J. 1978, MNRAS, 183, 341
  * Wylie et al. (2022) Wylie, S. M., Clarke, J. P., & Gerhard, O. E. 2022, A&A, 659, A80
  * Zoccali et al. (2008) Zoccali, M., Hill, V., Lecureur, A., et al. 2008, A&A, 486, 177

##  Appendix A Corner-plots

In this section we show the corner-plots for the simultaneous isochrone
fitting. The binary fractions are different for each CMD: $n_{a}$ for the NIR
and $n_{b}$ for the HST CMDs. In Figure 11, the upper panel shows the results
for DRCFL1 and bottom panel for DRCFL2. The corner-plots are an important
diagnostical too to visualize the behaviour of the McMC and the correlations
among the parameter as well.

Figure 11: Corner-plots with the results for the isochrone fitting using
DRCFL1 (upper panel) and DRCFL2 (bottom panel). The characteristic values are
composed of the median and the 16 and 84 percentiles of the distributions.


# SenAOReFoc: A Closed-Loop Sensorbased Adaptive Optics and Remote Focusing
Control Software

Jiahe Cui
Department of Engineering Science
University of Oxford
Parks Road, Oxford, OX1 3PJ, UK
<EMAIL_ADDRESS>Karen M. Hampson
Department of Engineering Science
University of Oxford
Parks Road, Oxford, OX1 3PJ, UK
<EMAIL_ADDRESS>Matthew Wincott
Department of Engineering Science
University of Oxford
Parks Road, Oxford, OX1 3PJ, UK
<EMAIL_ADDRESS>Martin J. Booth
Department of Engineering Science
University of Oxford
Parks Road, Oxford, OX1 3PJ, UK
<EMAIL_ADDRESS>
###### Abstract

SenAOReFoc is a closed-loop sensorbased adaptive optics (AO) and remote
focusing control software that works with a deformable mirror (DM) and a
Shack-Hartmann wavefront sensor (SHWS). It is programmed in Python and is
open-source on Github https://github.com/jiahecui/SenAOReFoc. A detailed user
guide can be found in the Github repository. Here, we give a brief summary of
basic software functionalities, a statement of need, and some examples for the
usage of this software.

_K_ eywords adaptive optics $\cdot$ closed-loop $\cdot$ sensorbased $\cdot$
remote focusing $\cdot$ control software

##  1 Summary

SenAOReFoc is a closed-loop sensorbased adaptive optics (AO) and remote
focusing control software that works with a deformable mirror (DM) and a
Shack-Hartmann wavefront sensor (SHWS). It provides a user-friendly graphic
user interface (GUI) with modular widget arrangements and clear labelling to
help the user navigate through different software functionalities. Interactive
messages are also displayed from the GUI for user guidance.

SenAOReFoc consists of 5 main units, the SHWS initialisation and DM
calibration unit, the Zernike aberration input unit, the AO control and data
collection unit, the miscellaneous control unit, and the remote focusing unit,
as shown in Figure 1. The software can be ran in either ‘debug mode’ to
perform functionality tests without connected hardware (DM and SHWS), or
‘standard mode’ on a well-aligned optical sectioning microscope (confocal,
multiphoton, etc.). User controllable system parameters can be freely accessed
and modified in a separate configuration file that is loaded upon software
initialisation, and parameters that require continuous user input can be
modified from the GUI. Parameters calculated when running the software, as
well as important result data, are grouped and saved in a separate HDF5 file
that can be read with HDFView software. Automated AO performance
characterisations can be performed in ‘standard mode’ to assess the correction
ability of the optical system. If the adopted DM is designed with a large
stroke, i.e., is capable of large deformations, both the closed-loop AO
correction and remote focusing functionalities can be exploited. On the other
hand, if the DM exhibits insufficient stroke for remote focusing, by ignoring
the remote focusing unit, closed-loop AO correction functionalities will still
be fully functional without additional modifications to the software.

Closed-loop AO correction can be performed using both the zonal method, which
updates DM control voltages in terms of the raw slope values; and the modal
method, which updates DM control voltages in terms of orthogonal Zernike
polynomials. There are four sub-modes tagged to each of the two methods: 1)
standard closed-loop AO correction; 2) closed-loop AO correction with
consideration of obscured search blocks; 3) closed-loop AO correction with
partial correction excluding defocus; and 4) closed-loop AO correction with
both consideration of obscured search blocks and partial correction excluding
defocus.

Remote focusing can be performed by scanning the focus axially with a pre-
determined axial range, step increment and step number, or by manually
adjusting a toggle bar on the GUI for random access remote focusing. The
former also incorporates options of whether or not to perform closed-loop AO
correction at each remote focusing depth.

Figure 1: Graphic user interface (GUI) of SenAOReFoc with modular units
labelled in red boxes.

##  2 Statement of need

The performance of optical microscopes degrades significantly in the presence
of optical aberrations that develop due to misalignments in the optical system
and inhomogeneities in refractive index of the imaging sample. This results in
compromised image resolution and contrast. Adaptive optics (AO) is a powerful
technique that corrects for optical aberrations using reconfigurable adaptive
devices, such as a deformable mirror (DM) or spatial light modulator (SLM), to
restore the image quality [1]. This is most crucial for high-quality imaging,
such as super-resolution or deep imaging.

Remote focusing is an axial scanning technique recently introduced to avoid
slow movements of the sample stage and objective lens during real-time
applications [2]. By using a DM for remote focusing, calibration can be
performed through closed-loop AO correction to simultaneously correct for
system aberrations introduced by beam divergence at different focusing depths
[3]

Sensorbased AO, which uses a dedicated sensor to measure the wavefront [4],
was first introduced in the field of astronomy [5]. Since then, it has also
been widely adopted in vision science [6, 7] and microscopy [8, 9]. A range of
software serving for different astronomical purposes have been introduced over
time, including those for simulation of AO systems [10, 11], control with
atmospheric tomography [12], and fast control using GPU hardware [13]. In the
microscopy community, software is also openly available for AO modelling and
analysis [14], as well as general AO control [15]. However, there is not yet
an existing open-source software that serves the purpose of performing both AO
and remote focusing within the single package, despite that the techniques
have been widely adopted. As a result, time and effort has to be spent
reimplementing existing techniques for different hardware systems.

SenAOReFoc aims to fill this gap and to make closed-loop sensorbased AO [16]
and remote focusing more easily accessible to the microscopy community. It has
been designed for open development and easy integration into existing adaptive
optical microscopes with a simple and user-friendly architecture. The
functionality of the software has also been tested on different operating
systems (Windows/macOS/Linux) for sake of generality. However, we note that
SenAOReFoc is a control software, and the performance of the closed-loop AO
correction in practice is inevitably dependent on the state of the optical
system. Finally, SenAOReFoc takes care of some reported issues in the field,
such as the thermal effects of electromagnetic DMs [17], and obscured search
blocks in the case of severely distorted pupils [18, 19, 20].

##  3 Example usage

Four examples are given for the usage of this software, the first three for
automated AO performance characterisations of the reflectance confocal
microscope described in [21, 22]; and the last for remote focusing in frozen
mouse skull as reported in [21].

Figure 2: Characterisation results of system AO correction performance. (a)
Dynamic range of the SHWS for Zernike modes 3-20 (excl. tip/tilt). (b)-(e)
Generated and detected RMS amplitudes of odd/even Zernike modes (b) 5, (c) 7,
(d) 12, and (e) 20, in increments of 0.02 micrometers. 5 tests were performed
for each measurement.

Example 1: The dynamic range of the SHWS for the first N Zernike modes can be
characterised by generating and correcting for them in closed-loop using mode
0/1 of [Data Collection]. Figure 2(a) provides an example when characterising
Zernike modes 3-20 (excl. tip/tilt). Figure 2(b)-(e) provide examples of
generated and detected RMS amplitudes of selected odd/even Zernike modes in
increments of 0.02 micrometers. Parameters in `config.yaml` under `AO` and
`data_collect` were set as follows.

    AO:
    control_coeff_num:20#NumberofzernikemodestocontrolduringAOcorrection

    data_collect:
    data_collect_mode:1#ModeflagforDataCollectionbutton,detailedfunction
                            descriptionsinapp.py
    loop_max_gen:15#Maximumnumberofloopsduringclosed-loopgenerationofzernike
                        modesinmode0/1/2/3
    incre_num:15#Numberofzernikemodeamplitudestogenerateinmode0/1
    incre_amp:0.02#Incrementamplitudebetweenzernikemodesinmode0/1
    run_num:5#Numberoftimestorunmode0/1/2/3

Example 2: The degree of Zernike mode coupling upon detection at the SHWS can
be characterised by individually generating the same amount of each mode on
the DM and constructing a heatmap of the detected Zernike coefficients using
mode 0/1 of [Data Collection]. Figure 3 provides an example heatmap of
correlation coefficients between detected and generated mode values for 0.1
micrometers of Zernike modes 3-20 (excl. tip/tilt). Parameters in
`config.yaml` under `data_collect` were set as follows.

    data_collect:
    data_collect_mode:1#ModeflagforDataCollectionbutton,detailedfunction
                            descriptionsinapp.py
    loop_max_gen:15#Maximumnumberofloopsduringclosed-loopgenerationofzernike
                        modesinmode0/1/2/3
    incre_num:1#Numberofzernikemodeamplitudestogenerateinmode0/1
    incre_amp:0.1#Incrementamplitudebetweenzernikemodesinmode0/1
    run_num:5#Numberoftimestorunmode0/1/2/3

Figure 3: Heatmap of correlation coefficients between detected and generated
mode values for 0.1 micrometers of Zernike modes 3-20 (excl. tip/tilt).

Example 3: To ensure the system can correct for multiple Zernike modes with
good stability and minimal mode coupling, different combinations of odd and
even Zernike modes can be generated and corrected for in closed-loop using
mode 2/3 of [Data Collection]. Figure 4 provides an example of the detect
amplitude and Strehl ratio after each closed-loop iteration for some odd and
even Zernike mode combinations. Parameters in `config.yaml` under
`data_collect` were set as follows.

    data_collect:
    data_collect_mode:3#ModeflagforDataCollectionbutton,detailedfunction
                            descriptionsinapp.py
    loop_max_gen:15#Maximumnumberofloopsduringclosed-loopgenerationofzernike
                        modesinmode0/1/2/3
    run_num:5 #Numberoftimestorunmode0/1/2/3

And [Zernike array edit box] was set to [0 0 0 0 0.1 0 0.1 0 0 0 0 0.1 0 0 0 0
0 0 0 0.1].

Figure 4: Detected amplitudes of generated odd and even Zernike mode
combinations and Strehl ratio calculated using first 69 Zernike modes (excl.
tip/tilt) after each closed-loop iteration. 5 tests were performed for each
measurement. Figure 5: Remote focusing results within frozen mouse skull. (a)
Stack images acquired with 10 micrometer axial steps over a 90 micrometer
depth range. Top rows: results obtained by scanning sequentially through
multiple depths using pre-calibrated DM control voltages. Bottom rows:
comparison results obtained by axially translating the sample stage only. (b)
Colour-coded maximum intensity projection of 90 frames with 1 micrometer
intervals. Scale bar: 100 micrometers.

Example 4: Voltages that control DM actuators to deform the membrane for fine
axial remote focusing was calibrated according to the procedure explained in
the GitHub repository https://github.com/jiahecui/SenAOReFoc, and reported in
[21]and [22]. [Calibrate] was pressed for both directions of the optical axis
and a piece of white card was displaced by 10 micrometers each time before
pressing `y` on the keyboard to proceed with closed-loop AO correction.
Interpolation of the DM control voltages at each calibration step was then
performed to obtain those for 0.1 micrometer increments. The software’s remote
focusing capability was demonstrated in frozen mouse skull in [21] to show no
noticeable difference in resolution and size of field of view as compared to
standard translation of the sample stage. Results are also shown in Figure 5.

## Acknowledgements

We thank Chao He for testing the software functionality using different
operating systems. This work was supported by European Research Council
projects 695140 and 812998.

## References

  * [1] M. J. Booth, “Adaptive optical microscopy: the ongoing quest for a perfect image,” Light: Science & Applications, vol. 3, p. e165, 2014.
  * [2] N. Ji, J. Freeman, and S. L. Smith, “Technologies for imaging neural activity in large volumes,” Nature Neuroscience, vol. 19, p. 1154, 2016.
  * [3] M. Žurauskas, O. Barnstedt, M. Frade-Rodriguez, S. Waddell, and M. J. Booth, “Rapid adaptive remote focusing microscope for sensing of volumetric neural activity,” Biomedical Optics Express, vol. 8, no. 10, pp. 4369–4379, 2017\.
  * [4] B. C. Platt and R. Shack, “History and principles of shack-hartmann wavefront sensing,” Journal of Refractive Surgery, vol. 17, no. 5, pp. S573–S577, 2001.
  * [5] J. M. Beckers, “Adaptive optics for astronomy: principles, performance, and applications,” Annual review of astronomy and astrophysics, vol. 31, no. 1, pp. 13–62, 1993.
  * [6] J. Porter, H. Queener, J. Lin, K. Thorn, and A. A. Awwal, Adaptive optics for vision science: Principles, practices, design, and applications, vol. 171.  John Wiley & Sons, 2006.
  * [7] P. Godara, A. M. Dubis, A. Roorda, J. L. Duncan, and J. Carroll, “Adaptive optics retinal imaging: emerging clinical applications,” Optometry and vision science : official publication of the American Academy of Optometry, vol. 87, no. 12, pp. 930–941, 2010.
  * [8] M. J. Booth, “Adaptive optics in microscopy,” Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences, vol. 365, no. 1861, pp. 2829–2843, 2007.
  * [9] N. Ji, “Adaptive optical fluorescence microscopy,” Nature Methods, vol. 14, p. 374, 2017.
  * [10] M. Carbillet, C. Vérinaud, B. Femenía, A. Riccardi, and L. Fini, “Modelling astronomical adaptive optics - i. the software package caos,” Monthly Notices of the Royal Astronomical Society, vol. 356, no. 4, pp. 1263–1275, 2005\.
  * [11] R. Conan and C. Correia, “Object-oriented matlab adaptive optics toolbox,” in SPIE Astronomical Telescopes + Instrumentation, vol. 9148, SPIE, 2014.
  * [12] A. Ahmadia and B. Ellerbroek, “A software framework for fast adaptive optics control with atmospheric tomography,” in Adaptive Optics: Analysis and Methods/Computational Optical Sensing and Imaging/Information Photonics/Signal Recovery and Synthesis Topical Meetings on CD-ROM, Technical Digest, p. AThB4, Optical Society of America, 2005.
  * [13] O. Guyon, A. Sevin, D. Gratadour, J. Bernard, H. Ltaief, D. Sukkari, S. Cetre, N. Skaf, J. Lozi, F. Martinache, C. Clergeon, B. Norris, A. Wong, and J. Males, “The compute and control for adaptive optics (cacao) real-time control software package,” in SPIE Astronomical Telescopes + Instrumentation, vol. 10703, SPIE, 2018.
  * [14] M. J. Townson, O. J. D. Farley, G. Orban de Xivry, J. Osborn, and A. P. Reeves, “Aotools: a python package for adaptive optics modelling and analysis,” Optics Express, vol. 27, no. 22, pp. 31316–31329, 2019.
  * [15] N. Hall, J. Titlow, M. J. Booth, and I. M. Dobbie, “Microscope-aotools: a generalised adaptive optics implementation,” Optics Express, vol. 28, no. 20, pp. 28987–29003, 2020.
  * [16] E. J. Fernández, I. Iglesias, and P. Artal, “Closed-loop adaptive optics in the human eye,” Optics Letters, vol. 26, no. 10, pp. 746–748, 2001.
  * [17] U. Bitenc, “Software compensation method for achieving high stability of alpao deformable mirrors,” Optics Express, vol. 25, no. 4, pp. 4368–4381, 2017\.
  * [18] B. Dong and M. J. Booth, “Wavefront control in adaptive microscopy using shack-hartmann sensors with arbitrarily shaped pupils,” Optics Express, vol. 26, no. 2, pp. 1655–1669, 2018.
  * [19] J. Ye, W. Wang, Z. Gao, Z. Liu, S. Wang, P. Benítez, J. C. Miñano, and Q. Yuan, “Modal wavefront estimation from its slopes by numerical orthogonal transformation method over general shaped aperture,” Optics Express, vol. 23, no. 20, pp. 26208–26220, 2015.
  * [20] J. Cui, B. Dong, and M. J. Booth, Shack-Hartmann sensing with arbitrarily shaped pupil, 2020.
  * [21] J. Cui, R. Turcotte, K. Hampson, N. J. Emptage, and M. J. Booth, “Remote-focussing for volumetric imaging in a contactless and label-free neurosurgical microscope,” in Biophotonics Congress 2021, OSA Technical Digest, p. DTh2A.2, Optical Society of America, 2021.
  * [22] J. Cui, R. Turcotte, N. J. Emptage, and M. J. Booth, “Extended range and aberration-free autofocusing via remote focusing and sequence-dependent learning,” Optics Express, vol. 29, no. 22, pp. 36660–36674, 2021.