IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20549


Ignore:
Timestamp:
Nov 5, 2008, 5:32:19 AM (18 years ago)
Author:
Sebastian Jester
Message:

More meaningful .eps file names, plus small changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/sj_ippTests_branch_20080929/ippTests/compIPPphoto.py

    r20528 r20549  
    7979    ,(['m_rr_cc_psf'],['d_mag'],'scatter')
    8080    ,(['sky_sdss'],['sky_ps1'],'scatter')
    81     ,(['y_psf'],['objc_rowc'],'histogram')
     81    ,(['d_pointsource'],['pointsource_ps1'],'histogram')
    8282    ,(['sky_sdss'],['sky_ps1'],'histogram')
    8383    ,(['psfinstmag_sdss'],['psf_inst_mag'],'histogram')
     
    9393    ]
    9494
    95 def mergePlots(summaryTable,plotcol_1frame_tlist=plotcol_1frame_tlist,filtlist=['u','g','r','i','z'],workdir='/IPP/data/SDSS/stripe82/coadd/compare'):
     95def mergePlots(summaryTable,plotcol_1frame_tlist=plotcol_1frame_tlist,filtlist=['u','g','r','i','z'],\
     96                   workdir='/IPP/data/SDSS/stripe82/coadd/compare'):
    9697    from subprocess import call
    9798    from glob import glob
     
    101102    outroot = re.sub('(\.[sc]mf|\.fits?)$','',summaryTable)
    102103    for filt in filtlist:
    103         rootstr = "win_match_%s"%(filt)
     104        rootstr = "filestats_match_%s"%(filt)
    104105        globstr = "%s_*.eps"%(rootstr)
    105106        filelist = glob(globstr)
    106         outname = rootstr + ".eps"
     107        outname = "merged_filestats_%s_%s.eps" % ( filt,outroot )
    107108        cmdstr = "gs -dNOPAUSE -sDEVICE=pswrite -sOutputFile=%s %s -c quit" %(outname,' '.join(filelist))
    108109        print "Making %s" %(outname)
     
    114115                     plotcol_summary_tlist=plotcol_summary_tlist,\
    115116                     cmfDir = '/IPP/data/SDSS/stripe82/coadd/prod/run_ipp_20080815/',\
     117                     workdir = '/Users/jester/science/sdss/coadd/Hawaii/compare_tsObj',
    116118                     copyfields_list = ['RUN','RERUN','CAMCOL','FIELD','FILTER','FWHM_MAJ','FWHM_MIN'],\
    117119                     skip=True):
     
    173175    for filt in filters:
    174176        print bandindex_hash[filt], filt
    175         plotStatsOnefile(summaryhash,sumgoodrows_hash,summaryTable,plotcol_summary_tlist,bandindex_hash[filt],bandid=filt)
    176     mergePlots(summaryTable,plotcol_1frame_tlist=plotcol_1frame_tlist,filtlist=filters)
     177        plotStatsOnefile(summaryhash,sumgoodrows_hash,summaryTable,plotcol_summary_tlist,\
     178                             bandindex_hash[filt],bandid=filt,outroot="runstats_")
     179    mergePlots(summaryTable,plotcol_1frame_tlist=plotcol_1frame_tlist,\
     180                   filtlist=filters,workdir=workdir)
    177181    return column_hash,goodrow_hash
    178182
     
    205209   
    206210def plotStatsOnefile(values_hash,goodrow_hash,matchtable,plotcol_tlist,bandindex,\
    207                          format='epsport',bandid='',expand=0.8):
     211                         format='epsport',bandid='',expand=0.8,outroot = "filestats_"):
    208212    """Make diagnostic plots for a single table, based on values in
    209213    values_hash"""
     
    214218    from sm import cvar,angle
    215219    import re
     220    import sm,smLib
    216221    # In histograms, only plot core of distribution within these percentiles:
    217222    histo_min_ntile = 0.03
     
    221226    outname_l = []
    222227    nplots = len(plotcol_tlist)
    223     all_outname = "win_" + re.sub('(\.[sc]mf|\.fits?)$','',matchtable) +".eps"
     228    all_outname = outroot + re.sub('(\.[sc]mf|\.fits?)$','',matchtable) +".eps"
    224229    smOpenPlot(all_outname,format=format)
    225230    # all the explict sm. and smLib. calls should be wrapped into
     
    285290                    minbin=None
    286291                    maxbin=None
     292                # Which one *am* I plotting first???
    287293                smHistoPlot(values2,ltype=0,nbins=Nbins,minbin=minbin,maxbin=maxbin,\
    288                                 xlab=col2name,ylab="N",expand=expand)
     294                                xlab=col1name,ylab="N",expand=expand)
    289295                smHistoPlot(values1,append=True,minbin=minbin,maxbin=maxbin,nbins=Nbins,\
    290296                            ltype=2,expand=expand)
    291297            firstplot = False
    292298    smClosePlot()
    293     all_outname = "nup_" + re.sub('(\.[sc]mf|\.fits?)$','',matchtable) +".eps"
    294     tmp_outname = "tmp_" + re.sub('(\.[sc]mf|\.fits?)$','',matchtable) +".eps"
    295     # print "creating ", all_outname
    296     # mergecmd = "gs -dNOPAUSE -sDEVICE=pswrite -sOutputFile=%s %s -c quit" %(tmp_outname,' '.join(outname_l))
    297     # call(mergecmd,shell=True)
    298     # psnupcmd = "psnup -pletter -%i %s %s"%(nplots,tmp_outname,all_outname)
    299     # print "calling ", psnupcmd
    300     # call(psnupcmd,shell=True)
    301     # os.remove(tmp_outname)
    302299    return all_outname
    303300
     
    706703    # should work if called from something where sm is in scope?
    707704    sm.expand(1.8)
    708     sm.lweight(5)
     705    sm.lweight(3)
    709706
    710707# Plotting convention will be like in sm: you need to open a file,
     
    775772    import sm
    776773    sm.expand(1.8)
    777     sm.lweight(5)
     774    sm.lweight(3)
    778775    # Silently ignore any problems with plot generation
    779776    try:
     
    794791    import sm
    795792    sm.expand(expand)
    796     sm.lweight(5)
     793    sm.lweight(3)
    797794    # Silently ignore any problems with plot generation
    798795    try:
Note: See TracChangeset for help on using the changeset viewer.