Changeset 20510
- Timestamp:
- Nov 3, 2008, 4:37:48 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/sj_ippTests_branch_20080929/ippTests/compIPPphoto.py
r20509 r20510 106 106 107 107 def compIPPphoto(summaryTable,mode,plotcol_1frame_tlist=plotcol_1frame_tlist,\ 108 plotcol_summary_tlist=plotcol_summary_tlist,skip=True): 108 plotcol_summary_tlist=plotcol_summary_tlist,\ 109 cmfDir = '/IPP/data/SDSS/stripe82/coadd/prod/run_ipp_20080815/',\ 110 skip=True): 109 111 """summaryTable: .fits table for output 110 112 mode: new or append for creating summaryTable new or appending current run's output to it. … … 134 136 column_hash={} 135 137 stats_hash={} 136 chipfile_l,fpObjc_l = makePlan( )138 chipfile_l,fpObjc_l = makePlan(cmfDir=cmfDir) 137 139 filters = [] 138 140 bandindex_hash = {} … … 198 200 """Make diagnostic plots for a single table, based on values in 199 201 values_hash""" 202 # XXX Todo: window commands instead of (or in addition to?) psnup 203 # for putting plots on same paper 200 204 from subprocess import call 201 205 from numpy import concatenate … … 356 360 return outl 357 361 358 def computeStatistics(tablename,copyfields_list = ['RUN','RERUN','CAMCOL','FIELD','FILTER','FWHM_ X','FWHM_Y']):362 def computeStatistics(tablename,copyfields_list = ['RUN','RERUN','CAMCOL','FIELD','FILTER','FWHM_MAJ','FWHM_MIN']): 359 363 """Compute desired statistics for offsets etc. and add them as 360 364 ESO-style HIERARCH fields to the table header (8 characters are … … 534 538 return array(good1_l),array(good2_l),array(good3_l) 535 539 536 def makePlan(lastcamcol=1):537 """Make paired list of which fpObjc file to compare to which IPP538 .cmf file. Could also think about constructing the fpObjc filename539 from run, camcol, field read from .cmf primary header, which540 replicates most of the fpC primary header."""541 542 # For testing:543 # return ['1056-0192.421/1056-0192.421.ch.421.CHIP1.cmf'],['1056-0192.421/fpObjc-001056-1-0192.fit']544 545 from glob import glob546 fpObjcDir = '/IPP/data/SDSS/stripe82/coadd/input/fpObjcs/'547 cmfDir = '/IPP/data/SDSS/stripe82/coadd/prod/run_ipp/'548 runlist = [1056,1755,3388,3434,3465,4145,4192,4203,4247,4263,5052]549 firstfield_h = {550 1056:192,551 1755:329,552 3388:273,553 3434:306,554 3465:185,555 4145:63,556 4192:309,557 4203:358,558 4247:62,559 4263:69,560 5052:62561 }562 Nfields = 18563 camcollist = range(1,lastcamcol+1)564 sdsslist = []565 ps1list = []566 for run in runlist[0:1]:567 firstfield = firstfield_h[run]568 for field in range(firstfield,firstfield+Nfields+1):569 for camcol in camcollist:570 sdssname = fpObjcDir + "fpObjc-%06i-%i-%04i.fit" % ( run, camcol, field)571 # The following should just return 5 files (1 per572 # filter), but just to be sure, let's check and return573 # the correct number of sdss files to match:574 ps1glob = glob(cmfDir + "%i-%04i.*/%i-%04i.*.ch.*.CHIP%i.cmf" %(run,field,run,field,camcol))575 for ps1name in ps1glob:576 ps1list.append(ps1name)577 sdsslist.append(sdssname)578 # Need to remember that CHIPx corresponds to CAMCOLx; could change579 # naming rule to make filter name appear in filename, too.580 return ps1list,sdsslist581 582 540 def matchSdssPs1(SDSSfpObjc,PS1cmf,xoff=0.5,yoff=0.5,matchrad=0.7,skip=False): 583 541 """Call matchByPos to match an SDSS fpObjc.fits and a PS1 bla.cmf … … 599 557 filters = ['u','g','r','i','z'] 600 558 # Read primary header of PS1 file to work out band 601 ps1copyfields_hash = headerfieldHash(['FWHM_ X','FWHM_Y','FILTER'],PS1cmf,HDU=0)559 ps1copyfields_hash = headerfieldHash(['FWHM_MAJ','FWHM_MIN','FILTER'],PS1cmf,HDU=0) 602 560 sdssbandstr = ps1copyfields_hash['FILTER'] 603 561 bandindex = filters.index(sdssbandstr) … … 946 904 947 905 906 def makePlan(fpObjcDir = '/IPP/data/SDSS/stripe82/coadd/input/fpObjcs/',\ 907 cmfDir = '/IPP/data/SDSS/stripe82/coadd/prod/run_ipp_20080815/',\ 908 lastcamcol=1,\ 909 runlist=[1056,1755,3388,3434,3465,4145,4192,4203,4247,4263,5052],\ 910 firstfield_h = { 911 1056:192, 912 1755:329, 913 3388:273, 914 3434:306, 915 3465:185, 916 4145:63, 917 4192:309, 918 4203:358, 919 4247:62, 920 4263:69, 921 5052:62 922 }, \ 923 Nfields = 18): 924 """Make paired list of which fpObjc file to compare to which IPP 925 .cmf file. Could also think about constructing the fpObjc filename 926 from run, camcol, field read from .cmf primary header, which 927 replicates most of the fpC primary header.""" 928 if cmfDir[-1] != '/': 929 cmfDir += '/' 930 if fpObjcDir[-1] != '/': 931 fpObjcDir += '/' 932 # For testing: 933 # return ['1056-0192.421/1056-0192.421.ch.421.CHIP1.cmf'],['1056-0192.421/fpObjc-001056-1-0192.fit'] 934 935 from glob import glob 936 camcollist = range(1,lastcamcol+1) 937 sdsslist = [] 938 ps1list = [] 939 for run in runlist: 940 firstfield = firstfield_h[run] 941 for field in range(firstfield,firstfield+Nfields+1): 942 for camcol in camcollist: 943 sdssname = fpObjcDir + "fpObjc-%06i-%i-%04i.fit" % ( run, camcol, field) 944 # The following should just return 5 files (1 per 945 # filter), but just to be sure, let's check and return 946 # the correct number of sdss files to match: 947 globstr = cmfDir + "%i-%04i.*/%i-%04i.*.ch.*.CHIP%i.cmf" %(run,field,run,field,camcol) 948 ps1glob = glob(globstr) 949 for ps1name in ps1glob: 950 ps1list.append(ps1name) 951 sdsslist.append(sdssname) 952 # Need to remember that CHIPx corresponds to CAMCOLx; could change 953 # naming rule to make filter name appear in filename, too. 954 return ps1list,sdsslist 955
Note:
See TracChangeset
for help on using the changeset viewer.
