# curves # ids = where(r<=rsbfit) # r = r[ids] # sb_src[instrument] = sb_src[instrument][ids] # sb_bg[instrument] = sb_bg[instrument][ids] # sb_src_err[instrument] = sb_src_err[instrument][ids] # sb_bg_err[instrument] = sb_bg_err[instrument][ids] n = len(r) # create the control the plot if MAKE_CONTROL_PLOT=="True": outfig = sb_file[instrument]+'.'+fitid+'.png' print "Creating control plot :: ", instrument, outfig plot_sb_profile(r, sb_src[instrument], sb_src_err[instrument], sb_bg[instrument], sb_bg_err[instrument], outfig) print "SB curves loaded!" ###################################################################### # do the actual fitting outpickle = sb_file[instruments[0]]+'.'+fitid+'.pk' outpickle = outpickle.replace(instruments[0], 'joint') if MODEL=="beta": fit_beta_model_joint(r, sb_src, sb_src_err, instruments, theta, energy, outpickle) if MODEL=="v06": fit_v06_model_joint(r, sb_src, sb_src_err, instruments, theta, energy, outpickle)
ids = where(r <= r500_pix) r = r[ids] sb_src = sb_src[ids] sb_bg = sb_bg[ids] sb_src_err = sb_src_err[ids] sb_bg_err = sb_bg_err[ids] n = len(r) ###################################################################### # control plot if MAKE_CONTROL_PLOT == "True": outfig = fname + "." + fitid + ".png" plot_sb_profile(r, sb_src, sb_src_err, sb_bg, sb_bg_err, outfig) os.system("open " + outfig) ###################################################################### # do the actual fitting outpickle = fname + "." + fitid + ".pk" if MODEL == "beta": fit_beta_model(r, sb_src, sb_src_err, instrument, theta, energy, outpickle) if MODEL == "v06": fit_v06_model(r, sb_src, sb_src_err, instrument, theta, energy, outpickle) print "done!"