Exemple #1
0
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')
Exemple #2
0
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')
Exemple #3
0
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')
Exemple #4
0
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')