IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33288


Ignore:
Timestamp:
Feb 16, 2012, 3:24:18 PM (14 years ago)
Author:
eugene
Message:

fix up parallel tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/Ohana/src/addstar/test/relphot.parallel.dvo

    r33281 r33288  
    1111# set various global variables
    1212macro init
     13  echo "starting init..."
    1314  $RA_CENTER = 10.0
    1415  $DEC_CENTER = 20.0
     
    2223  $CHIP_DX = 1000
    2324  $CHIP_DY = 1000
     25  if (not($?VERBOSE)) set VERBOSE = 0
    2426
    2527  # images are loaded into dvo with GPC1 photcodes, so we need to get the nominal zps for those filters
     
    4446  # mjd and zpt values for not-ubercal'ed images
    4547  $filt_nc:n = 9
    46   $filt_nc:0 = g
    47   $filt_nc:1 = g
    48   $filt_nc:2 = g
    49   $filt_nc:3 = r
    50   $filt_nc:4 = r
    51   $filt_nc:5 = r
    52   $filt_nc:6 = i
    53   $filt_nc:7 = i
    54   $filt_nc:8 = i
     48  create filtN_nc 0 $filt_nc:n
     49  $filt_nc:0 = g;  filtN_nc[0] = 1
     50  $filt_nc:1 = g;  filtN_nc[1] = 1
     51  $filt_nc:2 = g;  filtN_nc[2] = 1
     52  $filt_nc:3 = r;  filtN_nc[3] = 2
     53  $filt_nc:4 = r;  filtN_nc[4] = 2
     54  $filt_nc:5 = r;  filtN_nc[5] = 2
     55  $filt_nc:6 = i;  filtN_nc[6] = 3
     56  $filt_nc:7 = i;  filtN_nc[7] = 3
     57  $filt_nc:8 = i;  filtN_nc[8] = 3
    5558
    5659  # airmass slopes for these sequnece
     
    6669  # ubercal zero points are defined as ZP_nominal + 2.5log(exptime) + K*(airmass - 1.0)
    6770  set zpt_nc = 25.0 + 2.5*log(exptime_nc) + klam_nc*(airmass_nc - 1.0) - tmpseq*0.0050 + 0.0025
     71
     72  # without an ubercal or other tie, relphot should set zpts to the mean of the zpts for a filter
     73  subset tmp = zpt_nc where filtN_nc == 1; vstat -q tmp; set zpt_nc_g = $MEAN
     74  subset tmp = zpt_nc where filtN_nc == 2; vstat -q tmp; set zpt_nc_r = $MEAN
     75  subset tmp = zpt_nc where filtN_nc == 3; vstat -q tmp; set zpt_nc_i = $MEAN
    6876
    6977  set mjd_nc = zero(zpt_nc)
     
    106114  end
    107115
    108   # run relphot on the db and check that the images now match the expected values
    109   exec relphot g,r,i -v -region 9.5 10.5 19.5 20.5 -D CATDIR $catdir -D STAR_TOOFEW 1 -D SIGMA_LIM 0.07 -statmode WT_MEAN -cloud-limit 0.5 -keep-ubercal -D IMAGE_OFFSET 0.5 -update >& tmp.log
     116  # parallel-ize the database
     117  mkparallel $catdir
     118
     119  # run relphot on the serial db and check that the images now match the expected values
     120  exec relphot g,r,i -v -region 9.5 10.5 19.5 20.5 -D CATDIR $catdir -D STAR_TOOFEW 1 -D SIGMA_LIM 0.07 -statmode WT_MEAN -cloud-limit 0.5 -keep-ubercal -D IMAGE_OFFSET 0.5 -update >& log.relphot.s0
    110121
    111122  for i 0 mjd_nc[]
    112     # XXX this is a little ill-defined : if we run relphot with no tied down data, we should convert
    113     # on a solution with zero points matching the mean zp of photometric data (hence the choice of element
    114     # 1 in the zpt_nc[] array below.
    115     ckexposure $catdir mjd_nc[$i] zpt_nc[1] exptime_nc[$i] airmass_nc[$i] $filt_nc:$i relphot_nc
    116     # ckexposure $catdir mjd_nc[$i] zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] $filt_nc:$i raw
     123    # this is a little ill-defined : if we run relphot with no tied
     124    # down data, we should convert on a solution with zero points
     125    # matching the mean zp of photometric data, which we calculate in
     126    # 'init'
     127    ckexposure $catdir mjd_nc[$i] $zpt_nc_$filt_nc:$i exptime_nc[$i] airmass_nc[$i] $filt_nc:$i relphot_nc
     128  end
     129
     130  # run relphot on the parallel db and check that the images now match the expected values
     131  exec relphot -parallel-serial g,r,i -v -region 9.5 10.5 19.5 20.5 -D CATDIR $catdir.p0 -D STAR_TOOFEW 1 -D SIGMA_LIM 0.07 -statmode WT_MEAN -cloud-limit 0.5 -keep-ubercal -D IMAGE_OFFSET 0.5 -update >& log.relphot.p0
     132
     133  for i 0 mjd_nc[]
     134    # this is a little ill-defined : if we run relphot with no tied
     135    # down data, we should convert on a solution with zero points
     136    # matching the mean zp of photometric data, which we calculate in
     137    # 'init'
     138    ckexposure $catdir.p0 mjd_nc[$i] $zpt_nc_$filt_nc:$i exptime_nc[$i] airmass_nc[$i] $filt_nc:$i relphot_nc
    117139  end
    118140
     
    206228
    207229  $ZPT_REAL_NORM = $ZPT_REAL - 2.5*log($EXPTIME) - $KLAM_NOMINAL*($AIRMASS - 1.0)
    208   echo "$ZPT_REAL_NORM = $ZPT_REAL - 2.5*log($EXPTIME) - $KLAM_NOMINAL*($AIRMASS - 1.0)"
     230  if ($VERBOSE) echo "$ZPT_REAL_NORM = $ZPT_REAL - 2.5*log($EXPTIME) - $KLAM_NOMINAL*($AIRMASS - 1.0)"
    209231
    210232  if ("$MODE" == "raw")
     
    236258  if ("$MODE" == "relphot_nc")
    237259    vstat -q dm
    238     tapOK {abs($MEAN - $ZPT_NOMINAL + $ZPT_REAL_NORM) < 0.005} "setphot_nc  ZP $MJD_IMAGE $FILTER : $MEAN $ZPT_NOMINAL $ZPT_REAL_NORM {($MEAN - $ZPT_NOMINAL + $ZPT_REAL_NORM)}"
     260    tapOK {abs($MEAN - $ZPT_NOMINAL + $ZPT_REAL_NORM) < 0.005} "relphot_nc  ZP $MJD_IMAGE $FILTER : $MEAN $ZPT_NOMINAL $ZPT_REAL_NORM {($MEAN - $ZPT_NOMINAL + $ZPT_REAL_NORM)}"
    239261    return
    240262  end
     
    254276  end
    255277
     278  echo "starting mksequence..."
    256279  local i T1 T2
    257280
     
    259282  # we have a second set of mjd and zero point values for non-ubercal'ed images
    260283  for i 0 mjd_nc[]
     284    echo -no-return "$i.. "
    261285    mkexposure $1.nc.$i $RA_CENTER $DEC_CENTER zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] mjd_nc[$i] $filt_nc:$i $2
    262286  end
    263287  ctimes -abs now -var T2
    264   echo "elapsed: {86400*($T2 - $T1)}"
     288  echo "done ({86400*($T2 - $T1)} sec)"
    265289end
    266290
     
    293317    $dec = $DECo - $dy / 3600.0
    294318    # echo $ra $dec $dx $dy
    295     echo mkinput test.in.txt $ra $dec $ZPT
     319    if ($VERBOSE) echo mkinput test.in.txt $ra $dec $ZPT
    296320    mkinput test.in.txt $ra $dec $ZPT
    297321    # costs 7/36 sec / chip
     
    309333    $options = $options -airmass $AIRMASS
    310334    $options = $options -exptime $EXPTIME
     335    if ($VERBOSE) echo mkcmf test.in.txt $ROOT.$ix.$iy.cmf $options
    311336    exec mkcmf test.in.txt $ROOT.$ix.$iy.cmf $options
    312     echo mkcmf test.in.txt $ROOT.$ix.$iy.cmf $options
    313337    # costs 8/36 sec / chip
    314338
    315339    # the fake images have inconsistent ra,dec and airmass,sidtime values
    316     echo addstar $ROOT.$ix.$iy.cmf -D CATDIR $CATDIR -D CAMERA gpc1 -quick-airmass
     340    if ($VERBOSE) echo addstar $ROOT.$ix.$iy.cmf -D CATDIR $CATDIR -D CAMERA gpc1 -quick-airmass
    317341    exec addstar $ROOT.$ix.$iy.cmf -D CATDIR $CATDIR -D CAMERA gpc1 -quick-airmass >& /dev/null
    318342    # costs 10/36 sec / chip
     
    373397  end
    374398
     399  echo "starting mkstars..."
    375400  local RA_RANGE DEC_RANGE
    376401
     
    387412end
    388413
    389 # create a populated catdir with a couple of cmf files
    390 macro test.relphot
    391   if ($0 != 3)
    392     echo "test.relphot (cmftype) (dvotype)"
    393     break
    394   end
    395 
    396   tapPLAN 4
    397 
    398   exec rm -rf catdir.test
    399 
    400   $RA = 10.0
    401   $DEC = 20.0
    402 
    403   for i 0 $offset:n
    404     mkinput test.in.txt $offset:$i
    405     exec mkcmf test.in.txt test.cmf -date 2008/1/1 -time $i\:00:00 -radec $RA $DEC -type $1
    406     exec addstar -D CATDIR catdir.test -D CAMERA simtest test.cmf -D CATFORMAT $2
    407   end
    408 
    409   exec relphot -D CATDIR catdir.test r -region {$RA-1.0} {$RA+1.0} {$DEC-1.0} {$DEC+1.0} -update -nloop 10.0 >& /dev/null
    410 
    411   catdir catdir.test
    412   skyregion {$RA-1.0} {$RA+1.0} {$DEC-1.0} {$DEC+1.0}
    413 
    414   imextract time Mcal
    415 
    416   for i 0 $offset:n
    417     tapOK {abs(Mcal[$i] - Mcal[0] - $offset:$i) < 0.001} "Mcal $i"
    418   end
    419 
    420   exec rm test.cmf test.in.txt
    421   exec rm -r catdir.test
    422 
    423   tapDONE
    424 end
    425 
    426 # running setphot: setphot testzpt.fits -update -ubercal -D CATDIR catdir.test
     414# copy the catdir to catdir.p0 and parallelize to local directories catdir.d1 - catdir.d3
     415macro mkparallel
     416  if ($0 != 2)
     417    echo "USAGE: mkparallel (catdir)"
     418    break
     419  end
     420
     421  local hostname catdir
     422 
     423  $hostname = `hostname -s`
     424
     425  $tmp1 = `dirname $1`
     426  $tmp2 = `basename $1`
     427  $catdir = $tmp1/$tmp2
     428
     429  exec rsync -auv $catdir/ $catdir.p0/
     430  mkdir $catdir.d1
     431  mkdir $catdir.d2
     432  mkdir $catdir.d3
     433 
     434  exec rm -f $catdir.p0/HostTable.dat
     435  exec echo "1 $hostname $catdir.d1" >  $catdir.p0/HostTable.dat
     436  exec echo "2 $hostname $catdir.d2" >> $catdir.p0/HostTable.dat
     437  exec echo "3 $hostname $catdir.d3" >> $catdir.p0/HostTable.dat
     438
     439  exec dvodist -out $catdir.p0
     440end
     441
Note: See TracChangeset for help on using the changeset viewer.