コード例 #1
0
def sedplots(cat, root, outdir, redo=False):
    if not exists(outdir):
        os.mkdir(outdir)
    
    ids = cat.get('segmid', cat.id).round().astype(int)
    b=sedplotAB.bpzPlots(root, ids, probs=None)
    redo = redo in [True, 'sed']
    b.flux_comparison_plots(show_plots=0, save_plots='png', colors={}, nomargins=0, outdir=outdir, redo=redo)
コード例 #2
0
def sedplots(cat, root, outdir, redo=False):
    if not os.path.exists(outdir):
        os.mkdir(outdir)

    ids = cat.get('segmid', cat.id).round().astype(int)
    b = sedplotAB.bpzPlots(root, ids, probs=None)
    redo = redo in [True, 'sed']
    b.flux_comparison_plots(show_plots=0, save_plots='png', colors={
    }, nomargins=0, outdir=outdir, redo=redo)
コード例 #3
0
ファイル: webpageBPZ.py プロジェクト: albertfxwang/python
SEDoutdir = outdir+'/sedplots'
if os.path.exists(pAnINPUT[0]+SEDoutdir): # checking if the directory excists
    if args.verbose: print ':: '+sys.argv[0]+' :: html/sedplots directory already exists'
else:                                  # if not move it
    if args.verbose: print ':: '+sys.argv[0]+' :: creating html/sedplot directory'
    os.mkdir(SEDoutdir)

PROBoutdir= outdir+'/probplots'
if os.path.exists(pAnINPUT[0]+PROBoutdir): # checking if the directory excists
    if args.verbose: print ':: '+sys.argv[0]+' :: html/probplots directory already exists'
else:                                  # if not move it
    if args.verbose: print ':: '+sys.argv[0]+' :: creating html/probplots directory'
    os.mkdir(PROBoutdir)
#-------------------------------------------------------------------------------------------------------------
b=sedplotAB.bpzPlots(pAnINPUT[1], objid, probs=None) # no need to loop over sedplotAB.py
b.flux_comparison_plots(show_plots=0, save_plots='png', colors={}, nomargins=0, outdir=SEDoutdir)

# note - comment out this and use plotBPZprobs.py to create the probability plots instead
#for jj in range(Nobj): # 
    #os.system('python $BPZPATH/plots/probplot.py '+pAnINPUT[1]+' '+objid[jj]+' "'+PROBoutdir+'" -SAVE') # SLOOOOW
    #probplot.probplot(pAnINPUT[1], int(objid[jj]), nomargins=0, outdir=PROBoutdir) # QUICKER; but chockes after 475 objects - memory leak when looping...

#-------------------------------------------------------------------------------------------------------------
# creating the actual webpage. 

outfile = outdir+'index.html'
fout    = open(outfile, 'w')

fout.write('<HTML>')
fout.write('<HEAD>')
コード例 #4
0
    if args.verbose:
        print ':: ' + sys.argv[0] + ' :: creating html/sedplot directory'
    os.mkdir(SEDoutdir)

PROBoutdir = outdir + '/probplots'
if os.path.exists(pAnINPUT[0] +
                  PROBoutdir):  # checking if the directory excists
    if args.verbose:
        print ':: ' + sys.argv[
            0] + ' :: html/probplots directory already exists'
else:  # if not move it
    if args.verbose:
        print ':: ' + sys.argv[0] + ' :: creating html/probplots directory'
    os.mkdir(PROBoutdir)
#-------------------------------------------------------------------------------------------------------------
b = sedplotAB.bpzPlots(pAnINPUT[1], objid,
                       probs=None)  # no need to loop over sedplotAB.py
b.flux_comparison_plots(show_plots=0,
                        save_plots='png',
                        colors={},
                        nomargins=0,
                        outdir=SEDoutdir)

# note - comment out this and use plotBPZprobs.py to create the probability plots instead
#for jj in range(Nobj): #
#os.system('python $BPZPATH/plots/probplot.py '+pAnINPUT[1]+' '+objid[jj]+' "'+PROBoutdir+'" -SAVE') # SLOOOOW
#probplot.probplot(pAnINPUT[1], int(objid[jj]), nomargins=0, outdir=PROBoutdir) # QUICKER; but chockes after 475 objects - memory leak when looping...

#-------------------------------------------------------------------------------------------------------------
# creating the actual webpage.

outfile = outdir + 'index.html'