jacopo-chevallard / BEAGLE-general

Basic information to get started with the galaxy spectral modelling tool Beagle
https://www.iap.fr/beagle/
9 stars 0 forks source link

BEAGLE not fitting CANDELS data properly #23

Closed kevinhainline closed 8 years ago

kevinhainline commented 8 years ago

Hello!

So, I'm trying to fit some CANDELS objects at z < 4, and the resulting fits, at least the best ln(likelihood) fits, are coming out pretty poor, as compared to the data.

As an example, we fit an object from the CANDELS field, 21141, at z = 3.6.

ID: 21141 (it will be called 1, or 2, in some of the files below) RA, DEC: 53.0119630, -27.7300347 z: 3.6 CTIO_U: -2.74626E-02 1.59071E-02 VIMOS_U: -6.47088E-03 3.78937E-03 ACS_F435W: 4.18016E-02 1.34111E-02 ACS_F606W: 2.28677E-01 1.01629E-02 ACS_F775W: 3.35850E-01 2.15332E-02 ACS_F814W: 3.49577E-01 2.13675E-02 ACS_F850LP: 3.40576E-01 2.43418E-02 WFC3_F098M: 3.48986E-01 2.22312E-02 WFC3_F105W: -9.90000E+01 -9.90000E+01 WFC3_F125W: 3.69287E-01 1.34005E-02 WFC3_F160W: 4.44981E-01 1.66383E-02 ISAAC_KS: -9.90000E+01 -9.90000E+01 HAWKI_KS: -9.90000E+01 -9.90000E+01 IRAC 1: 6.33066E-01 7.71784E-02 IRAC 2: 7.67208E-01 5.61052E-02 IRAC 3: 1.28345E+00 5.14226E-01 IRAC 4: 5.30146E-01 5.53842E-01

(these fluxes are in microJy)

And when I use this parameter file:

# This is a stripped down version of the BEAGLE parameter file for 
# with checking the correct installation of BEAGLE using Docker.
# This file will be used for producing artificial photometry using
# an analytic star formation history.
# Verbose mode: 0 ---> no info
#               1 ----> print only errors
#               2 ---> print errors and warnings
#               3 ----> print errors, warnings and info 
VERBOSE = 1

# Seed for the random number generator
SEED = 994189

#****************************************************************
#******************** COSMOLOGICAL PARAMETERS *******************
#****************************************************************
#
# If left blank, default parameter values will be used.

HUBBLE_0 = 

OMEGA_MATTER =

OMEGA_LAMBDA =

#****************************************************************
# ******************* TEMPLATES  *****************************
#****************************************************************

#TEMPLATES = $BEAGLE_TEMPLATES/bc03/bc03_miles_chab_spectra
TEMPLATES NEBULAR = $BEAGLE_TEMPLATES/ineb_Jan16_C100/cb2013_n2_mup100_N015_O01_deplO70_C100_Jan16
EMISSION LINES CONFIGURATION = $BEAGLE_TEMPLATES/ineb_Jan16_C100/cb2013_n2_mup100_N015_O01_deplO70_C100_Jan16_line_wavelengths_PHOTOMETRY.dat

SHRINK TEMPLATES WL RANGE = 900 60000
REBIN TEMPLATES = 10

#SPECTRAL INDICES CONFIGURATION =

#SPECTRAL INDICES CATALOGUE = 

#****************************************************************
# ******************* PHOTOMETRY *****************************
#****************************************************************

FILTERS FILE = $BEAGLE_FILTERS/filters_CANDELS.dat

PHOTOMETRIC CATALOGUE = $BEAGLE_DATA/CANDELS_test_data_highz.fits

FIT PHOTOMETRY = T
FIT SPECTRUM = F

#****************************************************************
#******************** DUST ATTENUATION AND IGM ABSORPTION *******
#****************************************************************
#
IGM ABSORPTION = Inoue

# File containing set of radiative transfer (RT) calculations of dust attenuation of starlight
#RT CALCULATIONS = Tuffs_bulge_NEW-28-11.dat Tuffs_thick_NEW-28-11.dat Tuffs_thin_NEW-28-11.dat
#RT COMPONENTS NAMES = bulge thick_disc thin_disc

# **************************************************
# ************** SF BIN #1 **************************
# **************************************************
#SF_PARAMETER  = name:sfh_type                 type:fixed  char_value:exponential
SF_PARAMETER  = name:sfh_type                 type:fixed  char_value:delayed
#options for analytic SFHs are 'ssp' (for a burst), 'constant', 'exponential', 'delayed', 'rising'

# In log(yr)
SF_PARAMETER  = name:tau                      type:fitted  order_priority:1  prior:distribution:uniform  prior:range:[7.,10.5]

# in log(Z/Z_sun)
SF_PARAMETER  = name:metallicity              type:fitted  order_priority:1  prior:distribution:uniform  prior:range:[-2.2,0.24]

# In log M/M_sun
SF_PARAMETER  = name:mass                     type:fitted  order_priority:0  prior:distribution:uniform  prior:range:[5.,12.] 
#SF_PARAMETER  = name:mass                     type:fitted     prior:distribution:dirac    prior:colName:mass

# **************************************************
# **************  OTHER SF PARAMETERS **************************
# **************************************************

# In log(M_sun/yr)
#SF_PARAMETER  = name:sfr                type:fitted  order_priority:1  prior:distribution:uniform  prior:range:[-4.,4.]        mock:type:random 
SF_PARAMETER  = name:specific_sfr        type:fitted  order_priority:1  prior:distribution:uniform  prior:range:[-14.0,-7.0]        mock:type:random 

#****************************************************************
# ******************* PRINTED OUTPUT  *****************************
#****************************************************************

RESULTS DIRECTORY = $BEAGLE_RESULTS/CANDELS_test_highz/

PRIORS CATALOGUE = $BEAGLE_DATA/CANDELS_test_data_highz.fits

PRINT PHOTOMETRY = T
PRINT SPECTRUM = T
PRINT SPECTRAL INDICES = F
PRINT SF AND ChE HISTORIES = F

#****************************************************************
# ******************* PARAMETERS HANDLING  *****************************
#****************************************************************

#PDF SAMPLER FILE = $BEAGLE_PARAM_DIR/MCMC_example.param
PDF SAMPLER FILE = $BEAGLE_PARAM_DIR/MCMC_new.param

PARAMETER  = name:redshift     type:fitted    prior:distribution:dirac    prior:colName:redshift

PARAMETER  = name:nebular_logU type:dependent

PARAMETER  = name:nebular_xi   type:fixed    value:0.3

PARAMETER  = name:nebular_Z    type:dependent 

PARAMETER  = name:attenuation_type  type:fixed  char_value:CF00   
# values can be: CF00, Calzetti, CCWW13_universal, CCWW13_full

PARAMETER  = name:tauV_eff     type:fitted  order_priority:0      prior:distribution:uniform   prior:range:[0.,5.]

PARAMETER  = name:mu           type:fixed   value:0.4

We fit on BEAGLE, and our output SEDs look pretty bad compared to the input fluxes:

image

If I remove the IRAC points, the fit still underpredicts the fluxes:

image

We can't quite understand what's going on with these fits. The fits are still pretty terrible if I use an exponential or constant star formation history as well. As you can see, we are setting the redshift to be at what's given in the input data file. If you want to download the output file from BEAGLE (for the fit with the IRAC data), it's here:

https://dl.dropboxusercontent.com/u/20874192/1_BEAGLE.fits.gz

In addition, I think it would be really helpful to get a sample object and example parameter file based on the work presented in the BEAGLE paper so that I can test whether or not I understand how the fitting works. We were successful in getting the fitting to work for the mock catalogue data, but I don't quite understand why we're having so much trouble using real world data.

jacopo-chevallard commented 8 years ago

It looks like Beagle is not fitting the right fluxes... If you put your input files (photometric catalogue, filter transmission file and filter configuration file, parameter file) on Dropbox I'll take a look!

kevinhainline commented 8 years ago

Ok, here is the data file (the first object in the file is the one I was analyzing above), filterfrm.res, FILTERBIN.RES, the filters_CANDELS.dat file, and my filters.log file:

https://dl.dropboxusercontent.com/u/20874192/test_data.zip

Let me know if you need anything else!

jacopo-chevallard commented 8 years ago

Great, I'll take a look asap!

jacopo-chevallard commented 8 years ago

Hi Kevin, a couple of questions:

kevinhainline commented 8 years ago

I have not been able to get BEAGLE to run properly with any CANDELS object. All of the five in the data file in the Dropbox folder are randomly selected objects where I've made an attempt to fit them and the results are similar to what you see above.

jacopo-chevallard commented 8 years ago

Ok, this is kind of reassuring, since I doubt that the problem is in the physical model (otherwise we would have some good and some bad fits).

I'll keep looking!

I assume that you managed to fit the same data with other codes, i.e. we can exclude a problem in the photometric catalogue itself (e.g. apertures).

jacopo-chevallard commented 8 years ago

Kevin, can you, please, double check the transmission curves of CTIO U and VLT VIMOS U? In the filterfrm.res that you sent me, they cover the range 2.9 to 4.3 micron (CTIO U) and 3.3 to 4.2 micron (VIMOS U), so maybe there is a factor 10 in the wavelength scale? (Wavelength must be expressed in angstroms)

kevinhainline commented 8 years ago

Oh man, this seems like it was the issue. I changed the wavelength units for the CTIO and VLT filters in filterfrm.res, built the new filterbin, and then reran the fitting, which turned out much better:

image

So I guess we are now ready to go and run the fits on the full CANDELS sample! Thanks, Jacopo.

jacopo-chevallard commented 8 years ago

Great!!!

Thinking about this problem, I realized a few more things:

For the above points, I would probably run the fitting on a small random sub sample of CANDELS (500/1000 objects) using the original parameter file you sent me, and one implementing the above comments, then comparing the results.

jacopo-chevallard commented 8 years ago

Another thing: note that there is a hard limits of max 300 filters that can be defined in the filterfrm.res file, and you just reached this number. I'll create a new build_filterbin with a larger limit and push it asap

jacopo-chevallard commented 8 years ago

Commit bfb6d41aa30bcba1fc5ef210bddc1726daa976e3 allows you to use build_filterbin on a filterfrm.res file containing up to 500 different filters, and of maximum length of 200k lines (the wiki page https://github.com/jacopo-chevallard/BEAGLE-general/wiki/Adding-filters-to-FILTERBIN.RES has also been updated to note these changes)

jacopo-chevallard commented 8 years ago

For this you will need to use Beagle version > 0.5.6