Open kevinhainline opened 8 years ago
Hi Kevin,
Yup, I've noticed this behaviour recently - it happens when you are using a parameter file containing 'type:fitted' but want to use the file to produce mock photometry. Currently these are in the SF BIN #1
and "OTHER SF PARAMETERS" sections. You will have to change them to mock:type:your_chosen_parameter where [your_chosen_parameter] is probably 'fixed' (then you will have to supply mock:value:your_value or 'random' and then you will have to supply mock:distribution:your_chosen_distribution_type and mock:range:[min_val,max_val]
e.g.
# In log(yr)
SF_PARAMETER = name:tau type:fitted order_priority:1 prior:distribution:uniform prior:range:[7.,10.0]
change to:
# In log(yr)
SF_PARAMETER = name:tau mock:type:random mock:distribution:uniform mock:range:[7.,10.0]
although if you want to produce an ssp then you should not be asking for a range of tau values in the mock catalogue.
It was an error I had in the original BEAGLE_Docker_test_1.param file but has since been fixed, you can take a look there. Let me know if you still have problems.
Ah, ok! Thanks for the quick reply. I've updated the parameter file, and when I run things, I get:
% docker run --rm -it -v /Users/knh/Desktop/NIRCam/BEAGLE/BEAGLE-general-master:/BEAGLE_virtual_workdir --env-file env.list eclake/beagle:0.3.5 3 /BEAGLE_virtual_workdir/params/BEAGLE_burst_test.param
Reading Filter File: /BEAGLE_virtual_workdir/filters/FILTERBIN.RES
298 filters defined, out of 300 maximum ...done
---> fixed sfh_type 0
---> random metallicity 0
---> random mass 0
---> random specific_sfr 0
---> random redshift 0
---> fixed formation_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
n_fitted: 0
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
Backtrace for this error:
#0 0x7F0778DE0777
#1 0x7F0778DE0D7E
#2 0x7F077851CD3F
#3 0x7F0778EB6DCC
#4 0x45C171 in __io_nebular_emission_MOD_print_nebular_emission_parameters at io_nebular_emission.f90:212
#5 0x49477D in __io_results_MOD_write_results_to_buffer at io_results.f90:309 (discriminator 4)
#6 0x4657F2 in __mock_observations_MOD_create_mock_observation at mock_observations.f90:304
#7 0x4151E8 in beagle at BEAGLE.f90:378
here is the updated 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 = 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_NIRCat.dat
#PHOTOMETRIC CATALOGUE = $BEAGLE_DATA/
FIT PHOTOMETRY = F
#****************************************************************
#******************** (MOCK) OBSERVATIONS **********************
#****************************************************************
#MOCK SPECTRUM WL RANGE = 3500. 5400.
#MOCK SPECTRUM S/N = 20.
# 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:ssp
# In log(yr)
#SF_PARAMETER = name:tau type:fitted order_priority:1 prior:distribution:uniform prior:range:[7.,10.0]
# in log(Z/Z_sun)
#SF_PARAMETER = name:metallicity type:fitted order_priority:1 prior:distribution:uniform prior:range:[-2.2,0.24]
SF_PARAMETER = name:metallicity mock:type:random 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:[9.,12.]
SF_PARAMETER = name:mass mock:type:random order_priority:0 prior:distribution:uniform prior:range:[9.,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:[-14.,-6.]
SF_PARAMETER = name:specific_sfr mock:type:random prior:distribution:uniform prior:range:[-14.,-6.]
# in log(yr)
#SF_PARAMETER = name:current_sfr_timescale type:fixed value:8.
#****************************************************************
#******************** PRINTED OUTPUT ***************************
#****************************************************************
RESULTS DIRECTORY = $BEAGLE_RESULTS/BEAGLE_burst_test
MOCK CATALOGUE NAME = burst_test_1
#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:[4.,10.]
PARAMETER = name:formation_redshift mock:type:fixed value:10.0
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
Ah, it seems as if it runs when I remove "order_priority:0" from the line:
SF_PARAMETER = name:mass mock:type:random order_priority:0 prior:distribution:uniform prior:range:[9.,12.]
So, I think that is what was going on. Thanks for your help!
This sounds strange... Can you also try to replace, e.g.
PARAMETER = name:tauV_eff mock:type:random prior:distribution:uniform prior:range:[0.,2.]
with
PARAMETER = name:tauV_eff mock:type:random mock:distribution:uniform mock:range:[0.,2.]
The prior:
token should, in principle, be used when fitting, and the mock:
one when creating catalogues. In the end, the catalogue creation should work also if you use prior:
instead of mock:
, but I'm wondering if this is the problem...
I've changed all of the prior
tokens to read mock
, as shown in the parameter file at the end. I'm still getting these errors every once in a while, although typing "y" causes the program to keep running and produces a full set of mock galaxies. Perhaps this is just my setting the parameters weird with respect to my random limits.
% docker run --rm -it -v /Users/knh/Desktop/NIRCam/BEAGLE/BEAGLE-general-master:/BEAGLE_virtual_workdir --env-file env.list eclake/beagle:0.3.5 3 /BEAGLE_virtual_workdir/params/BEAGLE_burst_test.param
Reading Filter File: /BEAGLE_virtual_workdir/filters/FILTERBIN.RES
298 filters defined, out of 300 maximum ...done
---> fixed sfh_type 0
---> random tau 0
---> random metallicity 0
---> random mass 0
---> random specific_sfr 0
---> random redshift 0
---> fixed formation_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
n_fitted: 0
--- LINEAR: X0 = 7.749E+02 is outside X range --- 9.000E+02 6.010E+04 11742
--- Error reported only once. It may occur more than once. ---
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[ERROR: Root must be bracketed between x1 and x2! ]
[FUNCTION: "bisec_newton_raphson_sp" ]
[MODULE: "lib_root_finding" ]
[BACKTRACE:
#0 0x7EFC89D09777
#1 0x536B34 in print_backtrace at lib_messages.f90:299
#2 0x5710B4 in __lib_root_finding_MOD_bisec_newton_raphson_sp at lib_root_finding.f90:49
#3 0x41E7F8 in fill_current_sfr_bin at star_formation.f90:1333
#4 0x466D0D in __galaxy_sed_MOD_compute_sed at galaxy_SED.f90:159
#5 0x4151CA in beagle at BEAGLE.f90:376
]
[ ***************************************** ]
[ ----> EXITING FUNCTION / SUBROUTINE <---- ]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[ +++++ ERROR DETECTED: Do you want to continue with the execution of the program? (y/n)]
Here is the 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 = 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_NIRCat.dat
#PHOTOMETRIC CATALOGUE = $BEAGLE_DATA/
FIT PHOTOMETRY = F
#****************************************************************
#******************** (MOCK) OBSERVATIONS **********************
#****************************************************************
#MOCK SPECTRUM WL RANGE = 3500. 5400.
#MOCK SPECTRUM S/N = 20.
# Whether to print FITS file containing mock spectra and photometry, one file per object
PRINT PHOTOMETRY = T
PRINT SPECTRUM = T
N_OBJECTS = 100
#****************************************************************
#******************** 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:exponential
# In log(yr)
SF_PARAMETER = name:tau mock:type:random mock:distribution:uniform mock:range:[7.0,10.0]
# in log(Z/Z_sun)
SF_PARAMETER = name:metallicity mock:type:random mock:distribution:uniform mock:range:[-2.2,0.24]
# In log M/M_sun
SF_PARAMETER = name:mass mock:type:random mock:distribution:uniform mock:range:[9.,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 mock:type:random prior:distribution:uniform prior:range:[-14.,-6.]
# in log(yr)
#SF_PARAMETER = name:current_sfr_timescale type:fixed value:8.
#****************************************************************
#******************** PRINTED OUTPUT ***************************
#****************************************************************
RESULTS DIRECTORY = $BEAGLE_RESULTS/BEAGLE_burst_test_z
MOCK CATALOGUE NAME = burst_test_4.0_9.0
#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 mock:distribution:uniform mock:range:[4.0,9.0]
PARAMETER = name:formation_redshift mock:type:fixed value:10.0
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 mock:distribution:uniform mock:range:[0.,2.]
PARAMETER = name:mu mock:type:fixed value:0.4
Update: above, I recognize that the prior:distribution:uniform prior:range:[-14.,-6.]
should read mock:distribution:uniform mock:range:[-14.,-6.]
, but that doesn't change the [ERROR: Root must be bracketed between x1 and x2! ]
error.
The error does go away if I set things to be either:
SF_PARAMETER = name:specific_sfr mock:type:dependent
or
SF_PARAMETER = name:specific_sfr mock:type:fixed value:-8.
So, I wonder if BEAGLE is having a hard time with some of the mock sSFR values it is picking with respect to the exponentially declining SF models. At the moment, when I am picking random sSFR values, I just tell BEAGLE to continue each time it runs into the error, and eventually an output file with the appropriate number of mock galaxies is produced.
To summarize, there are two open issues:
removing the order_priority:
token in a mock:type:
parameter removes the error
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
Backtrace for this error:
#0 0x7F0778DE0777
#1 0x7F0778DE0D7E
#2 0x7F077851CD3F
#3 0x7F0778EB6DCC
#4 0x45C171 in __io_nebular_emission_MOD_print_nebular_emission_parameters at io_nebular_emission.f90:212
#5 0x49477D in __io_results_MOD_write_results_to_buffer at io_results.f90:309 (discriminator 4)
#6 0x4657F2 in __mock_observations_MOD_create_mock_observation at mock_observations.f90:304
#7 0x4151E8 in beagle at BEAGLE.f90:378
but I still have to understand why the error appeared in the first place.
with you current parameter files you (sometimes) get the error
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[ERROR: Root must be bracketed between x1 and x2! ]
[FUNCTION: "bisec_newton_raphson_sp" ]
[MODULE: "lib_root_finding" ]
[BACKTRACE:
#0 0x7EFC89D09777
#1 0x536B34 in print_backtrace at lib_messages.f90:299
#2 0x5710B4 in __lib_root_finding_MOD_bisec_newton_raphson_sp at lib_root_finding.f90:49
#3 0x41E7F8 in fill_current_sfr_bin at star_formation.f90:1333
#4 0x466D0D in __galaxy_sed_MOD_compute_sed at galaxy_SED.f90:159
#5 0x4151CA in beagle at BEAGLE.f90:376
]
[ ***************************************** ]
[ ----> EXITING FUNCTION / SUBROUTINE <---- ]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
The above error arises indeed because no root can be found to solve the equation that allows Beagle to obtain a value for the SFR starting from a value for the sSFR and a total mass. I know where to look, but I don't have time now (and Emma is away till the end of next week, I think).
However, since the code seems to work if you say "yes" after the error appears, you can set
VERBOSE = 0
in your parameter file: this will remove all error messages, so the program won't stop anymore. But remember to put back VERBOSE = 0
in your param files, since getting these errors is important!
Hello! I am using BEAGLE 0.3.5 to generate a large number of mock galaxies with a very specific star formation history. I've included the parameter file we're using, below. When I run things, however:
This also happens when I try to run the original docker mock galaxy test:
If I use the original BEAGLE release on the same file, everything runs fine, but if I try to do the same on my new parameter file:
So there must be a few different things going on here. First, it seems as if the updated BEAGLE 0.3.5 mock galaxy production requires something I'm not giving BEAGLE in the parameters file. Second, it seems as if maybe my mock input parameters are not working with even the original version of BEAGLE. I'm just trying to look at the NIRCam photometry for galaxies with only a burst of star formation at z ~ 10 between z = 4 - 10.
Here's my parameters file: