BEAST-Fitting / beast

Bayesian Extinction And Stellar Tool
http://beast.readthedocs.io
23 stars 35 forks source link

Issue computing prior weights using Munari grid #170

Open meredith-durbin opened 6 years ago

meredith-durbin commented 6 years ago

I get an unexpected error while trying to build the physics model using Munari stellar atmospheres. It appears as though there is a complex number somewhere that scipy can't handle. This occurs about halfway through computing the age-mass-metallicity prior weights (i.e., it will run just fine for the first several metallicities, and then this error occurs). I'm using the grid file from https://cass.ucsd.edu/~lcj/beast/.

Any advice would be appreciated!

Traceback (most recent call last):
  File "run_beast.py", line 98, in <module>
    g_spec)
  File "/astro/store/gradscratch/tmp/mdurbin/beast_sandbox/e1_f2_munari/beast/physicsmodel/model_grid.py", line 204, in add_stellar_priors
    compute_age_mass_metallicity_weights(specgrid.grid, **kwargs)
  File "/astro/store/gradscratch/tmp/mdurbin/beast_sandbox/e1_f2_munari/beast/physicsmodel/grid_and_prior_weights.py", line 78, in compute_age_mass_metallicity_weights
    mass_prior_weights = compute_mass_prior_weights(cur_masses)
  File "/astro/store/gradscratch/tmp/mdurbin/beast_sandbox/e1_f2_munari/beast/physicsmodel/prior_weights.py", line 111, in compute_mass_prior_weights
    mass_bounds[i+1]))[0]
  File "/astro/apps6/opt/anaconda/envs/py3/lib/python3.5/site-packages/scipy/integrate/quadpack.py", line 323, in quad
    points)
  File "/astro/apps6/opt/anaconda/envs/py3/lib/python3.5/site-packages/scipy/integrate/quadpack.py", line 388, in _quad
    return _quadpack._qagse(func,a,b,args,full_output,epsabs,epsrel,limit)
TypeError: can't convert complex to float
karllark commented 6 years ago

I have not used these stellar atmospheres. But maybe it is not just the stellar atmospheres, but also the stellar evolutionary model used (isochrones). At least that would be my guess given the issue seems to be with the masses that should originate in the isochrones. No idea how a complex number got in there.

lcjohnso commented 6 years ago

Huh. I have not made any use of this spectral library after assembling the file, so likely there's something in the atmosphere file that isn't right. I'll take a look, but would advise using an alternate library for the time being.

karllark commented 6 years ago

Please try this again and see if it works with the latest version of the BEAST. May have been fixed by pull request #172.

lcjohnso commented 6 years ago

Please note: the fluxes in the previous version of the Munari library file were low by a factor of pi. Be sure to download the updated library file (available at UCSD link above) before using.

karllark commented 5 years ago

@lcjohnso : is this fixed now? Can I close this issue?

karllark commented 5 years ago

Ping