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 while fitting Photometry: #85

Closed lukasfurtak closed 5 years ago

lukasfurtak commented 5 years ago

Hi again,

I now also get this new error when running the same parameter file as in issue #84 with the parameter sfr switched on, i.e. uncommented and fitted.

---> fitted: mass
 ---> fitted: redshift
 ---> fitted: tau
 ---> fitted: max_stellar_age
 ---> fitted: metallicity
 ---> fitted: sfr
 ---> fitted: tauv_eff
 n_fitted:            7
 *****************************************************
 MultiNest v3.9
 Copyright Farhan Feroz & Mike Hobson
 Release Oct 2014

 no. of live points =  150
 dimensionality =    7
 *****************************************************
 Starting MultiNest
 generating live points
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 [ERROR: "locate" failed, the condition x(i) <= x < x(i+1) is not satisfied, for x=NaN           , x(i)=-3.30103      , x(i+1)=-3.00000 ]
 [FUNCTION: "locate_sp" ]
 [MODULE: "lib_interpolation" ]
 [BACKTRACE:   
#0  0x7f6a0872737a in ???
#1  0x5592dcdd8759 in print_backtrace
        at /root/src/github.com/jacopo-chevallard/BEAGLE/build/dependencies/astrofortran-src/src/lib_messages.f90:870
#2  0x5592dcdd92ef in __lib_messages_MOD_printerror
        at /root/src/github.com/jacopo-chevallard/BEAGLE/build/dependencies/astrofortran-src/src/lib_messages.f90:390
#3  0x5592dd0834e7 in __lib_interpolation_MOD_locate_sp
        at /root/src/github.com/jacopo-chevallard/BEAGLE/build/dependencies/astrofortran/src/lib_interpolation.f90:301
#4  0x5592dd08947b in __lib_interpolation_MOD_get_linear_weights_sp
        at /root/src/github.com/jacopo-chevallard/BEAGLE/build/dependencies/astrofortran/src/lib_interpolation.f90:2963
#5  0x5592dd08abfd in __lib_interpolation_MOD_linear_interpolate_grid_2d_sp
        at /root/src/github.com/jacopo-chevallard/BEAGLE/build/dependencies/astrofortran/src/lib_interpolation.f90:2311
#6  0x5592dd0337ee in __sps_routines_MOD_get_sps_spectra_age_z
        at /root/src/github.com/jacopo-chevallard/BEAGLE/src/SPS_routines.f90:164
#7  0x5592dcf7cd4b in __galaxy_sed_MOD_compute_sed
        at /root/src/github.com/jacopo-chevallard/BEAGLE/src/galaxy_SED.f90:301
#8  0x5592dcfcb519 in __likelihood_function_MOD_likelihood
        at /root/src/github.com/jacopo-chevallard/BEAGLE/src/likelihood_function.f90:203
#9  0x5592dcfd168b in __likelihood_function_MOD_mc_likelihood
        at /root/src/github.com/jacopo-chevallard/BEAGLE/src/likelihood_function.f90:120
#10  0x5592dcbf5dce in getloglike
        at /root/src/github.com/jacopo-chevallard/BEAGLE/build/dependencies/mcfor-src/src/nested_sampling.f90:224
#11  0x5592dcc2f802 in __nested_MOD_gen_initial_live
        at /root/src/github.com/jacopo-chevallard/BEAGLE/build/dependencies/multinest-src/nested.F90:536
#12  0x5592dcc30ee2 in __nested_MOD_nestsample
        at /root/src/github.com/jacopo-chevallard/BEAGLE/build/dependencies/multinest-src/nested.F90:352
#13  0x5592dcc3227b in __nested_MOD_nestrun
        at /root/src/github.com/jacopo-chevallard/BEAGLE/build/dependencies/multinest-src/nested.F90:239
#14  0x5592dcbf631c in __nested_sampling_MOD_run_nested_sampling
        at /root/src/github.com/jacopo-chevallard/BEAGLE/build/dependencies/mcfor-src/src/nested_sampling.f90:137
#15  0x5592dcbe963a in __prosit_MOD_sample_pdf
        at /root/src/github.com/jacopo-chevallard/BEAGLE/build/dependencies/mcfor-src/src/PROSIT.f90:322
#16  0x5592dcbae23e in beagle
        at /root/src/github.com/jacopo-chevallard/BEAGLE/src/BEAGLE.f90:636
#17  0x5592dcbaa316 in main
        at /root/src/github.com/jacopo-chevallard/BEAGLE/src/BEAGLE.f90:6
 ]
 [ ***************************************** ]
 [ ----> EXITING FUNCTION / SUBROUTINE <---- ]
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 [ ***** STOPPING PROGRAM ***** ]

Here are my parameter files for this particular issue:

lukasfurtak commented 5 years ago

beagle_test_sfr.tar.gz

Sorry, forgot to upload input files

steveschulze commented 5 years ago

Hi,

I can fit SEDs with v0.19 without a problem, but the latest version returns the same error.

Is there something like a log about changes in BEAGLE? I have finally finished building a photometry catalogue of a very large sample of galaxies. Fitting their SEDs will take approximately a week. So, It would be good to know more about the changes between different versions to decide on how relevant a re-fitting would be.

Cheers,

Steve

jacopo-chevallard commented 5 years ago

@steveschulze we have a changelog, but it's not yet currently accessible to everyone, but you're definitely right that it's very useful to make it available to all Beagle users, I'll take a look at possible solutions

steveschulze commented 5 years ago

Thanks Jacopo. :) This would be very useful.

jacopo-chevallard commented 5 years ago

@steveschulze the Beagle changelog can now be accessed here https://beagle.netlify.com/

lukasfurtak commented 5 years ago

@jacopo-chevallard apparently the error above only appears when sfh_type is set to rising. The exact same parameter file works fine when it is set to exponential or constant sfh.

jacopo-chevallard commented 5 years ago

and here as well, @lukasfurtak and @steveschulze can you check with version 0.23.0?

steveschulze commented 5 years ago

Hi Jacopo,

thanks for fixing that. I am currently on vacation until the 18th. After that, I have access to a computer again.

Cheers,

Steve

lukasfurtak commented 5 years ago

@jacopo-chevallard For me this error message still shows in version 0.23.0 but now also when sfh_type is set to delayed. It works for constant though.

And for a rising SFH the error is now (in version 0.23.0):

[ERROR: `Inf` or `NaN` detected in the star formation history `chem_abund` array! ]
 [FUNCTION: "get_star_formation_history" ]
 [MODULE: "star_formation" ]

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
jacopo-chevallard commented 5 years ago

@lukasfurtak I can reproduce the error with the rising SFH, while it works with delayed and the others (I'm using the parameter file you attached in this issue), can you check again that you didn't change anything else in the other test in which you got an error for the delayed?

jacopo-chevallard commented 5 years ago

I think I found the problem with the rising SFH, it's related to the prior you're using on tau. The minimum allowed tau in your parameter file is log(tau) = 6, and this makes the exponential function in a rising SFH explode, try to compute exp(t/tau) for t > 10^8 and tau=10^6, it goes well beyond what single precision floating points can record, and this is why you get Infinity. If you restrict your prior to more manageable values, e.g. prior:range:[8.,9.], or even prior:range:[7.,9.], it runs without errors ! Can you check by yourself and confirm? (see also my comment above)

jacopo-chevallard commented 5 years ago

@lukasfurtak let me know if we can close this

lukasfurtak commented 5 years ago

Hi @jacopo-chevallard ! I’m sorry for taking so long to respond, I tested the rising SFH with the prior ranges you suggested and this now seems to work. The delayed SFH also works again so I think all of these issues have been taken care of. Thank you for your help! Closing ;)