Simultaneous spectroscopic and photometric analysis of galaxies with STARLIGHT: CALIFA $+$ GALEX

We present an extended version of the spectral synthesis code STARLIGHT designed to incorporate both $\lambda$-by-$\lambda$ spectra and photometric fluxes in the estimation of stellar population properties of galaxies. The code is tested with simulations and data for 260 galaxies culled from the CALIFA survey, spatially matching the 3700--7000 \AA\ optical datacubes to GALEX near and far UV images. The sample spans E--Sd galaxies with masses from $10^9$ to $10^{12} M_\odot$ and stellar populations all the way from star-forming to old, passive systems. Comparing results derived from purely optical fits with those which also consider the NUV and FUV data we find that: (1) The new code is capable of matching the input UV data within the errors while keeping the quality of the optical fit essentially unchanged. (2) Despite being unreliable predictors of the UV fluxes, purely optical fits yield stellar population properties which agree well with those obtained in optical+UV fits for nearly 90% of our sample. (3) The addition of UV constraints has little impact on properties such as stellar mass and dust optical depth. Mean stellar ages and metallicities also remain nearly the same for most galaxies, the exception being low-mass, late-type galaxies, which become older and less enriched due to rearrangements of their youngest populations. (4) The revised ages are better correlated with observables such as the 4000 \AA\ break index, and the $NUV - r$ and $u - r$ colours, an empirical indication that the addition of UV constraints helps mitigating the effects of age-metallicity-extinction degeneracies.


INTRODUCTION
Converting photometric or spectroscopic data on galaxies into physical quantities is part of the daily routine in extragalactic work. It is this translation that produces estimates of the mass in stars, their typical ages and metallicities, dust attenuation and other properties which ultimately mould our current understanding of galaxies and their stellar content.
This process works upon data that often consist of multi-band photometry, preferably covering as much of the spectral energy distribution as possible, say GALEX plus SDSS (e.g. Kaviraj et al. 2007a;Salim et al. 2007;Schiminovich et al. 2007;Schawinski et al. 2014) or 2MASS magnitudes (e.g. Barway et al. 2013). Other times the input is E-mail: rafael@iaa.es spectroscopic, such as optical spectra provided by the SDSS. Methods to analyse F λ split into those which reduce F λ to a set of spectral indices (say, Lick indices) and those which attempt to fit it λ-by-λ -see Walcher et al. (2011) for a comprehensive review. Because of the informative nature of absorption and emission lines spectroscopy is in principle more powerful than photometry. Purely spectroscopic studies, however, are invariably limited in λ-coverage, hence limited in the ability to exploit stellar population information encoded over long λ baselines more easily covered with multi-band photometry. To quote a known example which will appear later in this paper, low level ongoing star formation may leave weak/undetectable imprints in the optical continuum of a galaxy while at the same time accounting for most of its UV flux. Clearly, a combined optical + UV analysis would lead to better estimates of a galaxy's star formation history (SFH). This is precisely the goal of this paper.
While tools to retrieve stellar population properties out of multi-band photometry are common in the literature (e.g. the CIGALE code of Noll et al. 2009), methods which mix photometric and spectroscopic information are less common. An example is the work of Schawinski et al. (2007), who model UV to IR photometry in conjunction with Lick indices derived from SDSS spectra. Our goal in this paper is to go a step further and, instead of summarizing the spectroscopic information by a set of indices, combine photometry with a full λ-by-λ analysis.
We develop and test a combined spectroscopic + photometric analysis built upon the full spectral fitting code starlight of Cid Fernandes et al. (2005). The method admits any combination of spectra and photometry, but we focus on the specific case of CALIFA optical spectroscopy (Sánchez et al. 2012) plus GALEX photometry (Martin et al. 2005), a combination which has the key advantage of allowing us to mitigate aperture effects, a serious source of concern in any experiment involving data gathered through different instruments. This 'upgrade' is part of a more ambitious program to include panchromatic constraints in starlight, like far-IR data (to constrain the dust reprocessed luminosity), and recombination emission line fluxes (tracers of the hν > 13.6 eV field) or ratios (sensitive to dust attenuation).
We organize this article as follows. Section 2 describes how to combine spectra and photometry into a single figure of merit to be optimized. This entails both 'philosophical' issues, like how much weight one wishes to attribute to each kind of data, as well as more technical aspects, such as whether the photometry needs to be treated as upper or lower limits due to, say, aperture mismatches with respect to the spectroscopic data. Section 3 presents simulations designed to test the code under realistic circumstances. Section 4 explores an actual application based on a combination of optical spectra from CALIFA data and GALEX fluxes. Section 5 discusses how the addition of UV constraints improves the estimation of ages and metallicities, and the implications for the stellar mass-metallicity relation. Our main results are summarized in Section 6.

METHOD
This section presents the basic formalism used throughout the paper. Our combined spectroscopic + photometric modelling can in principle be applied to any arbitrary combination of data, like a near-IR spectrum plus optical and/or UV photometry, an optical spectrum plus near-IR photometry, etc. For concreteness, the simulations and actual applications explored in later sections focus on the combined analysis of a 3700-7000Å optical spectrum and NUV (∼ 2274 A) plus FUV (∼ 1542Å) photometry from GALEX.

Input data
We describe the spectroscopic data to be fitted in terms of the following elements: (i) The observed spectrum O λ and its error σ(O λ ).
(ii) Mask (mask λ ) and flag (flag λ ) spectra to mark regions to be discarded from the analysis because of emission lines or artifacts (e.g. bad pixels and sky residuals).
(iii) w λ = σ(O λ ) −1 is the weight given to pixel λ. Masked and flagged pixels have w λ = 0. Discounting zero-weight entries one is left with N eff λ fluxes to be fitted. N eff λ is typically of the order of 10 3 .
The photometric data, indexed with a subscript l running from l = 1 to N l filters, consist of (i) The apparent AB magnitude of the object m obs l and its error σ(m obs l ). (ii) The filter transmission curves T l (λ).
The input photometry is corrected for Galactic extinction, but K-corrections are not necessary since we will perform the synthetic photometry in the galaxy's redshift z.

The model
Model predictions for the observed spectroscopic and photometric fluxes are built by a linear combination of spectra from a base B j,λ (j = 1 . . . N ), usually (but not necessarily) drawn from evolutionary synthesis models for simple stellar populations (SSP) of different ages and metallicities. Each base spectrum is first normalized by its value at a chosen reference wavelength λ0 (= 5635Å in this paper). The scaled base spectra are then combined in proportions xj to build a model spectrum M λ given by where b j,λ ≡ B j,λ /B j,λ 0 , r λ is a shorthand for the e −τ V (q λ −q λ 0 ) reddening produced by a foreground screen of dust with an extinction curve q λ = τ λ /τV , and G(v , σ ) denotes a gaussian kinematical kernel centred at velocity v and with dispersion σ . Provided the base spectra cover the wavelengths of our N l filters, Eq. (1) can be used to predict model magnitudes m l m l = −2.5 log where the rest-frame model spectrum M λ is shifted to the observed frame, thus circumventing the need for Kcorrections.

Combining spectroscopic and photometric figures of merit
A purely spectroscopic analysis would consist of, for instance, estimating the model parameters by minimizing as in Cid Fernandes et al. 2005. The analogous photometric figure of merit is which compares model and observed magnitudes. The total χ 2 to be considered in a joint analysis is then simply We have also experimented with other definitions of χ 2 TOT . One might, for instance, want to ensure that the spectroscopic and photometric data be given commensurable weights in the joint analysis. This can be implemented by scaling χ 2 PHO by a factor of ∼ N eff λ /N l (or, equivalently, scaling the observational errors).
Throughout this work we adopt Eq. 5 in its original form. The simulations and real-data applications presented below produced good spectroscopic and photometric fits with no need for ad hoc scaling factors. Such weighting schemes should be more relevant in cases where the observational errors are not well known.

Aperture mismatch: Implementation of photometric constraints as ranges
Another problem to consider when modelling spectra and photometry is that they are often collected through different apertures. The actual applications explored in Section 4 are based on a combination of optical spectra from CALIFA data and GALEX fluxes, whereby the spectra are extracted from the projection of the GALEX aperture on the integral field data cube, thus mitigating aperture effects. Nonetheless, in the interest of completeness and future reference we discuss the 'range-fitting' scheme implemented in the new starlight to deal with aperture uncertainties. Even disregarding spatial variations of the stellar populations, an aperture mismatch implies flux scale differences which make the simultaneous fit of O λ and m l meaningless. Aperture corrections are designed to fix this problem by scaling the input data to a same flux level, yet these are but approximate corrections, subject to systematic uncertainties.
To deal with this issue we introduce a modified version of χ 2 PHO = l χ 2 l where the e −χ 2 l /2 gaussian likelihood of each m obs range are equally acceptable, contributing nothing to the global figure of merit.
A qualitatively similar effect could be obtained by exaggerating the uncertainty in m l beyond its nominal value σ(m l ). We nevertheless prefer the 'range-fitting' recipe outlined above, which has the advantage of expressing in an explicit way the systematic character of uncertainties in matching fluxes from different instruments/telescopes. An added benefit of our formulation is that it allows the incorporation of lower or upper limits in the analysis. Suppose that all we know about the FUV flux in a galaxy is that it is weaker than m upp FUV . One can couple this observational upper limit to an arbitrarily low lower limit and feed this information into our recipe to enforce that the resulting stellar populations will conform to the given upper limit. As shown in Section 3, purely optical studies can easily allow optically insignificant but UV-dominant populations, so that the use of UV limits can be useful.
As mentioned above, our data allow us to match the O λ and m l apertures, so that no range-fitting scheme is necessary. We thus set m low l = m upp l = m obs l , so that the code tries to fit the observed magnitude within its observational error.

Spectral base
The spectral base B j,λ is the key astrophysical ingredient in our analysis, providing the translation of photometric and spectroscopic observables into stellar population properties. In this study we work with a base comprised by N = 246 SSPs with ages from t = 1 Myr to 14 Gyr and metallicities in the Z = 0.005-2.5Z range drawn from a preliminary version of an update to the Bruzual & Charlot (2003) models (G. Bruzual 2007. This same set of models was called base CBe by González Delgado et al. (2015), which describes it more thoroughly. The initial mass function is that of Chabrier (2003).
These models adequately cover all spectral ranges addressed in this study, namely optical and UV. In fact, the requirement of optical-UV coverage eliminates several models available in the literature, including the ones used in our latest starlight-based papers on the stellar populations of CALIFA galaxies (e.g. González Delgado et al. 2015). Cid Fernandes et al. (2014) present a comparative study of optical spectral synthesis results obtained with different spectral bases, including the one used in this paper.
Dust effects are modelled as due to a single effective screen of V-band optical depth τ , and a Calzetti et al. (2000) reddening law. The code does allow one to waive the assumption of a single τ for all populations, but for the sake of simplicity we stick to this assumption in this paper, postponing the exploration of multiple-τ fits to a forthcoming study where recombination emission lines are added as a further constraint on the analysis (Vale Asari et al., in prep.).

SIMULATIONS
As a first test of the new starlight outlined above we carried out a set of controlled experiments whereby the observables of a theoretical galaxy are fitted. The simulations are designed analogously to those in Cid Fernandes et al. (2005), where the original starlight was first tested. The goals here are twofold: (i) To gauge the performance of the code under different levels of signal-to-noise (S/N ), and (ii) to evaluate the practical benefits of a joint UV photometry plus optical spectral analysis in comparison to a purely optical one.

Test galaxies
We generate test galaxies using the parameters (essentially x and τ ) obtained from the analysis of 260 CALIFA galaxies ranging from early to late types, thus spanning a range of physical properties (see Section 4.1.3 and Fig. 4). This strategy has the advantage of ensuring that our test galaxies are both diverse and realistic, while also saving us the trouble of inventing test galaxies with ad hoc descriptions of the SFH.
The observables for these test galaxies, namely the 3700-6800Å optical spectrum O λ and the m obs l (where l = NUV, FUV) magnitudes, were generated from their full synthetic spectra and then perturbed according to where O 0 λ and m 0 l are the original input spectrum and magnitudes, and N (0, 1) is a gaussian deviate of zero mean and unit variance. Five levels of noise were considered: S/N = 5, 10, 20, 50, 100. (The corresponding errors in magnitudes are 0.217, 0.109, 0.054, 0.022 and 0.011, respectively.) Five realizations of the noise were made for each S/N . In total, the test sample consists of 260 × 5 × 5 = 6500 galaxies.
To emulate actual fits inasmuch as possible we masked regions around the main emission lines, including the whole Balmer series up to H . As in actual spectral fits (e.g. González Delgado et al. 2015) the NaI D doublet was also masked because of its interstellar component.
Each version of each test galaxy was fitted twice: with and without the UV information. Fits considering only the optical spectrum are hereafter called OPT (for optical) fits, while those which also fit NUV and FUV data are called PHO (for photometry) fits. Fig. 1 shows an example. The black spectrum and black diamond NUV and FUV points represent the input data for a test galaxy. The blue and red spectra are the results of PHO and OPT fits, respectively, and similarly for the filled blue and open red UV fluxes. Though the full λ-by-λ predicted UV spectrum is drawn, only the NUV and FUV fluxes are relevant in our analysis.

Example fits
The OPT and PHO fits are so similar in the optical that they cannot be told apart in Fig. 1. Indeed their M λ fluxes differ by less than 1% on average over the fitted range (3700-6800Å). In the UV, however, they diverge. While the PHO fit matches the UV data to within the errors, the OPT fit overpredicts the UV fluxes, specially in the FUV filter. That PHO fits perform better in the UV is of course not surprising, since they are designed to take the UV photometry into consideration, while OPT fits ignore it. What is perhaps unexpected is that the two fits so different in the UV yield nearly identical optical spectra.
This happens because the OPT fit ascribes 5% of the light at λ0 = 5635Å (our chosen reference wavelength) to populations of 30 Myr or younger. This small number reflects the insignificant contribution of these populations to the optical spectrum. Removing this component or replacing it by another one would make little difference for the optical fit. Yet, this same component overwhelms all the others at UV wavelengths (e.g. Kaviraj et al. 2007b). In the absence of UV constraints, starlight sees no harm in depositing some small amount of light in this population. Once it is informed about the UV fluxes, however, it realizes that some other combination of base elements must be sought to accommodate both the optical spectrum and the UV photometry. In the case at hand, the 1-30 Myr populations found in the OPT fit shrink to 2% in the PHO fit, being replaced by an increase in populations of 30-100 Myr. In rough terms, one can summarize the change as a shift from populations of O and B to one of B and A stars.
At this point it is fit to open a parenthesis to mention the potential effects of differential extinction. Another way to achieve the same overall result obtained with the PHO fit in Fig. 1 would be to attribute an extra reddening to the young population, an astrophysically attractive solution given that young stars (and their surrounding nebulae) are known to suffer more extinction than the general stellar population (Calzetti, Kinney & Storchi-Bergmann 1994;Charlot & Fall 2000). Mathematically, accounting for this complication in our modelling would require changing equation 1 and transforming our single dust parameter τV into an agedependent vector. Though starlight is prepared to handle multiple extinctions, experiments show that it does so much more reliably when information on recombination emission line fluxes (e.g. Hα and Hβ) is modelled along with other observables. For clarity and simplicity, we postpone the presentation of this further (and qualitatively different) upgrade of the code to a future communication, noting that, because age-dependent dust optical depths alter the UV/optical balance, it might impact the results reported in this paper.
Going back to PHO and OPT fits, Fig. 2 shows three further examples. In all cases PHO fits do an excellent job in fitting both the optical spectrum and the UV photometry. The tendency of OPT fits to overshoot the UV fluxes is illustrated by the top and bottom examples, but the middle one shows that the opposite can also happen. As observed in Fig. 1, the optical spectra are practically indistinguishable between PHO and OPT fits, indicating again that a small variation in the fraction of young stellar populations can be imperceptible in the optical spectra but produce an important change in the UV flux.
As a whole, these examples suggest that a simultaneous analysis of optical spectra and UV photometry should bring some improvement in the estimation of the strength of young stellar populations in a galaxy. For a more global mapping of what actually changes from OPT to PHO let us examine the results of the full set of simulations.

Input versus output: UV fluxes
To quantify the performance of the fits let us define ∆ as the output − input difference in some quantity (say, the NUV magnitude) and examine its statistics. Fig. 3 shows the histograms of ∆ for both NUV and FUV magnitudes. Different panels are for different S/N values, and blue and red lines are for PHO and OPT fits, respectively. NUV 0.00 ± 0.14 0.00 ± 0.08 −0.00 ± 0.04 −0.00 ± 0.02 −0.00 ± 0.02 FUV −0.00 ± 0.21 0.00 ± 0.12 0.01 ± 0.08 0.01 ± 0.06 0.01 ± 0.05 χ 2 SPEC /N eff λ 1.06 ± 0.04 1.06 ± 0.04 1.06 ± 0.04 1.06 ± 0.05 1.07 ± 0.06 Table 1. Statistics of the simulations. For each of the NUV and FUV magnitudes the table lists the mean predicted minus observed difference (∆) and its standard deviation (σ ∆ ). Also listed is χ 2 SPEC /N eff λ , a measure of the qualify of the fit of the optical spectrum. Columns are for the different levels of noise (S/N = 5, 10, 20, 50, 100).
match the UV fluxes, as designed to, and (2) OPT fits are lousy predictors of UV fluxes, with large ∆mNUV and ∆mFUV even for high quality data. Table 1 summarizes these results by listing the mean (∆) and standard deviation (σ∆) of ∆ for mNUV and mFUV over all test galaxies. ∆ and its dispersion behaves as expected for PHO fits, with ∆ ∼ 0 and σ close to the expected noise levels. OPT fits, on the other hand, have a tendency to overpredict the UV fluxes (= underpredict magnitudes, so ∆ < 0) by 0.1-0.3 mag, even for high quality data, and σ∆ is well above the photometric errors. Table 1 also lists the statistics of the χ2SPEC/N eff λ figure of merit. The results show that the large differences in UV predictions between OPT and PHO fits occur for equivalent performances insofar as the optical spectrum is concerned, corroborating the visual impression drawn from the examples in Figs. 1 and 2.

Input versus output: Physical properties
The OPT × PHO comparisons above were carried out in a space of observable quantities (UV magnitudes and optical spectral residuals). We now compare OPT and PHO in terms of physical properties. Table 2 (built to be similar to  Table 1 in Cid Fernandes et al. 2005) lists the statistics of ∆ as a function of S/N as obtained with these two approaches, and for the suite of properties discussed next.

Stellar mass and extinction
Stellar mass (M ) is not an explicit parameter in starlight, but a byproduct of the light fraction population vector ( x) translated to mass fractions ( µ) through the known lightto-mass ratios of the N base populations. As widely known (e.g. Salim et al. 2007;Taylor et al. 2011), and foregoing IMF-related uncertainties, M is a relatively robust quantity in both photometric and spectroscopic analysis. Table 2 shows that log M is recovered very accurately in the simulations, with ∆ ∼ 0 for both PHO and OPT fits and any S/N . The dispersion (i.e. the uncertainty) in ∆ log M for OPT fits ranges from σ∆ = 0.16 to 0.06 dex from S/N between 5 and 100, and very slightly smaller for PHO fits. UV info therefore does not help constrain M in any significant way.
The same happens with the dust parameter τV . In this case, for S/N = 20 we have ∆ ± σ∆ = 0.02 ± 0.06 for OPTfits, and 0.01 ± 0.05 for PHO-fits. In both cases τV is recovered to a similar level of precision. (We expect UV constraints to play a more relevant role in the multiple-τV , differential extinction starlight modelling mentioned in Section 3.2.) Table 2 further lists the ∆ ± σ∆ values for the luminosity weighted mean (log) age ( log t L) and metallicity ( log Z L). The first moment of the age distributions is given by log t L ≡ j xj × log tj, and similarly for the metallicity. Mass weighted versions of these quantities are obtained replacing the light-fraction population vector x by its massfraction counterpart µ. Examining the entries for these age and metallicity moments in Table 2 we see that σ∆ decreases systematically from OPT to PHO fits, particularly for log t L. For S/N = 20, for example, the addition of GALEX information to the optical spectrum brings the dispersion in ∆ log t L from 0.18 to 0.10 dex. OPT fits also tend to be slightly biased towards younger ages, by ∆ log t L = −0.04 to −0.11 dex as S/N decreases from 100 to 5, whereas PHO fits are not biased for any S/N . The bias is smaller for the mass weighted mean age log t M than for log t L, indicating that this difference derives from differences in the young populations, which contribute much more in light than in mass.

Mean stellar age and metallicity
The simulations indicate that the GALEX input also improves the stellar metallicity estimates, e.g. from 0.04 ± 0.22 to −0.03 ± 0.15 dex in ∆ log Z M for OPT and PHO S/N = 20 fits respectively. As for the mean stellar age, this improvement reflects the enhancement in the ability to estimate the contribution of young stellar populations.

Star formation history: Condensed population vector
There are several ways to process starlight's output population vectors into quantities which describe a galaxy's SFH. One which has been widely explored in the past (González Delgado et al. 2004;Cid Fernandes et al. 2004;Cid Fernandes et al. 2005) is to rebin x on to 'young' (tj < 10 8 yr), 'intermediate-age' (10 8 tj 10 9 yr), and 'old' (tj > 10 9 yr) populations (xY , xI and xO, respectively). Table 2 shows the statistics of ∆xY , ∆xI , ∆xO. As expected, the σ∆ dispersions decrease for increasing S/N . More relevantly to this paper, all components of this condensed population vector have smaller uncertainties when UV constraints are added, i.e. as one goes from OPT to PHO fits. The gain is markedly larger for the youngest components, as might be expected given that young populations, when present, have a dominant contribution in the UV. Focusing again on the S/N = 20 simulations, we obtain that σ∆x Y decreasing by ∼ 42% as UV constraints are incorporated, while σ∆x I and σ∆x O decrease by some 8 and 18% respectively. The same conclusion applies to the condensed mass-fractions population vector (µY , µI , µO), also included in Table 2. In line with the mean age and metallicity results reported just above, we conclude that the simulations corroborate the basic intuitive notion that the addition of UV information to an optical spectral analysis is specially helpful in constraining the properties of young stellar populations (up to ∼ 300 Myr). It is therefore natural to expect our op-tical+UV starlight analysis to be particularly relevant for systems containing O, B and/or A stars, the UV-dominant component under most circumstances. This expectation is born out in the next Section.

APPLICATION TO CALIFA+GALEX DATA
The experiments above served to validate the new capabilities of starlight, as well as to provide a general sense on the changes resulting from the addition of UV photometry to an optical spectrum as observables in the analysis. In this section we present an application to real data, combining CALIFA spectra with GALEX magnitudes.

CALIFA
The Calar Alto Legacy Integral Field Area survey, first described by Sánchez et al. (2012), has collected optical datacubes for over 500 galaxies, two hundred of which have already been made available in the 1 st (Husemann et al. 2013) and 2 nd (García Benito et al. 2015) data releases. Its targets are drawn from a diameter-selected sample fully characterized in Walcher et al. (2014). The data were collected at the 3.5m telescope of Calar Alto with the Potsdam Multi-Aperture Spectrometer (Roth et al. 2005) in the PPaK mode (Verheijen et al. 2004).
Each galaxy is observed with two spectral settings which we combine to reduce the effects of vignetting on the data. This is done within version 1.5 of the CALIFA pipeline. Our final datacubes cover about 1 arcmin 2 with a spatial resolution of ∼ 3 arcsec (FWHM) and cover the restframe spectral range from 3700 to 6800 with 6Å resolution. This rich data set has been used in over 30 published papers, some of which (Pérez et al. 2013;González Delgado et al. 2014, hereafter GD14) are based on results of a starlight analysis of the optical spectra, i.e. 'OPT fits' in the notation of this paper. Pre-processing steps (from Galactic extinction to Voronoi binning) and other details are discussed in Cid Fernandes et al. (2013).

GALEX
Nearly two thirds of the galaxies in the CALIFA mother sample have UV observations available from the Galaxy Evolution Explorer (GALEX) archive (Martin et al. 2005). In most cases these include both far-ultraviolet (FUV, effective wavelength λ eff ∼ 1542Å) and near-ultraviolet (NUV, λ eff ∼ 2274Å) bands. The data come from the GR6 data release. The GALEX archive provides simultaneous co-aligned FUV and NUV images with a field of view (FoV) of 1.2 degrees wide, spatial scale of 1.5 arcsec per pixel and a spatial resolution of ∼ 4.5 arcsec (FWHM).
For our sample the average uncertainties in the integrated data are 0.03 and 0.06 mag for NUV and FUV magnitudes respectively. Because our sources are all nearby and relatively bright, these errors are about half the typical GALEX uncertainties.

Combining CALIFA+GALEX data
Our combined CALIFA + GALEX sample contains 260 galaxies ranging from early to late types, being a representative subset of the CALIFA sample as whole. This is illustrated in Fig. 4, which shows galaxies scattered from the blue cloud to the red-sequence in a UV-optical colour magnitude diagram (CMD). Hubble types are coded by colours. Numerically, the sample contains 37 Ellipticals, 32 S0, 47 Sa, 41 Sb, 46 Sbc, 43 Sc, and 14 Sd (see Walcher et al. 2014 for the morphological composition of the CALIFA mother sample).
To combine our CALIFA datacubes with GALEX images we use the MONTAGE software. We perform a resampling of the GALEX images to the same spatial scale as CALIFA. We then align and cut the GALEX images using the WCS to obtain processed FUV and NUV images with the same FoV of our CALIFA datacubes. Galactic extinction corrections following Wyder et al. (2007) were applied to the data.
These spatially matched data sets are ideal to circumvent the usual uncertainties associated with aperture effects. Indeed, this is the central motivation to use CALIFA data in this pilot study.
All the analysis in this section is based on spatially integrated data, obtained by collapsing the datacubes to a single optical spectrum and performing the UV photometry over the corresponding area. In Section 5 we further explore results obtained from four spatial extractions: r < 0.5, r < 1, 1 < r < 2, and r > 1, where r denotes the radial distance to the nucleus in units of the optical Half Light Radius (HLR, defined as in Cid Fernandes et al. 2013). None of our galaxies have a HLR smaller that the FWHM of the GALEX PSF, and most (247/260) have HLR larger than 8 arcsec, so these extractions are broad enough to avoid resolution issues.

Results
In analogy with the sequence followed in Section 3, we first present the results regarding starlight's algorithmic goal, which is to fit the input observables (Sec. 4.2.1), and then in terms of the stellar population properties derived from the fits (Sec. 4.2.2). Except for the observational errors, which in this case come from the actual data, the starlight analysis was performed exactly as described in Section 3, with OPT fits analyzing only the 3700-6800Å spectra, and PHO fits adding the NUV and FUV magnitudes to the fit.

starlight fits
Fig. 5 exemplifies the starlight fits with three galaxies: NGC 3057 (top), IC 4215 (middle), and UCG 05771 (bottom). As in Fig. 2, OPT fits are shown in red and PHO fits in blue. As in the simulations, the optical spectra are equally well fitted in both kinds of fits. For instance, the mean percent deviation between O λ and M λ (eq. 6 in Cid Fernandes et al. 2013) are 2.8 and 3.1% in OPT and PHO fits. Also as in the simulations, differences emerge in the UV. Again, UV fluxes tend to be overpredicted in OPT fits (top and bottom panels), but this is just a tendency, not a general rule. Cases like IC 4215 (middle panel), where the OPT predictions fall short of the observed UV fluxes, also happen. Fig. 6 shows the N U V versus N U V − r CMD derived from the synthetic photometry over the fitted spectra. As expected, the PHO-based CMD (upper panel) matches the observed one (Fig. 4), with rms differences of just 0.025 mag in MNUV and 0.044 in N U V − r. OPT fits, however, predict a wrongly shaped CMD. The incorrectly predicted N U V fluxes produce shifts in both MNUV and N U V − r. The red sequence scatters towards both redder and bluer colours (as can be seen comparing the location of E galaxies in the two panels), while late type systems become both bluer and more luminous. As found in the simulations, OPT fits are poor predictors of the UV properties, particularly for systems in the blue cloud.

Physical properties: Mass and dust attenuation
Let us now turn the focus from the observables to the stellar population properties derived from the analysis. Fig. 7 compares PHO and OPT results for a series of properties. As in Fig. 4, points are colour coded by the Hubble type, an indirect but very efficient way of summarizing the properties of a galaxy, including its stellar populations (Kennicutt 1998;González Delgado et al. 2015).
Stellar masses, shown in the top-left panel, are essentially the same in PHO and OPT fits. Defining ∆ as the PHO − OPT difference in the value of any given property, we find a mean value of ∆ = 0.04 dex for log M , with a dispersion σ∆ = 0.09 dex. The scatter is somewhat larger for late type systems, but still very small. For instance, for Sc-Sd galaxies (blue points) we obtain ∆ = 0.05 and σ∆ = 0.1 dex, whereas for E-S0-Sa we obtain ∆ = 0.01 and σ∆ = 0.05 dex.
Regarding the τV values, we again observe no significant differences between PHO and OPT results, as seen in the top-right panel of Fig. 7. In this case we obtain ∆ = 0.0 and σ = 0.05. Late type systems (bluer points) are again the ones with a larger dispersion; σ = 0.07 if only Sc and Sd galaxies are considered. As a whole, however, and in agreement with the results of our simulations, neither M nor τV estimates gain much from the addition of UV constraints to a purely optical, conventional starlight spectral fit.

A note on why τV (PHO) ∼ τV (OPT)
The apparently negligible impact that UV information has upon our derived values of τV is perhaps surprising in light of the known sensitivity of UV fluxes to dust. Though sub- tle, the reasons for this somewhat counter intuitive result are easily understood. This section opens a parenthesis to explain them.
First, recall that OPT fits over predict the UV flux, so that PHO fits must find solutions which produce less UV. At the same time, and this is the key constraint here, PHO fits must keep the predicted optical spectrum essentially unchanged, since they must (by design) match both UV and optical data. UV fluxes can be diminished by: (1) increasing τV , (2) decreasing the contribution of young stars (xY ), and/or (3) increasing the age of the young population. The latter of these three (non-exclusive) alternatives is much more plausible than the others.
The first of these solutions is problematic. More dust may lead to the correct UV fluxes, but the larger reddening would then require increasing xY to bluen the optical colors back to the observed values. More xY would in turn imply more UV and require further increasing τV until an optimal balance is achieved. Note that even if this works in terms of colors, the increase in xY would dilute absorption lines and hence degrade the quality of the optical fit. Increasing the age and metallicity of the old populations could perhaps restore the observed strengths of absorption features, but at this point it is clear that this route is a highly contrived one. The second alternative suggested above, namely, decreasing xY , sounds less problematic, but it is not a complete solution per se since the missing light must be replaced by something else. This 'something else' should look like young stars in the optical but have a smaller UV per optical photon output.
This brings us to the third and more natural solution: Aging the young population. From the optical point of view, populations of a few Myr or a few tens of Myr are very sim- ilar. For instance, and fixing Z at Z for convenience, populations of 3 and 50 Myr have g − r colors of −0.5 and 0, and Dn(4000) indices (Balogh et al. 1999) of 0.9, and 1.0, respectively. These relatively small differences contrast with the strong evolution of the UV, with N U V − r changing from ∼ −1.3 to +0.5 over the same time span. A change from populations of a few Myr to a few tens of Myr therefore produces the kind of result we need: less UV-per-optical emission at ∼ constant optical colors. As discussed later in Section 4.2.5, the retrieved SFHs of OPT and PHO fits confirm this interpretation.
Aging the youngest populations thus offers the best way of simultaneously satisfying optical and UV constraints, which explains why τV remains approximately unaltered between OPT and PHO fits. It is adequate to recall that this conclusion applies to the simple foreground dust screen scenario adopted in this paper. Fits which allow for populationdependent τV -values will certainly be more sensitive to the addition UV information.

Physical properties: Mean stellar age and metallicity
The bottom panels of Fig. 7 compare mean age ( log t L) and metallicity ( log Z M ) values as estimated from PHO and OPT fits. Here we see an effect which was also detected in the simulations: The difference in log t L is mainly due to the youngest systems, which are somewhat older in PHO than in OPT. By virtue of the inter relations between mass, age, metallicity, and morphology, these young galaxies are also late types (Sbc-Sd) of low mass and metallicity.
Metallicities, on the other hand, change in the opposite direction, decreasing from OPT to PHO (bottom right panel of Fig. 7). Again, the effect is negligible for most galaxies, but can be significant for late type (M 5 × 10 9 M ) systems. For these galaxies we obtain ∆ = −0.4 and σ = 0.26 dex, whereas for more massive systems the bias and dispersion are just ∆ = −0.04 and σ = 0.15 dex. Fig. 8 shows that the changes in age and metallicity are anti correlated, reflecting the well known age-metallicity degeneracy (e.g. Worthey 1994). Note, however, that this degeneracy is more frequently studied in the context of early type galaxies and their old stellar populations, while Figs. 7 and 8 show that it is late type systems which are affected the most. These are precisely the galaxies for which estimates of the stellar metallicity are harder to obtain, and our results indicate that the UV photometry brings in useful information to improve such estimates.
Finally, we emphasize that even though the anticorrelation stands out in Fig. 8, the majority of points cluster around ∆ log t ∼ ∆ log Z M ∼ 0, with variations within the uncertainties expected from the simulations. Coupled to the negligible changes in M and τV , we conclude that for most galaxies the stellar population properties derived from OPT and PHO fits are consistent with one another. This is an important point to highlight, particularly given that, for obvious reasons, much of this paper is dedicated to mapping the differences between these two approaches.

Star Formation History
The ultimate goal of any stellar population method is to retrieve the time-dependent SFH. In starlight the SFH is encoded in the light ( x) or mass ( µ) population-vectors. As documented elsewhere (e.g. Cid Fernandes et al. , 2014, the individual components of these arrays are highly uncertain, but a coarser description in terms of broad age bins, or, equivalently, smoothed versions of x and µ, is robust. In order to capture general trends in the SFH of our galaxies and how these change from OPT to PHO fits we first smooth the age distribution in x and µ by a gaussian in log t with a FWHM of 0.7 dex, and average the results in three morphology-defined groups of galaxies: early (E, S0 and Sa), intermediate (Sb and Sbc), and late (Sc, Sd) types. These groups can be seen also as representative of red, green and blue galaxies, respectively.
The results are shown in Fig. 9. Top panels are for OPT fits and bottom ones for PHO. The left plots show the smoothed age distribution in terms of their contribution to the flux at our chosen normalization wavelength λ0 = 5635 A, while the ones on the right present the cumulative contribution in terms of mass, re-scaling the mass turned into stars onto a 0-1 scale. Because of the highly non-linear massto-light relation of stars, these mathematically equivalent descriptions of the SFH highlight different aspects of the problem.
In terms of light fractions (left panels in Fig. 9), the more relevant differences between OPT and PHO fits are seen for ages < 300 Myr. In particular, the t < 10 Myr populations seen in OPT fits shift towards t ∼ 30-300 Myr when UV constraints are included. This explains the excessive UV flux predicted in OPT fits and the systematically older mean ages obtained with PHO fits. Note, however, that this effect is basically restricted to blue and, to a lesser extent, green galaxies. The SFHs of red (early-type) galaxies do not change significantly from OPT to PHO fits. These results clarify the origin of the differences in luminosity weighted mean stellar ages seen in the bottom-left panel of Fig. 7, where late types stand out as the only ones with significant changes in log t L.
In contrast to left panels, the SFHs on the top and bottom right panels of Fig. 9 are hardly distinguishable. The only visible difference is for blue galaxies, and even then the cumulative mass fractions are very similar. To quantify the differences we compute the age at which the stellar mass has grown to 80 per cent of the total. OPT fits yield t 80% = 1.3, 4.2, and 5.9 Gyr for blue, green and red galaxies respectively, while in PHO-fits these values become t 80% = 1.7, 5.0, and 5.9 Gyr. This similarity is a consequence of the OPT-PHO changes occurring in relatively young stellar populations, that carry significant light but little mass.
In Fig. 10 we break up the mass assembly histories in boxes of 1 × 1 mag bins in the N U V − r versus Mr CMD, first studied by Wyder et al. (2007). The gradual shift in SFHs towards more recent lookback times as one descends from red to blue bins reflects the strong relation between the N U V − r colour and mean stellar age (further explored in Section 5), while the general aging as one moves towards more luminous (smaller Mr) bins reflects the well known cosmic downsizing (better appreciated by mentally collapsing the CMD along its y-axis). These general tendencies are seen in both OPT and PHO fits.
Regarding the differences in SFH between OPT and PHO fits, Fig. 10 reinforces the conclusion that they are essentially limited to low mass, blue galaxies, as further confirmed by comparing the values of t 80% , listed in blue for PHO and red for OPT fits. A total of 28 of our 260 galaxies reside in CMD bins where t 80% changes by more than 25 per cent (i.e. 0.1 dex). Out of our 260 galaxies only 28 reside in CMD bins where t 80% changes by more than 25 per cent (i.e. 0.1 dex).

DISCUSSION
The simulations and empirical results presented above showed that (1) the new code works, i.e. it simultaneously fits an optical spectrum and UV photometry, as designed to, and (2) OPT and PHO fits only differ relevantly for lowmass, late type-galaxies, whose mean ages become somewhat older while their mean metallicities tend to decrease.
In this section we discuss how the addition of UV constraints affects previously known results. We first examine empirical relations between mean stellar age and observables such as colours and the 4000Å break (Section 5.1). The scatter in these relations provides an indirect way of assessing whether PHO fits are more reliable than OPT ones, as intuitively expected. We then revisit the relation between stellar metallicity and (a) mass, and (b) mass surface density, comparing our own previous OPT-based CALIFA results with those obtained with our CALIFA + GALEX sample.

Empirical age indicators
Because PHO fits incorporate more constraints one tends to regard their output results as superior to those derived from OPT fits. Still, it would be nice to have some independent way of evaluating which approach produces better results.
We perform this judgement by comparing the scatter in empirical relations such as those shown in Fig. 11, where we relate our starlight-derived luminosity weighted mean (log) stellar age to observable properties. Top panels show the correlation between log t L and the N U V − r colour, while in the middle and bottom panels the x-axis is replaced by u − r and the 4000Å break index (Balogh et al. 1999), both purely optical properties. Left and right columns correspond to PHO and OPT fits, respectively. The data used in this figure come from the extended data set discussed in Sec-tion 4.1.3, containing both integrated properties and values derived from four different spatial extractions. The improved statistics of this larger sample serves to better delineate the correlations.
A simple visual inspection suffices to conclude that the OPT-based relations are more dispersed than those based on PHO fits. This is not really unexpected in the case of the top panels, since OPT fits are completely oblivious of the N U V − r colour, whereas PHO fits do take this information into account. In the middle and bottom panels, however, the x-axis represents properties which are known to both OPT and PHO fits. Still, the relations between log t L and u − r and between log t L and Dn(4000) are visibly better defined with PHO mean ages than with OPT ones. This improvement can be quantified by comparing the σ values given in each panel of Fig. 11, which represent the dispersion Figure 11. Empirical correlations between the starlight-derived luminosity weighted mean stellar age and the observed N U V − r (top panels), u−r (middle), and Dn(4000) (bottom). Left panels are for PHO-fits and right ones for OPT fits. The black lines show polynomial fits to the points (see Table 3), and σ denotes the rms dispersion with respect to these lines. Points are coloured by morphological type following the palette in Fig. 4. The points in these diagrams come from four different radial extractions for each of our 260 galaxies.
around the polynomial fits shown as solid lines and whose coefficients are given in Table 3. The scatter in OPT-based relations is almost twice as large as for PHO-based ones. As is evident from the cyan-blue color of most outliers, this reduced scatter occurs because of late-type galaxies.
In short, besides taking more observational constraints into consideration, PHO fits produce better behaved mean stellar ages than OPT fits, in the sense that they correlate better (less scatter) with classical observable age indicators. PHO thus outplay OPT in this qualitative assessment.

Less age-metallicity-extinction degeneracies with UV data
Age and metallicity are more sensitive to UV than optical colours (Yi et al. 2004), and previous studies suggest that combining optical and UV provides better estimates of ages and can effectively break (or at least mitigate the effects of) the age-metallicity degeneracy (Yi 2003;Kaviraj et al. 2007). Indeed, we have just seen that a combined optical+UV analysis produces more accurate mean age estimates than a purely optical one for Sbc-Sd galaxies. Because of the known covariances amongst stellar population properties, more accurate ages should also lead to more accurate metallicity and reddening estimates. Without independent fiducial values to compare to it is not possible to directly verify if this is indeed the case. With this caveat in mind, we try to shed some light onto this issue by examining the origin of the dispersion in the empirical relations shown in Fig. 11.
In Fig. 12 we use the best fit log t L(N U V − r) relation given in Table 3 to investigate what third variable is responsible for the scatter in mean stellar age at fixed UVoptical colour. The figure shows the δ log t L ≡ log t L − log t L(N U V − r) residual as a function of τV (top panels) and log Z M (bottom), for both PHO (left) and OPT fits (right). A strong anti correlation with τV is seen for both PHO and OPT fits, with δ log t L becoming increasingly negative for increasing τV . This anti correlation is expected given the long wavelength baseline in the N U V − r colour, which makes it susceptible to τV . The relation is steeper and visibly more dispersed for OPT fits.
For OPT fits, metallicity also seems to play a role in the dispersion around the log t L(N U V −r) relation, as inferred from the bottom right panel of Fig. 12. Besides a significant dispersion, the trend of increasing δ log t L for decreasing Figure 13. The mass-metallicity relation obtained with PHO fits. Blue lines indicate the mean profile with ±σ standard deviation (solid and dashed lines, respectively). Red lines show the mean mass-metallicity relation profile obtained with OPT fits with ±σ standard deviation (solid and dashed lines, respectively).
log Z M at low metallicities is qualitatively consistent with what one expects from the age-metallicity degeneracy. PHO fits, on the other hand, produce a ∼ flat relation between δ log t L and log Z M (bottom left panel), indicating that the inclusion of UV data indeed minimizes the effect of the age-metallicity degeneracy with respect to fits considering only the optical spectrum. This qualitative assessment therefore reinforces our conclusion that PHO fits produce better constrained physical properties.

The stellar mass-metallicity relation
One of the most important correlations in galaxy evolution work is the one between mass and metallicity (Tremonti et al. 2004;Gallazzi et al. 2005). In GD14 we have presented a starlight-based study on the relations between stellar metallicity and mass in CALIFA galaxies, both on global (i.e. galaxy-wide) and local (spatially resolved) scales. In this section we examine whether and how the mass-metallicity (MZR) and surface mass density-metallicity (µZR) relations change with the addition of UV data to spectroscopic data. 1 Our comparative analysis of PHO and OPT fits showed that changes in the mean stellar metallicity are only relevant and systematic for late type galaxies (Fig. 7), whose log Z M values decrease by ∼ 0.4 dex on average. These presumably more accurate estimates are particularly welcome for these low-mass, star-forming galaxies, where the inherent difficulties in estimating stellar metallicities are aggravated by the almost featureless continuum of their hot stars, which 1 Because of the differences in the SSP models used in the synthesis, and, less importantly, in the sample, our results should not be directly compared to those of GD14. The comparison between PHO and OPT fits presented here, however, is based on equal ingredients and therefore is meaningful.
We can thus anticipate that changes in the MZR should be restricted to the low Z, low M end of the relation. This is confirmed in Fig. 13, where we show the PHO-based MZR for the 260 galaxies in our combined CALIFA+GALEX sample. The blue lines show the smoothed mean relation (solid line) and the corresponding ±1σ range (dashed). The OPTbased MZR for this sample is shown by the red line. As expected, the two are essentially identical at the high mass end, diverging towards low masses, with PHO fits reaching lower metallicities. Fig. 14 presents the µZR as derived from our opti-cal+UV starlight analysis. Small points are coloured according to the four spatial extractions discussed in Section 4.1.3. Despite the much coarser spatial resolution, the same dichotomy identified by GD14 is seen in our PHO-version of the local µZR, with inner regions (brown and orange points) exhibiting a visibly flatter µZR than outer ones (cyan and blue). In fact, because of the stretched log Z M scale, this dichotomy becomes ever clearer than in a purely optical analysis. Reinforcing the results of GD14, we find that the mean stellar metallicity is strongly related to the local den-sity within galactic discs, while in spheroids µ does not seem to play a major role in controlling chemical evolution.
The large grey circles in Fig. 14 show a smoothed mean µZR, obtained by averaging log Z M -values in bins of µ . This mean µZR reflects the dual behaviour of the individual points, with an initially steep relation becoming weaker (flatter) above ∼ 10 2.5 M pc −2 . Diamonds in Fig. 14 indicate the mean µZR obtained when restricting the sample to Sc and Sd galaxies. The metal poor, dense, inner (red and orange) zones of these late type galaxies account for nearly all of the outliers at µ 10 3 M pc −2 . As suggested by GD14, this may be related to the ∼ bulgelessness of these systems making their inner regions behave in a disc-like way in the stellar metallicity versus surface mass density space.

SUMMARY
As part of an effort to extend the capabilities of the starlight code, an extensively used tool to estimate stellar population properties of galaxies out of detailed λ-by-λ spectral fits, a new version was developed with the specific purpose of including photometric data in the fit, thereby incorporating more observational constraints in the analysis. This paper was dedicated to the presentation and validation of this extended starlight by means of simulations and data comprising a 3700-7000Å optical spectrum plus NUV and FUV magnitudes. The observational data consist of spatially matched CALIFA datacubes and GALEX images for a varied sample of 260 galaxies of all types from E to Sd. Both simulated and actual data were fit using (a) only the optical spectrum (OPT), and (b) the full optical+UV data (PHO), thus allowing us to gauge the practical benefits of adding UV constraints to an optical full spectral fitting analysis.
Our main results can be summarized as follows: (i) By themselves, optical spectral fits are poor predictors of the UV properties, with errors of the order of 0.5 mag and a tendency to overpredict the fluxes, even for high signal-tonoise. This happens because optically insignificant young stellar populations can dominate the emission in the UV, so that even minor errors in the estimation of their optical contribution translate into large errors in the UV.
(ii) Besides matching the input UV data to within the errors, the new optical+UV fits reduce the uncertainties in the derived stellar properties.
(iii) Applying the code to a combination of CAL-IFA+GALEX data we find that including UV photometry in the fits better constrains the contribution of stellar populations younger than ∼ 300 Myr old. PHO fits tend to replace 30 Myr components by populations in the neighbourhood of 100 Myr (i.e. from O and B stars to B and A).
(iv) Despite their poor performance in predicting the UV fluxes, for nearly 90% of our sample OPT fits yield stellar population properties which agree with those obtained with PHO fits to within the expected uncertainties. The differences are exclusively found in low-mass, late-type galaxies, precisely the systems where, because of their significant 300 Myr population, one would expect the addition of UV constraints to play a more relevant role.
(v) For Sc and Sd galaxies with M < 5 × 10 9 M we find that an optical+UV analysis yields older ages and lower metallicities than those derived with purely optical fits. These changes imply a steepening of the relations between stellar metallicity and mass (MZR) and surface density (µZR) at the low Z end, making the dual disc and spheroid behaviours even clearer than previously reported with OPT-based studies by our own group.
(vi) Empirical relations between our (luminosity weighted) mean stellar age and observables such as the 4000 A break, and UV and optical colours, are all less dispersed for PHO than for OPT fits, which indicates that the inclusion of UV constraints helps mitigating degeneracies between age, dust and metallicity.
All the experiments conducted in this paper were based on optical spectra + UV photometry, so future tests of the new code should explore other combinations, like optical spectra + near IR photometry, and others. In any case, at least in the regime tested here, the extended starlight is ready to extract stellar population properties out of combinations of photometry and spectroscopy. SDSS spectra and GALEX photometry comprise a natural dataset to explore, although it demands care in dealing with aperture mismatches, an issue which we circumvented in this study through the use of integral field data. In parallel to these studies, and despite the progress already achieved with the incorporation of photometric constraints, further upgrades to starlight are desirable, and implementing a more realistic modelling of dust effects is top on the priority list. Differential extinction, in particular, may well have a significant impact in studies of star-forming systems, and work is underway to tackle this issue.

ACKNOWLEDGMENTS
CALIFA is the first legacy survey carried out at Calar Alto, and we thank the IAA-CSIC and MPI-MPG as major partners of the observatory, and CAHA itself, for the unique access to telescope time and support in manpower and infrastructures. We also thank the CAHA staff for the dedication to this project. Support from the Spanish Ministerio de Economía y Competitividad, through projects AYA2014-57490-P, AYA2010-15081 (PI RGD), Junta de Andalucía FQ1580 (PI RGD), AYA2010-22111-C03-03, AYA2010-10904E (SFS) and short-term research FPI program grants EEBB-I-2013-07071 and EEBB-I-2014-08601. SFS thanks the CONACYT-125180 and DGAPA-IA100815 projects for providing him support in this study. We also thank the Viabilidad, Diseño, Acceso y Mejora funding program, ICTS-2009-10, for funding the data acquisition of this project. Support from the Brazilian Science without borders program, as well as CNPq and CAPES is duly acknowledged. This research made use of Montage. It is funded by the National Science Foundation under Grant Number ACI-1440620, and was previously funded by the National Aeronautics and Space Administration's Earth Science Technology Office, Computation Technologies Project, under Cooperative Agreement Number NCC5-626 between NASA and the California Institute of Technology.