splat/model.py
def _modelFitEMCEE_plotbestcomparison(spec,mparam,file,**kwargs):
    '''
    for now just plotting best model
    would like to do draws from posterior instead
    '''

# extract best fit values
    mplabels = ['teff','logg','z']
    mkwargs = copy.deepcopy(kwargs)
    mlegend = r''
#    print(mparam)
    for i,m in enumerate(mparam):
        mkwargs[mplabels[i]] = m
        mlegend+='{:s}={:.2f} '.format(SPECTRAL_MODEL_PARAMETERS[mplabels[i]]['title'],float(m))
#    print(mkwargs)
    mdl = loadModel(**mkwargs)
#    print(mdl.teff,mdl.logg)
    stat,scl = compareSpectra(spec,mdl,**kwargs)
    mdl.scale(scl)
    return splot.plotSpectrum(spec,mdl,spec-mdl,colors=['k','b','grey'],uncertainty=True,telluric=True,file=file,\
        legend=[spec.name,mlegend,r'difference ($\chi^2$ = {:.0f})'.format(stat)])

    for now just plotting best model
    would like to do draws from posterior instead
    
for now just plotting best model
would like to do draws from posterior instead
for now just plotting best model would like to do draws from posterior instead
def _modelFitEMCEE_plotbestcomparison(spec,mparam,file,**kwargs):
    mplabels = ['teff','logg','z']
    mkwargs = copy.deepcopy(kwargs)
    mlegend = r''
    for i,m in enumerate(mparam):
        mkwargs[mplabels[i]] = m
        mlegend+='{:s}={:.2f} '.format(SPECTRAL_MODEL_PARAMETERS[mplabels[i]]['title'],float(m))
    mdl = loadModel(**mkwargs)
    stat,scl = compareSpectra(spec,mdl,**kwargs)
    mdl.scale(scl)
    return splot.plotSpectrum(spec,mdl,spec-mdl,colors=['k','b','grey'],uncertainty=True,telluric=True,file=file,\
        legend=[spec.name,mlegend,r'difference ($\chi^2$ = {:.0f})'.format(stat)])
def _modelFitEMCEE_plotbestcomparison ( spec , mparam , file , ** kwargs ) : mplabels = [ 'teff' , 'logg' , 'z' ] mkwargs = copy . deepcopy ( kwargs ) mlegend = r'' for i , m in enumerate ( mparam ) : mkwargs [ mplabels [ i ] ] = m mlegend += '{:s}={:.2f} ' . format ( SPECTRAL_MODEL_PARAMETERS [ mplabels [ i ] ] [ 'title' ] , float ( m ) ) mdl = loadModel ( ** mkwargs ) stat , scl = compareSpectra ( spec , mdl , ** kwargs ) mdl . scale ( scl ) return splot . plotSpectrum ( spec , mdl , spec - mdl , colors = [ 'k' , 'b' , 'grey' ] , uncertainty = True , telluric = True , file = file , legend = [ spec . name , mlegend , r'difference ($\chi^2$ = {:.0f})' . format ( stat ) ] )
for now just plotting best model
would like to do draws from posterior instead
for now just plotting best model would like to do draws from posterior instead
'''
    for now just plotting best model
    would like to do draws from posterior instead
    ''' # extract best fit values #    print(mparam) #    print(mkwargs) #    print(mdl.teff,mdl.logg)
spec
mparam
file