IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 22, 2015, 5:55:02 AM (11 years ago)
Author:
eugene
Message:

add g & r filters to test output; add imageID as part of stack sql to set zero point and related

File:
1 edited

Legend:

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

    r38932 r38939  
    1919# imagedata describes the full fake exposure set.  the fields are
    2020list imagedata
    21 # exp_id stk_id filebase         M_off date       time      warpfile
    22    1     1      $OUTDIR/test.01  0.000 2010/01/01 01:00:00  $OUTDIR/warp.01
    23    2     1      $OUTDIR/test.02 -0.025 2010/01/01 02:00:00  $OUTDIR/warp.02
    24    3     1      $OUTDIR/test.03  0.025 2010/01/01 03:00:00  $OUTDIR/warp.03
    25    4     1      $OUTDIR/test.04  0.010 2010/01/01 04:00:00  $OUTDIR/warp.04
    26    5     2      $OUTDIR/test.05  0.000 2010/01/01 05:00:00  $OUTDIR/warp.05
    27    6     2      $OUTDIR/test.06 -0.025 2010/01/01 06:00:00  $OUTDIR/warp.06
    28    7     2      $OUTDIR/test.07  0.025 2010/01/01 07:00:00  $OUTDIR/warp.07
    29    8     2      $OUTDIR/test.08  0.010 2010/01/01 08:00:00  $OUTDIR/warp.08
    30    9     3      $OUTDIR/test.09  0.000 2010/01/01 09:00:00  $OUTDIR/warp.09
    31   10     3      $OUTDIR/test.10 -0.025 2010/01/01 10:00:00  $OUTDIR/warp.10
    32   11     3      $OUTDIR/test.11  0.025 2010/01/01 11:00:00  $OUTDIR/warp.11
    33   12     3      $OUTDIR/test.12  0.010 2010/01/01 12:00:00  $OUTDIR/warp.12
     21# exp_id stk_id filebase         M_off date       time      warpfile         filter
     22   1     1      $OUTDIR/test.01  0.000 2010/01/01 01:00:00  $OUTDIR/warp.01  g
     23   2     1      $OUTDIR/test.02 -0.025 2010/01/01 02:00:00  $OUTDIR/warp.02  g
     24   3     1      $OUTDIR/test.03  0.025 2010/01/01 03:00:00  $OUTDIR/warp.03  g
     25   4     1      $OUTDIR/test.04  0.010 2010/01/01 04:00:00  $OUTDIR/warp.04  g
     26#  5     2      $OUTDIR/test.05  0.000 2010/01/01 05:00:00  $OUTDIR/warp.05  g
     27#  6     2      $OUTDIR/test.06 -0.025 2010/01/01 06:00:00  $OUTDIR/warp.06  g
     28#  7     2      $OUTDIR/test.07  0.025 2010/01/01 07:00:00  $OUTDIR/warp.07  g
     29#  8     2      $OUTDIR/test.08  0.010 2010/01/01 08:00:00  $OUTDIR/warp.08  g
     30#  9     3      $OUTDIR/test.09  0.000 2010/01/01 09:00:00  $OUTDIR/warp.09  g
     31# 10     3      $OUTDIR/test.10 -0.025 2010/01/01 10:00:00  $OUTDIR/warp.10  g
     32# 11     3      $OUTDIR/test.11  0.025 2010/01/01 11:00:00  $OUTDIR/warp.11  g
     33# 12     3      $OUTDIR/test.12  0.010 2010/01/01 12:00:00  $OUTDIR/warp.12  g
     34  13     4      $OUTDIR/test.13 -0.025 2010/01/02 01:00:00  $OUTDIR/warp.13  r
     35  14     4      $OUTDIR/test.14  0.025 2010/01/02 02:00:00  $OUTDIR/warp.14  r
     36  15     4      $OUTDIR/test.15  0.010 2010/01/02 03:00:00  $OUTDIR/warp.15  r
     37  16     4      $OUTDIR/test.16  0.000 2010/01/02 04:00:00  $OUTDIR/warp.16  r
     38# 17     5      $OUTDIR/test.17 -0.025 2010/01/02 05:00:00  $OUTDIR/warp.17  r
     39# 18     5      $OUTDIR/test.18  0.025 2010/01/02 06:00:00  $OUTDIR/warp.18  r
     40# 19     5      $OUTDIR/test.19  0.010 2010/01/02 07:00:00  $OUTDIR/warp.19  r
     41# 20     5      $OUTDIR/test.20  0.000 2010/01/02 08:00:00  $OUTDIR/warp.20  r
     42# 21     6      $OUTDIR/test.21 -0.025 2010/01/02 09:00:00  $OUTDIR/warp.21  r
     43# 22     6      $OUTDIR/test.22  0.025 2010/01/02 10:00:00  $OUTDIR/warp.22  r
     44# 23     6      $OUTDIR/test.23  0.010 2010/01/02 11:00:00  $OUTDIR/warp.23  r
     45# 24     6      $OUTDIR/test.24 -0.020 2010/01/02 12:00:00  $OUTDIR/warp.24  r
    3446end
    3547
    3648list stackdata
    37 # stk_id filename         M_off
    38   1      $OUTDIR/stack.01 0.010
    39   2      $OUTDIR/stack.02 0.020
    40   3      $OUTDIR/stack.03 0.030
     49# stk_id sky_id filename         M_off filter
     50  1      1      $OUTDIR/stack.01 0.010 g
     51# 2      2      $OUTDIR/stack.02 0.020 g
     52# 3      3      $OUTDIR/stack.03 0.030 g
     53  4      1      $OUTDIR/stack.04 0.025 r
     54# 5      2      $OUTDIR/stack.05 0.035 r
     55# 6      3      $OUTDIR/stack.06 0.045 r
    4156end
    4257 
    4358macro mkfull
    4459  init.db
    45   mkcatdir.cam PS1_V5 PS1_V5
     60# mkcatdir.cam PS1_V5 PS1_V5
    4661  mkcatdir.stk PS1_V5 PS1_V5
    47   mkcatdir.wrp PS1_V5_Lensing PS1_V5
     62# mkcatdir.wrp PS1_V5_Lensing PS1_V5
    4863  insert.stack.set
    4964end
     
    96111    $cmffile = $word:2\.smf
    97112    $offset = $word:3
    98 
    99113    sprintf myDATE "%s" $word:4
    100114    sprintf myTIME "%s" $word:5
     115    $filter = $word:7
     116
    101117    echo ctimes -abs $myDATE,$myTIME -var mjd
    102118    ctimes -abs $myDATE,$myTIME -var mjd
     
    114130    mcreate dummy 0 0
    115131    keyword dummy MJD-OBS  -wf $mjd
    116     keyword dummy FILTERID -w  r.00000
     132    keyword dummy FILTERID -w  $filter.00000
    117133    keyword dummy EXPTIME  -wf 1.0
    118134
     
    152168
    153169    mkinput $offset $rawfile
    154     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
    155     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
     170    echo mkcmf -photcode SIMTEST.$filter.Chip -no-noise -append $rawfile $cmffile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $ID -sourceID 0
     171    exec mkcmf -photcode SIMTEST.$filter.Chip -no-noise -append $rawfile $cmffile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $ID -sourceID 0
    156172
    157173    if ($i == 3)
     
    210226  mkdir $OUTDIR
    211227
    212   local i catdir RA DEC ID rawfile cmffile offset
     228  local i catdir RA DEC stkID skyID rawfile cmffile offset
    213229  $catdir = $OUTDIR/catdir.stk
    214230  exec rm -rf $catdir
     
    219235  for i 0 $stackdata:n
    220236    list word -split $stackdata:$i
    221     $ID = $word:0
    222     $rawfile = $word:1\.txt
    223     $cmffile = $word:1\.cmf
    224     $offset = $word:2
     237    $stkID = $word:0
     238    $skyID = $word:1
     239    $rawfile = $word:2\.txt
     240    $cmffile = $word:2\.cmf
     241    $offset = $word:3
     242    $filter = $word:4
    225243
    226244    ## this is not generating photcodes recognized as stack by relphot
    227245
    228246    mkinput $offset $rawfile
    229     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
    230     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
     247    echo mkcmf -stack -photcode SIMTEST.$filter.SkyChip $rawfile $cmffile -extroot SkyChip -date 2008/1/1 -time $i\:00:00 -mjd 54466.0 -radec $RA $DEC -type $1 -imageID $stkID -sourceID 1 -tess_id $TESS_ID -skycell $SKYCELL
     248    exec mkcmf -stack -photcode SIMTEST.$filter.SkyChip $rawfile $cmffile -extroot SkyChip -date 2008/1/1 -time $i\:00:00 -mjd 54466.0 -radec $RA $DEC -type $1 -imageID $stkID -sourceID 1 -tess_id $TESS_ID -skycell $SKYCELL
    231249
    232250    # add some required header keywords:
    233     exec echo "HIERARCH FPA.ZP =          25. / Magnitude zero point" > tmp.hdr
    234     exec fits_insert $cmffile tmp.hdr
    235 
    236     echo addstar -D SKY_DEPTH 4 -D CATDIR $catdir -D CAMERA simtest $cmffile -D CATFORMAT $2 -quick-airmass
    237     exec addstar -D SKY_DEPTH 4 -D CATDIR $catdir -D CAMERA simtest $cmffile -D CATFORMAT $2 -quick-airmass
    238   end
    239 
    240   echo relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update
    241   exec relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update
     251    # exec echo "HIERARCH FPA.ZP =          {25.+$offset} / Magnitude zero point" > tmp.hdr
     252    # exec fits_insert $cmffile tmp.hdr
     253
     254    echo addstar -D SKY_DEPTH 4 -D CATDIR $catdir -D CAMERA simtest $cmffile -D CATFORMAT $2 -quick-airmass -D ZERO_POINT_OPTION CHIP_HEADER
     255    exec addstar -D SKY_DEPTH 4 -D CATDIR $catdir -D CAMERA simtest $cmffile -D CATFORMAT $2 -quick-airmass -D ZERO_POINT_OPTION CHIP_HEADER
     256  end
     257
     258# echo relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update
     259# exec relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update
     260
     261  echo relphot -D CATDIR $catdir -region 8 12 18 22 -averages -update
     262  exec relphot -D CATDIR $catdir -region 8 12 18 22 -averages -update
    242263
    243264  if ($PARALLEL)
     
    287308    $cmffile = $word:6\.cmf
    288309    $offset = $word:3
    289 
    290310    sprintf myDATE "%s" $word:4
    291311    sprintf myTIME "%s" $word:5
     312    $filter = $word:7
     313
    292314    echo ctimes -abs $myDATE,$myTIME -var mjd
    293315    ctimes -abs $myDATE,$myTIME -var mjd
     
    296318
    297319    mkinput $offset $rawfile
    298     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 2 -tess_id $TESS_ID -skycell $SKYCELL -bad-psfqf-frac $BAD_PSFQF_FRAC
    299     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 2 -tess_id $TESS_ID -skycell $SKYCELL -bad-psfqf-frac $BAD_PSFQF_FRAC
     320    echo mkcmf -forcedwarp -photcode SIMTEST.$filter.ForcedWarp $rawfile $cmffile -extroot SkyChip -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $ID -sourceID 2 -tess_id $TESS_ID -skycell $SKYCELL -bad-psfqf-frac $BAD_PSFQF_FRAC
     321    exec mkcmf -forcedwarp -photcode SIMTEST.$filter.ForcedWarp $rawfile $cmffile -extroot SkyChip -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $ID -sourceID 2 -tess_id $TESS_ID -skycell $SKYCELL -bad-psfqf-frac $BAD_PSFQF_FRAC
    300322
    301323    echo addstar -D SKY_DEPTH 4 -D CATDIR $catdir -D CAMERA simtest $cmffile -D CATFORMAT $2 -quick-airmass -xrad
     
    383405# this inserts a single stack, adding the exposures associated with this stack
    384406macro insert.stack
    385   if ($0 != 3)
    386     echo "USAGE: insert.stack (ID) (stkfile)"
    387     break
    388   end
    389 
    390   local i stkID expID expfile wrpfile stkfile
     407  if ($0 != 5)
     408    echo "USAGE: insert.stack (stkID) (skyID) (stkfile) (filter)"
     409    break
     410  end
     411
     412  local i stkID skyID expID expfile wrpfile stkfile filter
    391413 
    392   $stkID = $1
    393   $stkfile = $2
    394 
    395   dbinsert stackRun (stack_id, skycell_id, filter, software_ver) values ($stkID, $SKYCELL, "g.00000", "37500")
     414  $stkID   = $1
     415  $skyID   = $2
     416  $stkfile = $3
     417  $filter  = $4
     418
     419  $skycalID = $stkID + 20
     420
     421  dbinsert stackRun (stack_id, skycell_id, filter, software_ver) values ($stkID, $SKYCELL, "$filter.00000", "37500")
    396422
    397423  # we have a single fullForceRun for each stack, so we can match fullForceRun ids to stackRun ids
    398   dbinsert fullForceRun (ff_id, skycal_id) values ($stkID, $stkID)
     424  dbinsert fullForceRun (ff_id, skycal_id) values ($stkID, $skycalID)
    399425
    400426  $TIMEFORMAT = mjd
     
    429455
    430456  dbinsert stackSumSkyfile (stack_id, mjd_obs) values ($stkID, $mjd)
    431   dbinsert skycalRun (sky_id, skycal_id, stack_id) values ($stkID, $stkID, $stkID)
    432   dbinsert skycalResult (skycal_id, path_base) values ($stkID, "$stkfile")
     457  dbinsert skycalRun (sky_id, skycal_id, stack_id) values ($skyID, $skycalID, $stkID)
     458  dbinsert skycalResult (skycal_id, path_base) values ($skycalID, "$stkfile")
    433459 
    434   dbinsert addRun (stage, state, stage_id, minidvodb_name) values ("skycal", "full", $stkID, "catdir.stk")
     460  dbinsert addRun (stage, state, stage_id, minidvodb_name) values ("skycal", "full", $skycalID, "catdir.stk")
    435461end
    436462
     
    438464macro insert.stack.set
    439465
    440   local i
     466  local i stkID skyID cmffile filter
    441467
    442468  for i 0 $stackdata:n
    443469    list word -split $stackdata:$i
    444     $ID = $word:0
    445     $cmffile = $word:1
    446     insert.stack $ID $cmffile
     470    $stkID = $word:0
     471    $skyID = $word:1
     472    $cmffile = $word:2
     473    $filter = $word:4
     474    insert.stack $stkID $skyID $cmffile $filter
    447475  end
    448476
Note: See TracChangeset for help on using the changeset viewer.