IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42125


Ignore:
Timestamp:
Mar 17, 2022, 1:54:21 PM (4 years ago)
Author:
eugene
Message:

update ippCheck to handle empty output files

Location:
trunk/ippTests
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTests

  • trunk/ippTests/ippCheck

  • trunk/ippTests/ippCheck/cammask.pro

    r42114 r42125  
    7878 if ($table:Ny == 0)
    7979  echo "ERROR: no reference sources found in $refsrcs"
     80
     81  # generate an empty output file
     82  $OUT_FIELDS =
     83  foreach field $SMF_FIELDS_CAM $REF_FIELDS_CAM $XTR_FIELDS_CAM
     84    $OUT_FIELDS = $OUT_FIELDS $field\_out
     85    create -empty $field\_out
     86  end
     87 
     88  sprintf output "%s/%s.%s.cam.stf" $OUTDIR $expname $OUTVERSION
     89  write -fits DATA $output $OUT_FIELDS
     90 
     91  # save this name for warp and diff analysis, if desired
     92  $CAMSOURCE = $output
     93
    8094  break
    8195 end
     
    271285   if ($COPYMASKS) exec neb-copy $camMask:$i $OUTDIR
    272286   $j ++
    273  end
    274  $camMask:n = $chipName:n
     287   if ($j >= $tmpName:n) last
     288 end
     289 $camMask:n = $tmpName:n
    275290end
    276291
  • trunk/ippTests/ippCheck/camstats.pro

    r41981 r42125  
    3838   # results in magFound, fracFound, numFound
    3939   calc.camstats
    40    if ($i == 0)
     40   if (numTotal_sum?[] == 0)
    4141     set numTotal_sum = numTotal
    4242     set numFound_sum = numFound
     
    5757 end
    5858   
    59  set numTotal = numTotal_sum
    60  set numFound = numFound_sum
    61  set numPoss  = numPoss_sum
    62  set numGood  = numGood_sum
    63  delete numTotal_sum numFound_sum numPoss_sum numGood_sum
     59 if (numTotal_sum?[] == 0)
     60   calc.camstats
     61 else
     62   set numTotal = numTotal_sum
     63   set numFound = numFound_sum
     64   set numPoss  = numPoss_sum
     65   set numGood  = numGood_sum
     66   delete numTotal_sum numFound_sum numPoss_sum numGood_sum
     67 end
    6468
    6569 set fracFound = (numTotal > 0) ? numFound / numTotal : zero(numTotal)
     
    7983  $BST2 = -tickpad 0.2 -xpad 3.5 -labelpadx 3.0 -ypad 0.5 -labelpady 0.0 +ypad 4.5 +labelpady 4.0 -labels 1001
    8084 
    81   section aM 0.00 0.66 0.65 0.33
    82   section aR 0.00 0.33 0.65 0.33
    83   section aD 0.00 0.00 0.65 0.33
    84 
    85   section bM 0.65 0.66 0.35 0.33
    86   section bR 0.65 0.33 0.35 0.33
    87   section bD 0.65 0.00 0.35 0.33
     85  section aM 0.00 0.66 0.65 0.33;  label -x mag -y "&sd&h mag"
     86  section aR 0.00 0.33 0.65 0.33;  label -x mag -y "&sd&h R.A."
     87  section aD 0.00 0.00 0.65 0.33;  label -x mag -y "&sd&h Dec"
     88
     89  section bM 0.65 0.66 0.35 0.33;  label -x mag -y "&sd&h mag"
     90  section bR 0.65 0.33 0.35 0.33;  label -x mag -y "&sd&h R.A."
     91  section bD 0.65 0.00 0.35 0.33;  label -x mag -y "&sd&h Dec"
     92
     93  if (RA_PSF?[] == 0)
     94    echo "no sources in datafile"
     95    return
     96  end
    8897
    8998  set dR = 3600*(RA_PSF - Rref)*dcos(Dref)
     
    256265 $Mdel = 0.25
    257266 
     267 if (Mref_out?[] == 0)
     268   create magBin $Mmin $Mmax $Mdel
     269   set numTotal = zero(magBin)
     270   set numFound = zero(magBin)
     271   set numPoss  = zero(magBin)
     272   set numGood  = zero(magBin)
     273   return
     274 end
     275
    258276 delete -q  magBin numTotal numPoss numFound numGood
    259277 for mag $Mmin $Mmax $Mdel
  • trunk/ippTests/ippCheck/diffmask.pro

    r41941 r42125  
    5151  # load the reference source table
    5252  # how to choose the name of the filter?
    53   data $refsrcs;
     53  data $refsrcs
     54
     55  # first check if the FITS table has any entries
     56  read -fits DATA -sizes
     57  if ($table:Ny == 0)
     58    echo "WARNING: empty reference table $refsrcs"
     59
     60    $OUT_FIELDS =
     61    foreach field $SMF_FIELDS_DIF $REF_FIELDS_DIF $XTR_FIELDS_DIF
     62      $OUT_FIELDS = $OUT_FIELDS $field\_out
     63      create -empty $field\_out
     64    end
     65   
     66    sprintf output "%s/%s.%s.dif.stf" $OUTDIR $expname $OUTVERSION
     67    write -fits DATA $output $OUT_FIELDS
     68    return
     69  end
     70
    5471  if ($USE_CAMSOURCE)
    5572   read -fits DATA Rref_out Dref_out Mref_out
  • trunk/ippTests/ippCheck/ippCheck

    r42058 r42125  
    5959  getargs -no-warp  BOOL  -var SKIP_WARP
    6060  getargs -no-diff  BOOL  -var SKIP_DIFF
    61   getargs -do-plots BOOL  -var DO_PLOTS;   
     61  getargs -no-plots BOOL  -var SKIP_PLOTS;   
    6262  getargs -use-refs BOOL  -var USE_REFSOURCE
    6363  getargs -camera   VALUE -var CAMERA;
     
    9797  end
    9898
    99   if ($DO_PLOTS) plot.exposure.real $expname
     99  if (not($SKIP_PLOTS)) plot.exposure.real $expname
    100100end
    101101
  • trunk/ippTests/ippCheck/warpmask.pro

    r41941 r42125  
    4444  # NOTE: Mref is chosen to match filter for this exposure
    4545  data $refsrcs                 ;
     46
     47  # first check if the FITS table has any entries
     48  read -fits DATA -sizes
     49  if ($table:Ny == 0)
     50    echo "WARNING: empty reference table $refsrcs"
     51
     52    # generate empty output vectors for output file
     53    $OUT_FIELDS =
     54    foreach field $REF_FIELDS_WRP $XTR_FIELDS_WRP
     55      $OUT_FIELDS = $OUT_FIELDS $field\_out
     56      create -empty $field\_out
     57    end
     58   
     59    sprintf output "%s/%s.%s.wrp.stf" $OUTDIR $expname $OUTVERSION
     60    write -fits DATA $output $OUT_FIELDS
     61
     62    return
     63  end
     64
    4665  if ($USE_CAMSOURCE)
    4766   read -fits DATA Rref_out Dref_out Mref_out
  • trunk/ippTests/ippCheck/warpstats.pro

    r41941 r42125  
    2424   # results in magFound, fracFound, numFound
    2525   calc.warpstats
    26    if ($i == 0)
     26   if (numTotal_sum?[] == 0)
    2727     set numTotal_sum = numTotal
    2828     set numPoss_sum  = numPoss
     
    3939 end
    4040   
    41  set numTotal = numTotal_sum
    42  set numPoss  = numPoss_sum
    43  delete numTotal_sum numPoss_sum
     41 if (numTotal_sum?[] == 0)
     42    # generate vectors for empty inputs
     43   calc.warpstats
     44 else   
     45   set numTotal = numTotal_sum
     46   set numPoss  = numPoss_sum
     47   delete numTotal_sum numPoss_sum
     48 end
    4449
    4550 set fracPoss  = (numTotal > 0) ? numPoss  / numTotal : zero(numTotal)
     
    8994 $Mdel = 0.25
    9095 
     96 if (Mref_out?[] == 0)
     97   create magBin $Mmin $Mmax $Mdel
     98   set numTotal = zero(magBin)
     99   set numPoss  = zero(magBin)
     100   return
     101 end
     102
    91103 delete -q  magBin numTotal numPoss
    92104 for mag $Mmin $Mmax $Mdel
Note: See TracChangeset for help on using the changeset viewer.