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

Error running BEAGLE 0.3.0 with the original example parameter file #8

Closed kevinhainline closed 8 years ago

kevinhainline commented 8 years ago

When I run BEAGLE 0.3.0 to see if it works with the mock catalogue generation parameter file originally provided, I get an error message:

% docker run --rm -it -v /Users/knh/Desktop/NIRCam/BEAGLE/BEAGLE-general-master:/BEAGLE_virtual_workdir --env-file env.list eclake/beagle:0.3.0 3 /BEAGLE_virtual_workdir/params/BEAGLE_Docker_test_1.param

 Reading Filter File: /BEAGLE_virtual_workdir/filters/FILTERBIN.RES
 298 filters defined, out of 300                                maximum     ...done
 ---> fixed                         sfh_type                                   0
 ---> fitted                        mass                                       0
 ---> random                        redshift                                   0
 ---> dependent                     nebular_logU                               0
 ---> fixed                         nebular_xi                                 0
 ---> dependent                     nebular_Z                                  0
 ---> fixed                         attenuation_type                           0
 ---> random                        tauV_eff                                   0
 ---> fixed                         mu                                         0
 ---> fitted                        tau                                        1
 ---> fitted                        metallicity                                1
 n_fitted:            3
 program_type:            3
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
         [ERROR: No input parameter for a "fitted" parameter type is present! ]
 [FUNCTION: "set_galaxy_parameters" ]
 [MODULE: "parameters_handling" ]
 [BACKTRACE:   
#0  0x7FD6FEBE8777
#1  0x535524 in print_backtrace at lib_messages.f90:299
#2  0x47DE24 in set_galaxy_parameters at parameters_handling.f90:442
#3  0x47E388 in __parameters_handling_MOD_set_and_change_galaxy_parameters at parameters_handling.f90:322
#4  0x4151BE in beagle at BEAGLE.f90:348
 ]
 [ ***************************************** ]
 [ ----> EXITING FUNCTION / SUBROUTINE <---- ]                                   
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 [ +++++ ERROR DETECTED: Do you want to continue with the execution of the program? (y/n)]
n

At the end of this message you can find the parameter file I was attempting to use. I assume that the error comes about because of the new updates which require me to specify the mock input parameters. In your email, you wrote:

Suppose I have a catalogue “my_catalogue.fits" containing some photometric data (e.g. two UV bands), and, in the same catalogue (though it can be in a different file as well), I have two other columns named “redshift" and “mass". If I set in the BEAGLE parameter file the keywords

MOCK INPUT PARAMETERS = fileName:my_catalogue.fits

and, for the parameters mass and redshift,

SF_PARAMETER    =   name:mass   type:from_file

PARAMETER       =   name:redshift   type:from_file 

I'm a little confused, why did you write "SF_PARAMETER" for the mass and "PARAMETER" for redshift? Is there a spot in the updated manual where I can read more about this?

# 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 = 994188

#****************************************************************
#******************** 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

#EMISSION LINES CONFIGURATION = 

SHRINK TEMPLATES WL RANGE = 900 60000
#REBIN TEMPLATES = 10

#SPECTRAL INDICES CONFIGURATION =

#SPECTRAL INDICES CATALOGUE = 

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

FILTERS FILE = $BEAGLE_FILTERS/filters_XDF.dat

#PHOTOMETRIC CATALOGUE = $BEAGLE_DATA/

FIT PHOTOMETRY = F

#****************************************************************
#******************** (MOCK) OBSERVATIONS ***********************
#****************************************************************

#MOCK SPECTRUM WL RANGE = 3500. 5400.
#MOCK SPECTRUM S/N = 20.

# MOCK PARAMETERS
MOCK INPUT PARAMETERS = 

# Whether to print FITS file containing mock spectra and photometry, one file per object
PRINT MOCK PHOTOMETRY = T
PRINT MOCK SPECTRUM = T

# Whether to print FITS file containing mock spectra and photometry, one file per object
#PRINT PHOTOMETRY = T
#PRINT SPECTRUM = T

N_OBJECTS = 10

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

# File containing set of radiativa 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:delayed

# 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:[7.,12.] 

#****************************************************************
#***************  OTHER SF PARAMETERS ***************************
#****************************************************************
# To be used if you want to allow current sfr to be and independent parameter

# In log(M_sun/yr)
#SF_PARAMETER  = name:specific_sfr                      type:fitted  order_priority:1   prior:distribution:uniform  prior:range:[-12.,-8.]  

# in log(yr)
#SF_PARAMETER  = name:current_sfr_timescale        type:fixed  value:8.

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

RESULTS DIRECTORY = $BEAGLE_RESULTS/BEAGLE_Docker_test_1

MOCK CATALOGUE NAME = my_first_test

#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

PARAMETER  = name:redshift          mock:type:random   prior:distribution:uniform  prior:range:[0.,15.]

PARAMETER  = name:nebular_logU      mock:type:dependent

PARAMETER  = name:nebular_xi        mock:type:fixed    value:0.3

PARAMETER  = name:nebular_Z         mock:type:dependent 

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

PARAMETER  = name:tauV_eff          mock:type:random   prior:distribution:uniform   prior:range:[0.,2.]

PARAMETER  = name:mu                mock:type:fixed    value:0.4
...
jacopo-chevallard commented 8 years ago

The problem is caused by the use of the option 3 (mock catalogue creation), while some parameters or set to type:fitted, which is not supported (fitted parameters can be used with option 1). You should be consistent when using option 3 and define the parameters following Emma's example, e.g. mock:type:random mock:distribution:uniform mock:range:[-4.,-2.].

For the SF_PARAMETER, you can just look at Sec. 5.1 of the manual: all the parameters listed in that section must be defined using the SF_PARAMETER keyword instead of the PARAMETER.

Let me know if this solves!

eclake commented 8 years ago

Actually that's completely my fault! That's the file that I had put up, sorry @kevinhainline - I had never noticed that before and it's interesting that we didn't get an error with it for the previous version! I've just edited the gitHub version to fix it. We still haven't implemented many checks and measures for the parameter file but it's something that we will be doing in the future!

Sorry for that difficulty - but what @jacopo-chevallard wrote is exactly right and should have solved that problem, please let us know if it hasn't.

jacopo-chevallard commented 8 years ago

Closing, since @kevinhainline feedback on #11 suggests that this issue must be considered solved as well