Changeset 42031
- Timestamp:
- Feb 9, 2022, 12:36:31 PM (4 years ago)
- Location:
- branches/eam_branches/ipp-20211108/ippTests/ippCheck
- Files:
-
- 3 edited
-
cammask.pro (modified) (6 diffs)
-
ippCheck (modified) (6 diffs)
-
smfcheck.pro (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20211108/ippTests/ippCheck/cammask.pro
r41975 r42031 6 6 7 7 # this module provides the following functions 8 # get.camera.eff (camera) (expname) (cam Label) (refsrcs.fits) :8 # get.camera.eff (camera) (expname) (camDgroup) (refsrcs.fits) : 9 9 # get.chip.detect.stats (chipname) (chipnseq) 10 10 # get.chip.mask.stats (cammask) 11 11 # get.chip.mask.files (camPath) 12 12 # get.chip.metadata (camera) (chipID) 13 # get.camera.metadata (camera) (expname) (cam Label)13 # get.camera.metadata (camera) (expname) (camDgroup) 14 14 15 15 # init.radec.range … … 29 29 macro get.camera.eff 30 30 if ($0 != 5) 31 echo "USAGE: get.camera.eff (camera) (expname) (cam Label) (refsrcs.fits)"31 echo "USAGE: get.camera.eff (camera) (expname) (camDgroup) (refsrcs.fits)" 32 32 echo "EX: get.camera.eff gpc1 o9322g0253o EU.nightlyscience filename.fits" 33 33 break 34 34 end 35 35 36 local i dbname expname cam labeloutput36 local i dbname expname camdgrp output 37 37 $dbname = $1 38 38 $expname = $2 39 $cam label= $339 $camdgrp = $3 40 40 $refsrcs = $4 41 41 … … 48 48 49 49 # get the name of the smf file: 50 get.camera.metadata $dbname $expname $cam label50 get.camera.metadata $dbname $expname $camdgrp 51 51 $smffile = $camPath.smf 52 52 $smfreal = `neb-locate -p $smffile` … … 298 298 macro get.camera.metadata 299 299 if ($0 != 4) 300 echo "USAGE: get.camera.metadata (camera) (expname) (cam Label)"300 echo "USAGE: get.camera.metadata (camera) (expname) (camDgroup)" 301 301 echo "EX: get.camera.metadata gpc1 o9322g0253o EU.nightlyscience" 302 302 echo " sets camPath, chipID" … … 304 304 end 305 305 306 local dbname expname cam label307 $dbname = $1308 $expname = $2309 $cam label= $3306 local dbname expname camdgrp 307 $dbname = $1 308 $expname = $2 309 $camdgrp = $3 310 310 311 311 # need to generically handle the question of which version / label … … 313 313 # instead of label, we could specify the cam_id (which we might know) 314 314 315 $command = camtool -dbname $dbname -processedexp -exp_name $expname - label $camlabel315 $command = camtool -dbname $dbname -processedexp -exp_name $expname -data_group $camdgrp 316 316 #$command = camtool -dbname $dbname -processedexp -exp_name $expname 317 317 -
branches/eam_branches/ipp-20211108/ippTests/ippCheck/ippCheck
r42030 r42031 28 28 29 29 if ($0 != 3) 30 echo "USAGE: check.exposure.dvo (expname) ( label)"30 echo "USAGE: check.exposure.dvo (expname) (dgroup)" 31 31 echo " -no-cam, -no-warp, -no-diff, -no-plots" 32 32 echo " [-camera gpc2]" … … 34 34 end 35 35 36 local expname cam label36 local expname camdgrp 37 37 $expname = $1 38 $cam label= $238 $camdgrp = $2 39 39 40 40 $OUTVERSION = DVO; # used to define output names … … 42 42 43 43 make.truth.sources $CAMERA $expname $PV3_CATDIR DVO 44 if (not($SKIP_CAM)) get.camera.eff $CAMERA $expname $cam label$REFSOURCE45 if (not($SKIP_WARP)) get.warp.eff $CAMERA $expname $camID $REFSOURCE46 if (not($SKIP_DIFF)) get.diff.eff $CAMERA $expname $warpID $REFSOURCE44 if (not($SKIP_CAM)) get.camera.eff $CAMERA $expname $camdgrp $REFSOURCE 45 if (not($SKIP_WARP)) get.warp.eff $CAMERA $expname $camID $REFSOURCE 46 if (not($SKIP_DIFF)) get.diff.eff $CAMERA $expname $warpID $REFSOURCE 47 47 48 48 if (not($SKIP_PLOTS)) plot.exposure.real $expname … … 64 64 65 65 if ($0 != 4) 66 echo "USAGE: check.exposure.mpc (expname) ( label) (mpcfile)"67 break 68 end 69 70 local expname cam labelmpcfile66 echo "USAGE: check.exposure.mpc (expname) (dgroup) (mpcfile)" 67 break 68 end 69 70 local expname camdgrp mpcfile 71 71 $expname = $1 72 $cam label= $272 $camdgrp = $2 73 73 $mpcfile = $3 74 74 … … 81 81 make.truth.sources $CAMERA $expname $mpcfile MPC; # sets the value of REFSOURCE 82 82 83 if (not($SKIP_CAM)) get.camera.eff $CAMERA $expname $cam label$REFSOURCE83 if (not($SKIP_CAM)) get.camera.eff $CAMERA $expname $camdgrp $REFSOURCE 84 84 85 85 # CAMSOURCE lists all REFSOURCE entries which actually fall on a chip, while REFSOURCE includes … … 226 226 macro show.usage 227 227 echo "USAGE: ippCheck (mode) ..." 228 echo " EG: ippCheck mpc (expname) ( label) [mpcfile]"229 echo " EG: ippCheck dvo (expname) ( label)"228 echo " EG: ippCheck mpc (expname) (dgroup) [mpcfile]" 229 echo " EG: ippCheck dvo (expname) (dgroup)" 230 230 echo " EG: ippCheck smf (outroot) (smf1) (smf2) [+plot]" 231 231 echo " EG: ippCheck smf.dgrp (outroot) (smf1) (smf2) [+plot]" -
branches/eam_branches/ipp-20211108/ippTests/ippCheck/smfcheck.pro
r42030 r42031 17 17 end 18 18 19 local output expname dgrp1 dgrp2 19 local output expname dgrp1 dgrp2 saveplot 20 20 $output = $1 21 21 $expname = $2 … … 31 31 $smf2 = `neb-locate -p $smffile` 32 32 33 $saveplot = 34 if ($SAVEPLOT) 35 $saveplot = +plot 36 end 33 37 smf.compare.all.extensions $output $smf1 $smf2 34 38 end 35 39 36 40 macro smf.compare.all.extensions 37 getargs +plot BOOL -var SAVEPLOT 41 # defaults to 'false' if +plot is not provided 42 getargs +plot BOOL -var SAVEPLOT 38 43 39 44 if ($0 != 4) 40 echo "USAGE: smf.compare.all.extensions (output) (smf1) (smf2) [-plot]"45 echo "USAGE: smf.compare.all.extensions (output) (smf1) (smf2)" 41 46 break 42 47 end … … 61 66 62 67 # does the smf have the right number of extensions? 63 list ext0 -x "ftable -list $smf1" 64 list ext1 -x "ftable -list $smf2" 65 66 ok ($ext0:n == $ext1:n) "same number of extensions" 67 if ($ext0:n != $ext1:n) 68 echo "impossible to continue with mismatched extensions" 69 echo "smf1 : $smf1" 70 echo "smf2 : $smf2" 71 exit 3 72 end 68 # generate a list of just the extension names: 69 list tablelines -x "ftable -list $smf1" 70 smf.compare.extract.extnames ext0 tablelines 71 72 list tablelines -x "ftable -list $smf2" 73 smf.compare.extract.extnames ext1 tablelines 74 75 smf.compare.match.extlists ext0 ext1 76 77 ## ok ($ext0:n == $ext1:n) "same number of extensions" 78 ## if ($ext0:n != $ext1:n) 79 ## echo "impossible to continue with mismatched extensions" 80 ## echo "smf1 : $smf1" 81 ## echo "smf2 : $smf2" 82 ## exit 3 83 ## end 73 84 74 85 # track the number of chips for which the XYnn.hdr keys failed … … 77 88 78 89 # XXX how to do the next steps if the numbers do not match? 79 # NOTE: ext0:0 is the title line 80 for i 1 $ext0:n 81 list w0 -split $ext0:$i 82 list w1 -split $ext1:$i 83 ok ($w0:0 == $w1:0) "matching ext names" 84 85 $extname = $w0:0 90 for Next1 0 $ext0:n 91 $Next2 = $match1:$Next1 92 if ($Next2 == -1) 93 echo "not ok : missing extenion $ext0:$Next1" 94 next 95 end 96 97 ok ($ext0:$Next1 == $ext1:$Next2) "matching ext names" 98 $extname = $ext0:$Next1 99 # NOTE: analysis below uses ext sequence number (i,j) 100 # extname is only used to name output products 101 102 # ippCheckKeys uses 0 == PHU, 1 = 1st extension 103 # smf.compare.onechip uses 0 = 1st extension 86 104 87 105 # if extname is XYnn.hdr, compare the headers 88 106 strstr -q $extname .hdr -start s1 89 107 if ($s1 == 4) 90 $Next = $i - 191 echo "# check keys for $extname == FITS entry number $Next"92 exec ippCheckKeys $smf1 $Next $smf2 $Next>& $outroot.$extname.keys108 echo "##### check keys for $extname == FITS entry number $Next1,$Next2 #####" 109 echo "##### comparison results in $outroot.$extname.keys #####" 110 exec ippCheckKeys $smf1 $Next1 $smf2 $Next2 >& $outroot.$extname.keys 93 111 smf.compare.keys $outroot.$extname.keys hdrKeys 94 112 if ($NfailKeys) set NfailHdr = $NfailHdr + 1 … … 98 116 strstr -q $extname .psf -start s1 99 117 if ($s1 == 4) 100 $Next = $i - 1101 echo "# check keys for $extname == FITS entry number $Next"102 exec ippCheckKeys $smf1 $Next $smf2 $Next>& $outroot.$extname.keys118 echo "##### check keys for $extname == FITS entry number $Next1,$Next2 #####" 119 echo "##### comparison results in $outroot.$extname.keys #####" 120 exec ippCheckKeys $smf1 $Next1 $smf2 $Next2 >& $outroot.$extname.keys 103 121 smf.compare.keys $outroot.$extname.keys psfKeys 104 122 if ($NfailKeys) set NfailPsf = $NfailPsf + 1 105 123 106 echo "# check fields for $extname == FITS entry number $Next" 107 smf.compare.onechip $outroot.$extname $smf1 $smf2 {$Next - 1}; # Note smf.compare.onechip counts from 0 = first extension 124 echo "##### check fields for $extname == FITS entry number $Next1,$Next2 #####" 125 echo "##### comparison results in $outroot.$extname.txt #####" 126 smf.compare.onechip $outroot.$extname $smf1 {$Next1-1} $smf2 {$Next2-1}; # Note smf.compare.onechip counts from 0 = first extension 108 127 end 109 128 end … … 116 135 # generate plot and comparison txt file for one chip (extension) 117 136 macro smf.compare.onechip 118 if ($0 != 5)119 echo "USAGE: smf.compare.onechip (output) (smf1) ( smf2) (extension)"120 break 121 end 122 123 local output smf1 smf2 ext num137 if ($0 != 6) 138 echo "USAGE: smf.compare.onechip (output) (smf1) (ext1) (smf2) (ext2)" 139 break 140 end 141 142 local output smf1 smf2 ext1 ext2 124 143 $output = $1 125 144 $smf1 = $2 126 $smf2 = $3 127 $extnum = $4 145 $ext1 = $3 146 $smf2 = $4 147 $ext2 = $5 128 148 129 149 dirname $output -var mydir … … 135 155 # load in the full set of data for this extension 136 156 # NOTE : t0 and t1 are used to label the sets of vectors 137 smf.load.fields $smf1 $ext numt1138 smf.load.fields $smf2 $ext numt2157 smf.load.fields $smf1 $ext1 t1 158 smf.load.fields $smf2 $ext2 t2 139 159 140 160 # generate the matched lists (index1, index2) … … 211 231 # add a test here? 212 232 vstat -q dX 213 ok ($SIGMA < 0.1) "X position stdev < 0.1"233 ok ($SIGMA < 0.1) "X position stdev $SIGMA < 0.1" 214 234 vstat -q dY 215 ok ($SIGMA < 0.1) "Y position stdev < 0.1"235 ok ($SIGMA < 0.1) "Y position stdev $SIGMA < 0.1" 216 236 end 217 237 … … 607 627 book getword mybook $pagename cam_id -var camID 608 628 book delete mybook 629 end 630 631 ######## generate a list of the entries in list2 which correspond to the entries in list 1 632 macro smf.compare.match.extlists 633 if ($0 != 3) 634 echo "USAGE: smf.compare.match.extlists (list1) (list2)" 635 break 636 end 637 638 # if I can assume the two lists have the same order (with just inserts or deletions in one or the other) 639 # then I can step through the list only once 640 # otherwise, I need to do N^2 comparisons? 641 642 $list1 = $1 643 $list2 = $2 644 645 $N1 = $$list1:n 646 $N2 = $$list2:n 647 648 for i 0 $N1 649 $match1:$i = -1 650 end 651 $match1:n = $N1 652 653 for i 0 $N2 654 $match2:$i = -1 655 end 656 $match2:n = $N2 657 658 for i 0 $N1 659 for j 0 $N2 660 if ($match2:$j != -1) continue 661 if ($$list1:$i == $$list2:$j) 662 $match1:$i = $j 663 $match2:$j = $i 664 last 665 end 666 end 667 if ($match1:$i == -1) 668 echo "ERROR: missing extension $$list1:$i in file 2" 669 end 670 end 671 672 for j 0 $N2 673 if ($match2:$j == -1) 674 echo "WARNING: unexpected extension $$list2:$j in file 2" 675 end 676 end 677 end 678 679 ####### 680 macro smf.compare.extract.extnames 681 if ($0 != 3) 682 echo "USAGE: smf.compare.extract.extnames (outlist) (inlist)" 683 break 684 end 685 686 local i j inlist outlist 687 $outlist = $1 688 $inlist = $2 689 690 # NOTE: inlist:0 is the title line 691 for i 1 $$inlist:n 692 $j = $i - 1 693 list words -split $$inlist:$i 694 $$outlist:$j = $words:0 695 end 696 $$outlist:n = $tablelines:n - 1 609 697 end 610 698
Note:
See TracChangeset
for help on using the changeset viewer.
