IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 24, 2022, 2:36:09 PM (4 years ago)
Author:
eugene
Message:

add tap.skip, fix counting of tap tests based on context (warp, diff, camera), add option for ippCheck class to modify success criteria

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20211108/ippTests/ippCheck/smfcheck.pro

    r42056 r42058  
    180180  get.camera.metadata.by.datagroup $CAMERA $expname $dgrp2; $smfBase2 = $camPath
    181181
     182  tap.plan $NTESTS_CMF
     183
    182184  $options =
    183185  setargs +plot   BOOL  $SAVEPLOT
     
    185187  echo smf.compare.all.extensions $output $smfBase1.smf $smfBase2.smf $options
    186188       smf.compare.all.extensions $output $smfBase1.smf $smfBase2.smf $options
     189  tap.done
    187190end
    188191
     
    223226  end
    224227 
     228  tap.plan {$npages1 * $NTESTS_CMF}
     229
    225230  for i 0 $npages1
    226231    book getpage warpBook1 $i -var mypage1
     
    238243    echo smf.compare.all.extensions $output.$skycellID $cmfBase1.cmf $cmfBase2.cmf $options
    239244         smf.compare.all.extensions $output.$skycellID $cmfBase1.cmf $cmfBase2.cmf $options
    240  end
    241 
    242  book delete warpBook1
    243  book delete warpBook2
     245  end
     246 
     247  book delete warpBook1
     248  book delete warpBook2
     249 
     250  tap.done
    244251end
    245252
     
    279286  end
    280287 
     288  tap.plan {2 * $npages1 * $NTESTS_CMF}
     289
    281290  for i 0 $npages1
    282291    book getpage diffBook1 $i -var mypage1
     
    299308      echo smf.compare.all.extensions $output.$skycellID.inv $cmfBase1.inv.cmf $cmfBase2.inv.cmf $options
    300309           smf.compare.all.extensions $output.$skycellID.inv $cmfBase1.inv.cmf $cmfBase2.inv.cmf $options
     310    else
     311      tap.skip $NTESTS_CMF
    301312    end
    302313 end
     
    329340  if ("$smf1" == "")
    330341    echo "ERROR: missing smf/cmf file : $smfFile1"
     342    tap.skip $NTESTS_CMF
    331343    next
    332344  end
    333345  if ("$smf2" == "")
    334346    echo "ERROR: missing smf/cmf file : $smfFile2"
     347    tap.skip $NTESTS_CMF
    335348    next
    336349  end
     
    338351  dirname $outroot -var mydir
    339352  mkdir $mydir
    340 
    341   # XXX this number depends on the schema of the smfs and the camera (gpc1 vs gpc2)
    342   # XXX can we calculate the number of tests based on the number of smf extensions?
    343   # plan 3125
    344   ## XXX if smf.compare.all.extensions is called by an external function, we probably need a different plan,
    345   ## or we need to call 'plan' at the outer level?
    346   plan $NTESTS_CMF
    347 
    348   # Load psfField definitions.  These variables are set by the
    349   # (init.camera, init.warp, init.diff) macros defined in .ippcheckrc.
    350   # These are called by init.stage
    351   smf.compare.parse.book $PSF_FIELDS  psfFields
    352   smf.compare.parse.book $PSF_KEYS    psfKeys
    353   smf.compare.parse.book $HDR_KEYS    hdrKeys
    354353
    355354  # does the smf have the right number of extensions?
     
    381380    if ($Next2 == -1)
    382381      echo "not ok : missing extenion $ext0:$Next1"
     382      # XXX add a tap.skip here?
    383383      next
    384384    end
    385385
    386     ok ($ext0:$Next1 == $ext1:$Next2) "matching ext names"
     386    # tap.ok ($ext0:$Next1 == $ext1:$Next2) "matching ext names"
    387387    $extname = $ext0:$Next1
    388388    # NOTE: analysis below uses ext sequence number (i,j)
     
    398398      echo "##### comparison results in $outroot.$extname.keys               #####"
    399399      exec ippCheckKeys $smf1 $Next1 $smf2 $Next2 >& $outroot.$extname.keys
    400       smf.compare.keys $outroot.$extname.keys hdrKeys
     400      smf.compare.keys $outroot.$extname.keys hdrKeys; # TAP: 1
    401401      if ($NfailKeys) set NfailHdr = $NfailHdr + 1
    402402    end
     
    408408      echo "##### comparison results in $outroot.$extname.keys               #####"
    409409      exec ippCheckKeys $smf1 $Next1 $smf2 $Next2 >& $outroot.$extname.keys
    410       smf.compare.keys $outroot.$extname.keys psfKeys
     410      smf.compare.keys $outroot.$extname.keys psfKeys; # TAP: 1
    411411      if ($NfailKeys) set NfailPsf = $NfailPsf + 1
    412412
     
    414414      echo "##### comparison results in $outroot.$extname.txt                  #####"
    415415      smf.compare.onechip $outroot.$extname $smf1 {$Next1-1} $smf2 {$Next2-1}; # Note smf.compare.onechip counts from 0 = first extension
     416      # TAP: 2 + Nfields
    416417    end
    417418
     
    422423      echo "##### comparison results in $outroot.$extname.keys               #####"
    423424      exec ippCheckKeys $smf1 $Next1 $smf2 $Next2 >& $outroot.$extname.keys
    424       smf.compare.keys $outroot.$extname.keys hdrKeys
     425      smf.compare.keys $outroot.$extname.keys hdrKeys; # TAP: 1
    425426      if ($NfailKeys) set NfailHdr = $NfailHdr + 1
    426427    end
     
    432433      echo "##### comparison results in $outroot.$extname.keys               #####"
    433434      exec ippCheckKeys $smf1 $Next1 $smf2 $Next2 >& $outroot.$extname.keys
    434       smf.compare.keys $outroot.$extname.keys psfKeys
     435      smf.compare.keys $outroot.$extname.keys psfKeys; # TAP: 1
    435436      if ($NfailKeys) set NfailPsf = $NfailPsf + 1
    436437
     
    440441    end
    441442  end
    442   ok ($NfailHdr == 0) "$NfailHdr HDR headers failed comparison"
    443   ok ($NfailPsf == 0) "$NfailPsf PSF headers failed comparison"
    444 
    445   done
     443  tap.ok ($NfailHdr == 0) "$NfailHdr HDR headers failed comparison" ; # TAP: each file
     444  tap.ok ($NfailPsf == 0) "$NfailPsf PSF headers failed comparison" ; # TAP: each file
    446445end
    447446
     
    474473  $smf2_has_data = ($tfields:n > 0) && ($table:Ny > 0)
    475474
    476   ok ($smf1_has_data == $smf2_has_data) "tables both have (or both lack) data"
     475  tap.ok ($smf1_has_data == $smf2_has_data) "tables both have (or both lack) data" ; # TAP: each chip
    477476  if (not($smf1_has_data) || not($smf2_has_data))
    478477    echo "no data in tables $smf1 $ext1 or $smf2 $ext2, skipping"
    479478    # I should account for the number of skipped tests
     479    local Nfields
     480    book npages psfFields -var Nfields
     481    tap.skip {$Nfields + 1}
    480482    return
    481483  end
     
    554556  #
    555557  output $output.txt
    556   echo "$N1_keep & $N1_miss vs $N2_keep & $N2_miss"
     558  echo "PSF FIELDS: $N1_keep & $N1_miss vs $N2_keep & $N2_miss"
    557559  output stdout
    558 
    559   # positional consistency:
    560   set dX = X_PSF_$v1 - Xm_$v2
    561   set dY = Y_PSF_$v1 - Ym_$v2
    562 
    563   # add a test here?
    564   # XXX this test is equivalent to tests of the fields below
    565   # but cannot be as finely controlled
    566   # vstat -q dX
    567   # ok ($SIGMA < 0.1) "X position stdev $SIGMA < 0.1"
    568   # vstat -q dY
    569   # ok ($SIGMA < 0.1) "Y position stdev $SIGMA < 0.1"
    570560end
    571561
     
    596586  end 
    597587
    598   ok ($NfailFieldsPSF == 0) "$NfailFieldsPSF fields failed comparison"
    599 
     588  tap.ok ($NfailFieldsPSF == 0) "$NfailFieldsPSF fields failed comparison"; # TAP: each chip
    600589end
    601590
     
    715704    fprintf "%24s :  $PASS : SKIP" $field
    716705    output stdout
     706    tap.skip 1
    717707    return
    718708  end
     
    728718  if ($hist:minVal < $minGood) set PASS = 0
    729719  if ($hist:maxVal > $maxGood) set PASS = 0
     720  if (isinf($hist:maxVal)) set PASS = 0
     721  if (isinf($hist:minVal)) set PASS = 0
    730722
    731723  # save the summary line to be written to a file by the calling function
     
    734726  output stdout
    735727
    736   ok ($PASS) "PSF table field $field comparison"
     728  tap.ok ($PASS) "PSF table field $field comparison"; # TAP: each field
    737729end
    738730
     
    796788    $NfailKeys ++
    797789  end
    798   ok ($NfailKeys == 0) "$NfailKeys keys failed comparison"
     790  tap.ok ($NfailKeys == 0) "$NfailKeys keys failed comparison" ; # TAP: called 2x per chip
    799791end
    800792
Note: See TracChangeset for help on using the changeset viewer.