def make_plots(dirname, fnames): # get the highest-level directory, assume it is the target source ID obj = os.path.split(dirname)[-1] for fn in fnames: # each band gets listed... if 'band0' not in fn or '.sav' not in fn: continue # templates: # coadd_cleanband0in_clean_music_20130815_jk000.sav # 130820_ob1_band0i_clean_music_20130815_map.sav obs = "_".join(fn.split("_")[:2]) #obs = fn[:11] print "Working on file ",os.path.join(dirname,obs) data = load_data(os.path.join(dirname,obs)) sm,us = convolve_and_match(data,obj,writefits=False) flux,bg,err = sed_from_dict(sm) pl.clf() plot_sed(flux,bg,err, label='Smooth') flux,bg,err = sed_from_dict(us) plot_sed(flux,bg,err, label='Unsharp') pl.title(obj) pl.legend(loc='best') pl.savefig(os.path.join(dirname,obj+obs)+"_SED.png",bbox_inches='tight')
def make_plots(dirname, fnames): # get the highest-level directory, assume it is the target source ID obj = os.path.split(dirname)[-1] for fn in fnames: # each band gets listed... if 'band0' not in fn or '.sav' not in fn: continue # templates: # coadd_cleanband0in_clean_music_20130815_jk000.sav # 130820_ob1_band0i_clean_music_20130815_map.sav obs = "_".join(fn.split("_")[:2]) #obs = fn[:11] print "Working on file ", os.path.join(dirname, obs) data = load_data(os.path.join(dirname, obs)) sm, us = convolve_and_match(data, obj, writefits=False) flux, bg, err = sed_from_dict(sm) pl.clf() plot_sed(flux, bg, err, label='Smooth') flux, bg, err = sed_from_dict(us) plot_sed(flux, bg, err, label='Unsharp') pl.title(obj) pl.legend(loc='best') pl.savefig(os.path.join(dirname, obj + obs) + "_SED.png", bbox_inches='tight')
def make_plots(dirname, fnames): obj = os.path.split(dirname)[-1] for fn in fnames: # each band gets listed... if 'band0' not in fn: continue obs = fn[:11] print "Working on file ", os.path.join(obj, obs) data = load_data(os.path.join(obj, obs)) sm, us = convolve_and_match(data, 'W49', writefits=False) flux, bg, err = sed_from_dict(sm) pl.clf() plot_sed(flux, bg, err, label='Smooth') flux, bg, err = sed_from_dict(us) plot_sed(flux, bg, err, label='Unsharp') pl.title(obj) pl.legend(loc='best') pl.savefig(os.path.join(obj, obs) + "_SED.png", bbox_inches='tight')
def make_plots(dirname, fnames): obj = os.path.split(dirname)[-1] for fn in fnames: # each band gets listed... if 'band0' not in fn: continue obs = fn[:11] print "Working on file ",os.path.join(obj,obs) data = load_data(os.path.join(obj,obs)) sm,us = convolve_and_match(data,'W49',writefits=False) flux,bg,err = sed_from_dict(sm) pl.clf() plot_sed(flux,bg,err, label='Smooth') flux,bg,err = sed_from_dict(us) plot_sed(flux,bg,err, label='Unsharp') pl.title(obj) pl.legend(loc='best') pl.savefig(os.path.join(obj,obs)+"_SED.png",bbox_inches='tight')
def make_plots(dirname, fnames): # get the highest-level directory, assume it is the target source ID obj = os.path.split(dirname)[-1] for fn in fnames: # each band gets listed... if 'band0' not in fn or '.sav' not in fn: continue # templates: # coadd_cleanband0in_clean_music_20130815_jk000.sav # 130820_ob1_band0i_clean_music_20130815_map.sav obs = "_".join(fn.split("_")[:2]) #obs = fn[:11] print "Working on file ",os.path.join(dirname,obs) data = load_data(os.path.join(dirname,obs)) headers = {k: load_header(data[k].mapstruct) for k in data} sm,us = convolve_and_match(data,obj,headers=headers,writefits=True,savepath=dirname) vmin = -1000 #max([sm[2].min(),-1000]) vmax = max([sm[2].max(),5000]) print obj, obs, vmin, vmax prefix = os.path.join(dirname,obj+obs) pl.clf() viewer(data, vmin=vmin, vmax=vmax, cb=True) pl.suptitle(obj) pl.savefig(prefix+"_quicklook.png",bbox_inches='tight') pl.clf() dictviewer(sm, vmin=vmin, vmax=vmax, cb=True) pl.suptitle(obj) pl.savefig(prefix+"_quicklook_smooth.png",bbox_inches='tight') pl.clf() dictviewer(us, vmin=vmin, vmax=vmax, cb=True) pl.suptitle(obj) pl.savefig(prefix+"_quicklook_unsharp.png",bbox_inches='tight')