IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 20, 2015, 2:07:03 PM (11 years ago)
Author:
eugene
Message:

updating to test the forced warp stage (still turned off in fulltest.sh)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/test/mkgpc1data.dvo

    r38850 r38888  
    1212# I'm setting the base filename without the .smf and add it in mkcatdir.*
    1313
     14# some global value for ease of access:
     15$SKYCELL = "skycell.1133.081"
     16$TESS_ID = "RINGS.V3"
     17
    1418# imagedata describes the full fake exposure set.  the fields are
    1519list imagedata
    16 # exp_id stk_id filebase         M_off date       time
    17    1     1      $OUTDIR/test.01  0.000 2010/01/01 01:00:00
    18    2     1      $OUTDIR/test.02 -0.025 2010/01/01 02:00:00
    19    3     1      $OUTDIR/test.03  0.025 2010/01/01 03:00:00
    20    4     1      $OUTDIR/test.04  0.010 2010/01/01 04:00:00
    21    5     2      $OUTDIR/test.05  0.000 2010/01/01 05:00:00
    22    6     2      $OUTDIR/test.06 -0.025 2010/01/01 06:00:00
    23    7     2      $OUTDIR/test.07  0.025 2010/01/01 07:00:00
    24    8     2      $OUTDIR/test.08  0.010 2010/01/01 08:00:00
    25    9     3      $OUTDIR/test.09  0.000 2010/01/01 09:00:00
    26   10     3      $OUTDIR/test.10 -0.025 2010/01/01 10:00:00
    27   11     3      $OUTDIR/test.11  0.025 2010/01/01 11:00:00
    28   12     3      $OUTDIR/test.12  0.010 2010/01/01 12:00:00
    29 end
    30 
    31 list warpdata
    32  1 1 $OUTDIR/test.01  0.000 2010/01/01 01:00:00
    33  2 1 $OUTDIR/test.02 -0.025 2010/01/01 02:00:00
    34  3 1 $OUTDIR/test.03  0.025 2010/01/01 03:00:00
    35  4 1 $OUTDIR/test.04  0.010 2010/01/01 04:00:00
    36  5 2 $OUTDIR/test.05  0.000 2010/01/01 05:00:00
    37  6 2 $OUTDIR/test.06 -0.025 2010/01/01 06:00:00
    38  7 2 $OUTDIR/test.07  0.025 2010/01/01 07:00:00
    39  8 2 $OUTDIR/test.08  0.010 2010/01/01 08:00:00
    40  9 3 $OUTDIR/test.09  0.000 2010/01/01 09:00:00
    41 10 3 $OUTDIR/test.10 -0.025 2010/01/01 10:00:00
    42 11 3 $OUTDIR/test.11  0.025 2010/01/01 11:00:00
    43 12 3 $OUTDIR/test.12  0.010 2010/01/01 12:00:00
     20# exp_id stk_id filebase         M_off date       time      warpfile
     21   1     1      $OUTDIR/test.01  0.000 2010/01/01 01:00:00  $OUTDIR/warp.01
     22   2     1      $OUTDIR/test.02 -0.025 2010/01/01 02:00:00  $OUTDIR/warp.02
     23   3     1      $OUTDIR/test.03  0.025 2010/01/01 03:00:00  $OUTDIR/warp.03
     24   4     1      $OUTDIR/test.04  0.010 2010/01/01 04:00:00  $OUTDIR/warp.04
     25   5     2      $OUTDIR/test.05  0.000 2010/01/01 05:00:00  $OUTDIR/warp.05
     26   6     2      $OUTDIR/test.06 -0.025 2010/01/01 06:00:00  $OUTDIR/warp.06
     27   7     2      $OUTDIR/test.07  0.025 2010/01/01 07:00:00  $OUTDIR/warp.07
     28   8     2      $OUTDIR/test.08  0.010 2010/01/01 08:00:00  $OUTDIR/warp.08
     29   9     3      $OUTDIR/test.09  0.000 2010/01/01 09:00:00  $OUTDIR/warp.09
     30  10     3      $OUTDIR/test.10 -0.025 2010/01/01 10:00:00  $OUTDIR/warp.10
     31  11     3      $OUTDIR/test.11  0.025 2010/01/01 11:00:00  $OUTDIR/warp.11
     32  12     3      $OUTDIR/test.12  0.010 2010/01/01 12:00:00  $OUTDIR/warp.12
    4433end
    4534
     
    5544  mkcatdir.cam PS1_V5 PS1_V5
    5645  mkcatdir.stk PS1_V5 PS1_V5
     46  mkcatdir.wrp PS1_V5_Lensing PS1_V5
    5747  insert.stack.set
    5848end
     
    6858  $DEC = 20.0
    6959
    70   break -auto off
    7160  exec mkgpc1.sh delete $dbhost $dbname $dbuser $dbpass
    72   break -auto on
    7361  exec mkgpc1.sh create $dbhost $dbname $dbuser $dbpass
    7462
     
    7765  # system-wide info
    7866  dbinsert ippToPspsFake (my_id) values (2)
    79   dbinsert skycell (radeg, decdeg, skycell_id) values ($RA, $DEC, "skycell.0000.000")
     67  dbinsert skycell (radeg, decdeg, skycell_id) values ($RA, $DEC, $SKYCELL)
    8068end
    8169
     
    163151
    164152    mkinput $offset $rawfile
    165     echo mkcmf -photcode SIMTEST.r.Chip -no-noise -append $rawfile $cmffile -date $myDATE -time $myTIME -radec $RA $DEC -type $1 -imageID $ID -sourceID 0
    166     exec mkcmf -photcode SIMTEST.r.Chip -no-noise -append $rawfile $cmffile -date $myDATE -time $myTIME -radec $RA $DEC -type $1 -imageID $ID -sourceID 0
     153    echo mkcmf -photcode SIMTEST.r.Chip -no-noise -append $rawfile $cmffile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $ID -sourceID 0
     154    exec mkcmf -photcode SIMTEST.r.Chip -no-noise -append $rawfile $cmffile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $ID -sourceID 0
    167155
    168156    if ($i == 3)
     
    238226
    239227    mkinput $offset $rawfile
    240     echo mkcmf -stack -photcode SIMTEST.r.SkyChip $rawfile $cmffile -extroot SkyChip -date 2008/1/1 -time $i\:00:00 -radec $RA $DEC -type $1 -imageID $ID -sourceID 1
    241     exec mkcmf -stack -photcode SIMTEST.r.SkyChip $rawfile $cmffile -extroot SkyChip -date 2008/1/1 -time $i\:00:00 -radec $RA $DEC -type $1 -imageID $ID -sourceID 1
     228    echo mkcmf -stack -photcode SIMTEST.r.SkyChip $rawfile $cmffile -extroot SkyChip -date 2008/1/1 -time $i\:00:00 -mjd 54466.0 -radec $RA $DEC -type $1 -imageID $ID -sourceID 1 -tess_id $TESS_ID -skycell $SKYCELL
     229    exec mkcmf -stack -photcode SIMTEST.r.SkyChip $rawfile $cmffile -extroot SkyChip -date 2008/1/1 -time $i\:00:00 -mjd 54466.0 -radec $RA $DEC -type $1 -imageID $ID -sourceID 1 -tess_id $TESS_ID -skycell $SKYCELL
    242230
    243231    # add some required header keywords:
    244232    exec echo "HIERARCH FPA.ZP =          25. / Magnitude zero point" > tmp.hdr
    245     exec echo "TESS_ID = 'RINGS.V3'" >> tmp.hdr
    246     exec echo "SKYCELL = 'skycell.1133.081'" >> tmp.hdr
    247233    exec fits_insert $cmffile tmp.hdr
    248234
     
    273259end
    274260
     261# create a populated catdir with a set of cmf files, save the filenames in list for use by insert.exp
     262macro mkcatdir.wrp
     263  if ($0 != 3)
     264    echo "mkcatdir.wrp (cmftype) (dvotype)"
     265    break
     266  end
     267
     268  # tapPLAN 4
     269
     270  mkdir $OUTDIR
     271
     272  local i catdir RA DEC ID rawfile cmffile offset
     273  $catdir = $OUTDIR/catdir.wrp
     274  exec rm -rf $catdir
     275
     276  $RA = 10.0
     277  $DEC = 20.0
     278
     279  $TIMEFORMAT = mjd
     280  $TIMEREF = 2001/01/01,00:00:00
     281
     282  for i 0 $imagedata:n
     283    list word -split $imagedata:$i
     284    $ID = $word:0
     285    $rawfile = $word:2\.txt; # use the cam-stage rawfile
     286    $cmffile = $word:6\.smf
     287    $offset = $word:3
     288
     289    sprintf myDATE "%s" $word:4
     290    sprintf myTIME "%s" $word:5
     291    echo ctimes -abs $myDATE,$myTIME -var mjd
     292    ctimes -abs $myDATE,$myTIME -var mjd
     293
     294    ## this is not generating photcodes recognized as stack by relphot
     295
     296    mkinput $offset $rawfile
     297    echo mkcmf -forcedwarp -photcode SIMTEST.r.ForcedWarp $rawfile $cmffile -extroot SkyChip -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $ID -sourceID 1 -tess_id $TESS_ID -skycell $SKYCELL
     298    exec mkcmf -forcedwarp -photcode SIMTEST.r.ForcedWarp $rawfile $cmffile -extroot SkyChip -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $ID -sourceID 1 -tess_id $TESS_ID -skycell $SKYCELL
     299
     300    echo addstar -D SKY_DEPTH 4 -D CATDIR $catdir -D CAMERA simtest $cmffile -D CATFORMAT $2 -quick-airmass
     301    exec addstar -D SKY_DEPTH 4 -D CATDIR $catdir -D CAMERA simtest $cmffile -D CATFORMAT $2 -quick-airmass
     302  end
     303
     304  echo relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update
     305  exec relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update
     306
     307  if ($PARALLEL)
     308    $hostname = `hostname`
     309    exec rm -f $catdir/HostTable.dat
     310    output $catdir/HostTable.dat
     311    echo "# ID Hostname Catdir"
     312    echo " 1 $hostname $catdir.p1"
     313    echo " 2 $hostname $catdir.p2"
     314    echo " 3 $hostname $catdir.p3"
     315    output stdout
     316    exec dvodist -out $catdir
     317  end
     318
     319  # for i 0 $offset:n
     320  #   tapOK {abs(Mcal[$i] - Mcal[0] - $offset:$i) < 0.001} "Mcal $i"
     321  # end
     322
     323  # tapDONE
     324end
     325
    275326macro insert.exp
    276327  if ($0 != 3)
     
    296347  dbinsert camProcessedExp (cam_id, path_base, fault) values ($myID, "$filename", 0)
    297348  dbinsert fakeRun (fake_id, cam_id) values ($myID, $myID)
    298   dbinsert warpRun (warp_id, fake_id) values ($myID, $myID)
    299   dbinsert warpSkyCellMap (warp_id, skycell_id, class_id) values ($myID, "skycell.0000.000", "XY00")
     349  dbinsert warpRun (warp_id, fake_id, tess_id) values ($myID, $myID, $TESS_ID)
     350  dbinsert warpSkyCellMap (warp_id, skycell_id, class_id) values ($myID, $SKYCELL, "XY00")
     351  dbinsert warpImfile (warp_id, skycell_id, warp_skyfile_id) values ($myID, $SKYCELL, $myID)
    300352
    301353  dbinsert addRun (add_id, stage, state, stage_id, minidvodb_name) values ($myID, "cam", "full", $myID, "catdir.cam")
    302354  dbinsert addProcessedExp (add_id, fault) values ($myID, 0)
     355end
     356
     357macro insert.wrp
     358  if ($0 != 4)
     359    echo "USAGE: insert.wrp (warpID) (stackID) (filename)"
     360    break
     361  end
     362
     363  local wrpID stkID filename
     364  $wrpID = $1
     365  $stkID = $2
     366  $filename = $3
     367
     368  # a single exposure
     369  echo $myDATE
     370  echo $myTIME
     371
     372  dbinsert addRun (add_id, stage, state, stage_id, stage_extra1, minidvodb_name) values ($wrpID, "fullforce", "full", $stkID, $wrpID, "catdir.wrp")
     373
     374  # we have a single fullForceRun for each stack, so we can match fullForceRun ids to stackRun ids
     375  dbinsert fullForceInput (ff_id, warp_id) values ($stkID, $wrpID)
     376  dbinsert fullForceResult (ff_id, warp_id, software_ver, path_base) values ($stkID, $wrpID, "38000M", "$filename")
    303377end
    304378
     
    310384  end
    311385
    312   local i stkID expID expfile stkfile
     386  local i stkID expID expfile wrpfile stkfile
    313387 
    314388  $stkID = $1
    315389  $stkfile = $2
    316390
    317   dbinsert stackRun (stack_id, skycell_id, filter, software_ver) values ($stkID, "skycell.0000.000", "g.00000", "37500")
     391  dbinsert stackRun (stack_id, skycell_id, filter, software_ver) values ($stkID, $SKYCELL, "g.00000", "37500")
     392
     393  # we have a single fullForceRun for each stack, so we can match fullForceRun ids to stackRun ids
     394  dbinsert fullForceRun (ff_id, skycal_id) values ($stkID, $stkID)
    318395
    319396  $TIMEFORMAT = mjd
     
    329406
    330407    $expID = $tmp:0
    331     $expfile = $tmp:2
    332408    sprintf myDATE "%s" $tmp:4
    333409    sprintf myTIME "%s" $tmp:5
     410
     411    $expfile = $tmp:2
    334412    insert.exp $expID $expfile
     413
     414    $wrpfile = $tmp:6
     415    insert.wrp $expID $stkID $wrpfile
     416
    335417    dbinsert stackInputSkyfile (stack_id, warp_id) values ($stkID, $expID)
    336418
     
    376458  dbinsert mergedvodbRun (minidvodb_id, merge_id, state, mergedvodb) values (2, 2, "full", "catdir.stk")
    377459  dbinsert mergedvodbProcessed (merge_id, fault) values (2, 0)
     460
     461  # catdirs for the forced warps
     462  dbinsert minidvodbRun (minidvodb_name, minidvodb_id, state) values ("catdir.wrp", 3, "merged")
     463  dbinsert minidvodbProcessed (minidvodb_id, fault) values (3, 0)
     464 
     465  dbinsert mergedvodbRun (minidvodb_id, merge_id, state, mergedvodb) values (3, 3, "full", "catdir.wrp")
     466  dbinsert mergedvodbProcessed (merge_id, fault) values (3, 0)
    378467end
    379468
Note: See TracChangeset for help on using the changeset viewer.