Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modelFitEMCEE error: local variable 'modelset' referenced before assignment #164

Open
davesahman opened this issue Jul 7, 2022 · 1 comment

Comments

@davesahman
Copy link

Hi Adam,

I hit a problem when running the modelFitEMCEE routine. See the attached extract from a Jupyter notebook for details. Hope this is an easy fix!
Cheers,
Dave.

@davesahman
Copy link
Author

Hi Adam,

It looks like I didnt attach the error text to my original message. Here it is:-

from astropy.io import fits
import astropy.units as u
import numpy as np
import splat
import splat.plot as splot
import splat.photometry as sphot
import splat.empirical as semp
import splat.model as spmod
xx = splat.empirical.typeToTeff(20)
teff,teff_e = semp.typeToTeff("M7")
teff,teff_e

(<Quantity 2655.2141656 K>, <Quantity 100. K>)

sp = splat.getSpectrum(shortname='0415-0935')[0]

Retrieving 1 file

emcee_result = spmod.modelFitEMCEE(sp,t0=teff,g0=5.0,fit_metallicity=False,model='BTSettl2008',nwalkers=50,nsamples=500,output='test_modelfitEMCEE-1')


UnboundLocalError Traceback (most recent call last)
/tmp/ipykernel_30983/1114820490.py in
----> 1 emcee_result = spmod.modelFitEMCEE(sp,t0=teff,g0=5.0,fit_metallicity=False,model='BTSettl2008',nwalkers=50,nsamples=500,output='test_modelfitEMCEE-1')

~/.local/lib/python3.8/site-packages/splat/model.py in modelFitEMCEE(specin, mset, instrument, initial, nofit, nwalkers, nsamples, threads, burn, propose_scale, verbose, **kwargs)
4180
4181 # check model name
-> 4182 modelset = kwargs.get('model', modelset)
4183 modelset = kwargs.get('set', modelset)
4184 modelset = kwargs.get('model_set', modelset)

UnboundLocalError: local variable 'modelset' referenced before assignment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant