Changeset 20549
- Timestamp:
- Nov 5, 2008, 5:32:19 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/sj_ippTests_branch_20080929/ippTests/compIPPphoto.py
r20528 r20549 79 79 ,(['m_rr_cc_psf'],['d_mag'],'scatter') 80 80 ,(['sky_sdss'],['sky_ps1'],'scatter') 81 ,([' y_psf'],['objc_rowc'],'histogram')81 ,(['d_pointsource'],['pointsource_ps1'],'histogram') 82 82 ,(['sky_sdss'],['sky_ps1'],'histogram') 83 83 ,(['psfinstmag_sdss'],['psf_inst_mag'],'histogram') … … 93 93 ] 94 94 95 def mergePlots(summaryTable,plotcol_1frame_tlist=plotcol_1frame_tlist,filtlist=['u','g','r','i','z'],workdir='/IPP/data/SDSS/stripe82/coadd/compare'): 95 def mergePlots(summaryTable,plotcol_1frame_tlist=plotcol_1frame_tlist,filtlist=['u','g','r','i','z'],\ 96 workdir='/IPP/data/SDSS/stripe82/coadd/compare'): 96 97 from subprocess import call 97 98 from glob import glob … … 101 102 outroot = re.sub('(\.[sc]mf|\.fits?)$','',summaryTable) 102 103 for filt in filtlist: 103 rootstr = " win_match_%s"%(filt)104 rootstr = "filestats_match_%s"%(filt) 104 105 globstr = "%s_*.eps"%(rootstr) 105 106 filelist = glob(globstr) 106 outname = rootstr + ".eps"107 outname = "merged_filestats_%s_%s.eps" % ( filt,outroot ) 107 108 cmdstr = "gs -dNOPAUSE -sDEVICE=pswrite -sOutputFile=%s %s -c quit" %(outname,' '.join(filelist)) 108 109 print "Making %s" %(outname) … … 114 115 plotcol_summary_tlist=plotcol_summary_tlist,\ 115 116 cmfDir = '/IPP/data/SDSS/stripe82/coadd/prod/run_ipp_20080815/',\ 117 workdir = '/Users/jester/science/sdss/coadd/Hawaii/compare_tsObj', 116 118 copyfields_list = ['RUN','RERUN','CAMCOL','FIELD','FILTER','FWHM_MAJ','FWHM_MIN'],\ 117 119 skip=True): … … 173 175 for filt in filters: 174 176 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) 177 181 return column_hash,goodrow_hash 178 182 … … 205 209 206 210 def 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_"): 208 212 """Make diagnostic plots for a single table, based on values in 209 213 values_hash""" … … 214 218 from sm import cvar,angle 215 219 import re 220 import sm,smLib 216 221 # In histograms, only plot core of distribution within these percentiles: 217 222 histo_min_ntile = 0.03 … … 221 226 outname_l = [] 222 227 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" 224 229 smOpenPlot(all_outname,format=format) 225 230 # all the explict sm. and smLib. calls should be wrapped into … … 285 290 minbin=None 286 291 maxbin=None 292 # Which one *am* I plotting first??? 287 293 smHistoPlot(values2,ltype=0,nbins=Nbins,minbin=minbin,maxbin=maxbin,\ 288 xlab=col 2name,ylab="N",expand=expand)294 xlab=col1name,ylab="N",expand=expand) 289 295 smHistoPlot(values1,append=True,minbin=minbin,maxbin=maxbin,nbins=Nbins,\ 290 296 ltype=2,expand=expand) 291 297 firstplot = False 292 298 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_outname296 # 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 ", psnupcmd300 # call(psnupcmd,shell=True)301 # os.remove(tmp_outname)302 299 return all_outname 303 300 … … 706 703 # should work if called from something where sm is in scope? 707 704 sm.expand(1.8) 708 sm.lweight( 5)705 sm.lweight(3) 709 706 710 707 # Plotting convention will be like in sm: you need to open a file, … … 775 772 import sm 776 773 sm.expand(1.8) 777 sm.lweight( 5)774 sm.lweight(3) 778 775 # Silently ignore any problems with plot generation 779 776 try: … … 794 791 import sm 795 792 sm.expand(expand) 796 sm.lweight( 5)793 sm.lweight(3) 797 794 # Silently ignore any problems with plot generation 798 795 try:
Note:
See TracChangeset
for help on using the changeset viewer.
