Skip to content

Python module for MCMC blackbody fits to multi-band photometric measurements of astronomical objects

License

Notifications You must be signed in to change notification settings

virajkaram/bbFit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bbFit

Python module for MCMC blackbody fits to multi-band photometric measurements of astronomical objects

Usage :

from bbFit import BBFit

mags = np.array([19,20])
magerrs = np.array([0.1,0.1])
wav_names = np.array(['g','r'])
wavs = np.array([0.46,0.66])*1e-4   # wavelength in cm
As = np.array([Ag, Ar])             # Ag, Ar from NED
zpt = np.array([3631]*len(wavs))    # zeropoint in Jy of the photometric system used (3631 for AB)
dist = 3e18                          # cm, 
disterr = 0.1*3e18                        # cm 


bb = BBFit(mags,magerrs,wavs,zpt,dist,disterr=disterr,As=As)
bb.mag2fnu()
bb.ext_corr()
bb.calc_Lnu()

#Fit 2-dim BB model to data
pri_type = 'uniform'
Tpripars = (3.0,4.5)                                # Temperature prior in log space
Rpripars = (10,16)                                  # Photospheric radius prior in log space
pos = (3.5,13) + (0.05,0.1)*np.random.randn(32, 2)  # Initial values for chains in log space
flat_samples = bb.mcmc_fit(pri_type,Tpripars,Rpripars,nchain=10000,pos=pos,prilog=True,plot=True)
    
bb.print_estimates(scale=1)                         # Print estimated values
bbfits_temp_estimates = list(np.percentile(10**flat_samples[:,0],[5,50,95]))
bbfits_rs_estimates = list(np.percentile(10**flat_samples[:,1],[5,50,95]))
bbfits_lums = list(np.percentile(10**flat_samples[:,2],[5,50,95]))

About

Python module for MCMC blackbody fits to multi-band photometric measurements of astronomical objects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages