IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 27, 2018, 3:31:55 PM (8 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/czw_branch/20170908
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20170908

  • branches/czw_branch/20170908/ippToPsps/test/mkgpc1data.dvo

    r39165 r40483  
    1717$RA = 10.0
    1818$DEC = 20.0
    19 $SKYCELL = "skycell.1133.081"
    20 $TESS_ID = "RINGS.V3"
    21 $BAD_PSFQF_FRAC = 0.2
     19$SKYCELL = skycell.1133.081
     20$TESS_ID = RINGS.V3
     21$BAD_PSFQF_FRAC = 0.0
     22$ADDNOISE = "-no-noise"
     23
     24# a note on double quotes and TESS_ID:
     25# since the variables TESS_ID and SKYCELL are used below to construct the list, their values should NOT be wrapped in double quotes
     26# or those double quotes are embedded in the strings in the list
     27# when TESS_ID and SKYCELL appear in mysql commands as values they need to be protected with double quotes so mysql does not
     28# interpret them as db table fields
    2229
    2330# imagedata describes the full fake exposure set.  the fields are
    2431list imagedata
    25 # exp_id stk_id filebase         M_off date       time      warpfile         filter  difffile
    26    1     1      $OUTDIR/test.01  0.000 2010/01/01 01:00:00  $OUTDIR/warp.01  g       $OUTDIR/diff.01
    27    2     1      $OUTDIR/test.02 -0.025 2010/01/01 02:00:00  $OUTDIR/warp.02  g       $OUTDIR/diff.02
    28    3     1      $OUTDIR/test.03  0.025 2010/01/01 03:00:00  $OUTDIR/warp.03  g       $OUTDIR/diff.03
    29    4     1      $OUTDIR/test.04  0.010 2010/01/01 04:00:00  $OUTDIR/warp.04  g       $OUTDIR/diff.04
    30    5     2      $OUTDIR/test.05  0.000 2010/01/01 05:00:00  $OUTDIR/warp.05  g       $OUTDIR/diff.05
    31    6     2      $OUTDIR/test.06 -0.025 2010/01/01 06:00:00  $OUTDIR/warp.06  g       $OUTDIR/diff.06
    32    7     2      $OUTDIR/test.07  0.025 2010/01/01 07:00:00  $OUTDIR/warp.07  g       $OUTDIR/diff.07
    33    8     2      $OUTDIR/test.08  0.010 2010/01/01 08:00:00  $OUTDIR/warp.08  g       $OUTDIR/diff.08
    34    9     3      $OUTDIR/test.09  0.000 2010/01/01 09:00:00  $OUTDIR/warp.09  g       $OUTDIR/diff.09
    35   10     3      $OUTDIR/test.10 -0.025 2010/01/01 10:00:00  $OUTDIR/warp.10  g       $OUTDIR/diff.10
    36   11     3      $OUTDIR/test.11  0.025 2010/01/01 11:00:00  $OUTDIR/warp.11  g       $OUTDIR/diff.11
    37   12     3      $OUTDIR/test.12  0.010 2010/01/01 12:00:00  $OUTDIR/warp.12  g       $OUTDIR/diff.12
    38   13     4      $OUTDIR/test.13 -0.025 2010/01/02 01:00:00  $OUTDIR/warp.13  r       $OUTDIR/diff.13
    39   14     4      $OUTDIR/test.14  0.025 2010/01/02 02:00:00  $OUTDIR/warp.14  r       $OUTDIR/diff.14
    40   15     4      $OUTDIR/test.15  0.010 2010/01/02 03:00:00  $OUTDIR/warp.15  r       $OUTDIR/diff.15
    41   16     4      $OUTDIR/test.16  0.000 2010/01/02 04:00:00  $OUTDIR/warp.16  r       $OUTDIR/diff.16
    42   17     5      $OUTDIR/test.17 -0.025 2010/01/02 05:00:00  $OUTDIR/warp.17  r       $OUTDIR/diff.17
    43   18     5      $OUTDIR/test.18  0.025 2010/01/02 06:00:00  $OUTDIR/warp.18  r       $OUTDIR/diff.18
    44   19     5      $OUTDIR/test.19  0.010 2010/01/02 07:00:00  $OUTDIR/warp.19  r       $OUTDIR/diff.19
    45   20     5      $OUTDIR/test.20  0.000 2010/01/02 08:00:00  $OUTDIR/warp.20  r       $OUTDIR/diff.20
    46   21     6      $OUTDIR/test.21 -0.025 2010/01/02 09:00:00  $OUTDIR/warp.21  r       $OUTDIR/diff.21
    47   22     6      $OUTDIR/test.22  0.025 2010/01/02 10:00:00  $OUTDIR/warp.22  r       $OUTDIR/diff.22
    48   23     6      $OUTDIR/test.23  0.010 2010/01/02 11:00:00  $OUTDIR/warp.23  r       $OUTDIR/diff.23
    49   24     6      $OUTDIR/test.24 -0.020 2010/01/02 12:00:00  $OUTDIR/warp.24  r       $OUTDIR/diff.24
     32# exp_id stk_id filebase          M_off date       time      warpfile                       filter  difffile
     33   1     1      $OUTDIR/test.cam  0.000 2010/01/01 01:00:00  $OUTDIR/$TESS_ID.$SKYCELL.wrp  g       $OUTDIR/$TESS_ID.$SKYCELL.diff
     34   2     1      $OUTDIR/test.cam -0.025 2010/01/01 02:00:00  $OUTDIR/$TESS_ID.$SKYCELL.wrp  g       $OUTDIR/$TESS_ID.$SKYCELL.diff
     35   3     1      $OUTDIR/test.cam  0.025 2010/01/01 03:00:00  $OUTDIR/$TESS_ID.$SKYCELL.wrp  g       $OUTDIR/$TESS_ID.$SKYCELL.diff
     36   4     1      $OUTDIR/test.cam  0.010 2010/01/01 04:00:00  $OUTDIR/$TESS_ID.$SKYCELL.wrp  g       $OUTDIR/$TESS_ID.$SKYCELL.diff
     37   5     2      $OUTDIR/test.cam  0.000 2010/01/01 05:00:00  $OUTDIR/$TESS_ID.$SKYCELL.wrp  g       $OUTDIR/$TESS_ID.$SKYCELL.diff
     38   6     2      $OUTDIR/test.cam -0.025 2010/01/01 06:00:00  $OUTDIR/$TESS_ID.$SKYCELL.wrp  g       $OUTDIR/$TESS_ID.$SKYCELL.diff
     39   7     2      $OUTDIR/test.cam  0.025 2010/01/01 07:00:00  $OUTDIR/$TESS_ID.$SKYCELL.wrp  g       $OUTDIR/$TESS_ID.$SKYCELL.diff
     40   8     2      $OUTDIR/test.cam  0.010 2010/01/01 08:00:00  $OUTDIR/$TESS_ID.$SKYCELL.wrp  g       $OUTDIR/$TESS_ID.$SKYCELL.diff
     41   9     3      $OUTDIR/test.cam  0.000 2010/01/01 09:00:00  $OUTDIR/$TESS_ID.$SKYCELL.wrp  g       $OUTDIR/$TESS_ID.$SKYCELL.diff
     42  10     3      $OUTDIR/test.cam -0.025 2010/01/01 10:00:00  $OUTDIR/$TESS_ID.$SKYCELL.wrp  g       $OUTDIR/$TESS_ID.$SKYCELL.diff
     43  11     3      $OUTDIR/test.cam  0.025 2010/01/01 11:00:00  $OUTDIR/$TESS_ID.$SKYCELL.wrp  g       $OUTDIR/$TESS_ID.$SKYCELL.diff
     44  12     3      $OUTDIR/test.cam  0.010 2010/01/01 12:00:00  $OUTDIR/$TESS_ID.$SKYCELL.wrp  g       $OUTDIR/$TESS_ID.$SKYCELL.diff
     45  13     4      $OUTDIR/test.cam -0.025 2010/01/02 01:00:00  $OUTDIR/$TESS_ID.$SKYCELL.wrp  r       $OUTDIR/$TESS_ID.$SKYCELL.diff
     46  14     4      $OUTDIR/test.cam  0.025 2010/01/02 02:00:00  $OUTDIR/$TESS_ID.$SKYCELL.wrp  r       $OUTDIR/$TESS_ID.$SKYCELL.diff
     47  15     4      $OUTDIR/test.cam  0.010 2010/01/02 03:00:00  $OUTDIR/$TESS_ID.$SKYCELL.wrp  r       $OUTDIR/$TESS_ID.$SKYCELL.diff
     48  16     4      $OUTDIR/test.cam  0.000 2010/01/02 04:00:00  $OUTDIR/$TESS_ID.$SKYCELL.wrp  r       $OUTDIR/$TESS_ID.$SKYCELL.diff
     49  17     5      $OUTDIR/test.cam -0.025 2010/01/02 05:00:00  $OUTDIR/$TESS_ID.$SKYCELL.wrp  r       $OUTDIR/$TESS_ID.$SKYCELL.diff
     50  18     5      $OUTDIR/test.cam  0.025 2010/01/02 06:00:00  $OUTDIR/$TESS_ID.$SKYCELL.wrp  r       $OUTDIR/$TESS_ID.$SKYCELL.diff
     51  19     5      $OUTDIR/test.cam  0.010 2010/01/02 07:00:00  $OUTDIR/$TESS_ID.$SKYCELL.wrp  r       $OUTDIR/$TESS_ID.$SKYCELL.diff
     52  20     5      $OUTDIR/test.cam  0.000 2010/01/02 08:00:00  $OUTDIR/$TESS_ID.$SKYCELL.wrp  r       $OUTDIR/$TESS_ID.$SKYCELL.diff
     53  21     6      $OUTDIR/test.cam -0.025 2010/01/02 09:00:00  $OUTDIR/$TESS_ID.$SKYCELL.wrp  r       $OUTDIR/$TESS_ID.$SKYCELL.diff
     54  22     6      $OUTDIR/test.cam  0.025 2010/01/02 10:00:00  $OUTDIR/$TESS_ID.$SKYCELL.wrp  r       $OUTDIR/$TESS_ID.$SKYCELL.diff
     55  23     6      $OUTDIR/test.cam  0.010 2010/01/02 11:00:00  $OUTDIR/$TESS_ID.$SKYCELL.wrp  r       $OUTDIR/$TESS_ID.$SKYCELL.diff
     56  24     6      $OUTDIR/test.cam -0.020 2010/01/02 12:00:00  $OUTDIR/$TESS_ID.$SKYCELL.wrp  r       $OUTDIR/$TESS_ID.$SKYCELL.diff
    5057end
    5158
    5259list stackdata
    53 # stk_id sky_id filename         M_off filter  forcedgalaxy         
    54   1      1      $OUTDIR/stack.01 0.010 g       $OUTDIR/fgal.01
    55   2      2      $OUTDIR/stack.02 0.020 g       $OUTDIR/fgal.02
    56   3      3      $OUTDIR/stack.03 0.030 g       $OUTDIR/fgal.03
    57   4      1      $OUTDIR/stack.04 0.025 r       $OUTDIR/fgal.04
    58   5      2      $OUTDIR/stack.05 0.035 r       $OUTDIR/fgal.05
    59   6      3      $OUTDIR/stack.06 0.045 r       $OUTDIR/fgal.06
     60# stk_id sky_id filename                      M_off filter  forcedgalaxy         
     61  1      1      $OUTDIR/$TESS_ID.$SKYCELL.stk 0.010 g       $OUTDIR/$TESS_ID.$SKYCELL.fgal
     62  2      2      $OUTDIR/$TESS_ID.$SKYCELL.stk 0.020 g       $OUTDIR/$TESS_ID.$SKYCELL.fgal
     63  3      3      $OUTDIR/$TESS_ID.$SKYCELL.stk 0.030 g       $OUTDIR/$TESS_ID.$SKYCELL.fgal
     64  4      1      $OUTDIR/$TESS_ID.$SKYCELL.stk 0.025 r       $OUTDIR/$TESS_ID.$SKYCELL.fgal
     65  5      2      $OUTDIR/$TESS_ID.$SKYCELL.stk 0.035 r       $OUTDIR/$TESS_ID.$SKYCELL.fgal
     66  6      3      $OUTDIR/$TESS_ID.$SKYCELL.stk 0.045 r       $OUTDIR/$TESS_ID.$SKYCELL.fgal
    6067end
    6168 
     
    6774  mkcatdir.dif PS1_DV5 PS1_V5
    6875  insert.stack.set
     76
     77  exec rm -rf testdata/catdir.mrg
     78  exec dvomerge -matched-tables testdata/catdir.cam into testdata/catdir.mrg
     79  exec dvomerge -matched-tables testdata/catdir.stk into testdata/catdir.mrg
     80  exec dvomerge -matched-tables testdata/catdir.wrp into testdata/catdir.mrg
     81
     82  # relphot -D CATDIR testdata/catdir.mrg -D CAMERA simtest -region 8 12 18 22 -update -vv -averages -boundary-tree tess.3pi.fits
     83  exec relphot -D CATDIR testdata/catdir.mrg -D CAMERA simtest -region 8 12 18 22 -update -vv -images g,r -reset -reset-zpts -D STAR_TOOFEW 0 -boundary-tree tess.3pi.fits -cloud-limit 0.1
    6984end
    7085
     
    7590  $dbuser = dvo
    7691  $dbpass = dvo
    77 #  $dbuser = czw
    78 #  $dbpass = czw
    79 
     92
     93  $gscfile = `gconfig GSCFILE`
     94  if ("$gscfile" == "not found")
     95    echo "problem with dvo / ptolemy configuration.  check ~/.ptolemyrc"
     96    break
     97  end
     98   
    8099  exec mkgpc1.sh delete $dbhost $dbname $dbuser $dbpass
    81100  exec mkgpc1.sh create $dbhost $dbname $dbuser $dbpass
     
    85104  # system-wide info
    86105  dbinsert ippToPspsFake (my_id) values (2)
    87   dbinsert skycell (radeg, decdeg, tess_id, skycell_id) values ($RA, $DEC, $TESS_ID, $SKYCELL)
     106  dbinsert skycell (radeg, decdeg, tess_id, skycell_id) values ($RA, $DEC, "$TESS_ID", "$SKYCELL")
    88107end
    89108
     
    110129    $ID = $word:0
    111130    $stkID = $word:1
    112     $rawfile = $word:2\.txt
    113     $cmffile = $word:2\.smf
     131    sprintf rawfile "%s.%02d.txt" $word:2 $ID
     132    sprintf cmffile "%s.%02d.smf" $word:2 $ID
    114133    $offset = $word:3
    115134    sprintf myDATE "%s" $word:4
     
    172191
    173192    mkinput $offset $rawfile
    174     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
    175     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
     193    echo mkcmf -photcode SIMTEST.$filter.Chip $ADDNOISE -append $rawfile $cmffile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $ID -sourceID 0 -coords
     194    exec mkcmf -photcode SIMTEST.$filter.Chip $ADDNOISE -append $rawfile $cmffile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $ID -sourceID 0 -coords
    176195
    177196    if ($i == 3)
     
    198217
    199218  if ($SMALLTEST)
    200     echo relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -nloop 0 -D STAR_TOOFEW 0 -update
    201     exec relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -nloop 0 -D STAR_TOOFEW 0 -update
    202 
    203     echo relastro -v -D CATDIR $catdir -images -update-chips -region 8 12 18 22 -update -apply-offsets
    204     exec relastro -v -D CATDIR $catdir -images -update-chips -region 8 12 18 22 -update -apply-offsets
     219    echo relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -images g,r,i,z,y -nloop 0 -D STAR_TOOFEW 0 -update
     220    exec relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -images g,r,i,z,y -nloop 0 -D STAR_TOOFEW 0 -update
     221
     222    echo relastro -v -D CATDIR $catdir -D CAMERA simtest -images -update-chips -update-all-cameras -region 8 12 18 22 -update -apply-offsets
     223    exec relastro -v -D CATDIR $catdir -D CAMERA simtest -images -update-chips -update-all-cameras -region 8 12 18 22 -update -apply-offsets
    205224  else
    206     echo relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update
    207     exec relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update
     225    echo relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -images g,r,i,z,y -update
     226    exec relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -images g,r,i,z,y -update
    208227  end
    209228
     
    246265    $stkID = $word:0
    247266    $skyID = $word:1
    248     $rawfile = $word:2\.txt
    249     $cmffile = $word:2\.cmf
     267    sprintf rawfile "%s.%02d.txt" $word:2 $stkID
     268    sprintf cmffile "%s.%02d.cmf" $word:2 $stkID
    250269    $offset = $word:3
    251270    $filter = $word:4
     
    255274
    256275    mkinput $offset $rawfile
    257     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
    258     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
     276    echo mkcmf -stack -photcode SIMTEST.$filter.SkyChip $ADDNOISE $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 -coords
     277    exec mkcmf -stack -photcode SIMTEST.$filter.SkyChip $ADDNOISE $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 -coords
    259278
    260279    # add some required header keywords:
     
    267286
    268287  if ($SMALLTEST)
    269     echo relphot -D CATDIR $catdir -region 8 12 18 22 -averages -update
    270     exec relphot -D CATDIR $catdir -region 8 12 18 22 -averages -update
     288    echo relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -averages -update
     289    exec relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -averages -update
    271290  else
    272     echo relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update
    273     exec relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update
     291    echo relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -images g,r,i,z,y -update
     292    exec relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -images g,r,i,z,y -update
    274293  end
    275294
     
    315334    $ID = $word:0
    316335    $stkID = $word:1
    317     $rawfile = $word:2\.txt; # use the cam-stage rawfile
    318     $cmffile = $word:6\.cmf
     336    sprintf rawfile "%s.%02d.txt" $word:2 $ID; # use the cam-stage rawfile
     337    sprintf cmffile "%s.%02d.smf" $word:6 $ID
    319338    $offset = $word:3
    320339    sprintf myDATE "%s" $word:4
     
    330349
    331350    mkinput $offset $rawfile
    332     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
    333     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
     351    echo mkcmf -forcedwarp -photcode SIMTEST.$filter.ForcedWarp $ADDNOISE $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 -coords
     352    exec mkcmf -forcedwarp -photcode SIMTEST.$filter.ForcedWarp $ADDNOISE $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 -coords
    334353
    335354    echo addstar -D SKY_DEPTH 4 -D CATDIR $catdir -D CAMERA simtest $cmffile -D CATFORMAT $2 -quick-airmass -xrad
     
    341360    list word -split $stackdata:$i
    342361    $stkID = $word:0
    343     $rawfile = $word:2\.txt
    344     $cmffile = $word:5\.cmf
     362    sprintf rawfile "%s.%02d.txt" $word:2 $stkID
     363    sprintf cmffile "%s.%02d.smf" $word:5 $stkID
    345364    $offset = $word:3
    346365    $filter = $word:4
     
    349368    if ($SMALLTEST && ($stkID != 1) && ($stkID != 4)) continue
    350369
    351     echo mkcmf -forcedgalaxy -photcode SIMTEST.$filter.ForcedWarp $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
    352     exec mkcmf -forcedgalaxy -photcode SIMTEST.$filter.ForcedWarp $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
    353 
    354     echo loadgalphot -D CATDIR $catdir -photcode SIMTEST.$filter.ForcedWarp -image-id $stkID $cmffile
    355     exec loadgalphot -D CATDIR $catdir -photcode SIMTEST.$filter.ForcedWarp -image-id $stkID $cmffile
     370    echo mkcmf -forcedgalaxy -photcode SIMTEST.$filter.ForcedWarp $ADDNOISE $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 -coords
     371    exec mkcmf -forcedgalaxy -photcode SIMTEST.$filter.ForcedWarp $ADDNOISE $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 -coords
     372
     373    echo loadgalphot -D CATDIR $catdir -D CAMERA simtest -photcode SIMTEST.$filter.ForcedWarp -image-id $stkID $cmffile
     374    exec loadgalphot -D CATDIR $catdir -D CAMERA simtest -photcode SIMTEST.$filter.ForcedWarp -image-id $stkID $cmffile
    356375  end
    357376
    358377  if ($SMALLTEST)
    359     echo relphot -D CATDIR $catdir -region 8 12 18 22 -averages -update
    360     exec relphot -D CATDIR $catdir -region 8 12 18 22 -averages -update
     378    echo relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -averages -update
     379    exec relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -averages -update
    361380  else
    362     echo relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update
    363     exec relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update
    364   end
    365 
    366   echo dvolens -D CATDIR $catdir -region 8 12 18 22 -update-objects -update
    367   exec dvolens -D CATDIR $catdir -region 8 12 18 22 -update-objects -update
     381    echo relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -images g,r,i,z,y -update
     382    exec relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -images g,r,i,z,y -update
     383  end
     384
     385  echo dvolens -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -update-objects -update
     386  exec dvolens -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -update-objects -update
    368387
    369388  if ($PARALLEL)
     
    406425  dbinsert camProcessedExp (cam_id, path_base, fault) values ($myID, "$filename", 0)
    407426  dbinsert fakeRun (fake_id, cam_id) values ($myID, $myID)
    408   dbinsert warpRun (warp_id, fake_id, tess_id, state) values ($myID, $myID, $TESS_ID, "full")
    409   dbinsert warpSkyCellMap (warp_id, skycell_id, class_id) values ($myID, $SKYCELL, "XY00")
    410   dbinsert warpImfile (warp_id, skycell_id, warp_skyfile_id) values ($myID, $SKYCELL, $myID)
     427  dbinsert warpRun (warp_id, fake_id, tess_id, state) values ($myID, $myID, "$TESS_ID", "full")
     428  dbinsert warpSkyCellMap (warp_id, skycell_id, class_id) values ($myID, "$SKYCELL", "XY00")
     429  dbinsert warpImfile (warp_id, skycell_id, warp_skyfile_id) values ($myID, "$SKYCELL", $myID)
    411430
    412431  dbinsert addRun (add_id, stage, state, stage_id, minidvodb_name) values ($myID, "cam", "full", $myID, "catdir.cam")
     
    452471  $skycalID = $stkID + 20
    453472
    454   dbinsert stackRun (stack_id, skycell_id, filter, software_ver) values ($stkID, $SKYCELL, "$filter.00000", "37500")
     473  dbinsert stackRun (stack_id, skycell_id, filter, software_ver) values ($stkID, "$SKYCELL", "$filter.00000", "37500")
    455474
    456475  # we have a single fullForceRun for each stack, so we can match fullForceRun ids to stackRun ids
     
    520539    $ID = $word:0
    521540    $stkID = $word:1
    522     $rawfile = $word:2\.txt
    523     $cmffile = $word:8\.cmf
    524     $invfile = $word:8\.inv.cmf
     541    sprintf rawfile "%s.%02d.txt" $word:2 $stkID
     542    sprintf cmffile "%s.%02d.smf" $word:8 $stkID
     543    sprintf invfile "%s.%02d.inv.smf" $word:8 $stkID
    525544    $offset = $word:3
    526545    sprintf myDATE "%s" $word:4
     
    535554    mkinput $offset $rawfile
    536555    $diff_skyfile_id = $ID + 25
    537     echo mkcmf -diff -photcode SIMTEST.$filter.SkyChip -no-noise -extroot SkyChip $rawfile $cmffile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $diff_skyfile_id -sourceID 36 -bad-psfqf-frac $BAD_PSFQF_FRAC
    538     exec mkcmf -diff -photcode SIMTEST.$filter.SkyChip -no-noise -extroot SkyChip $rawfile $cmffile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $diff_skyfile_id -sourceID 36 -bad-psfqf-frac $BAD_PSFQF_FRAC
    539 
    540     echo mkcmf -diff -photcode SIMTEST.$filter.SkyChip -no-noise -extroot SkyChip $rawfile $invfile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $diff_skyfile_id -sourceID 36 -bad-psfqf-frac $BAD_PSFQF_FRAC
    541     exec mkcmf -diff -photcode SIMTEST.$filter.SkyChip -no-noise -extroot SkyChip $rawfile $invfile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $diff_skyfile_id -sourceID 36 -bad-psfqf-frac $BAD_PSFQF_FRAC
     556    echo mkcmf -diff -photcode SIMTEST.$filter.SkyChip $ADDNOISE -extroot SkyChip $rawfile $cmffile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $diff_skyfile_id -sourceID 36 -bad-psfqf-frac $BAD_PSFQF_FRAC -coords
     557    exec mkcmf -diff -photcode SIMTEST.$filter.SkyChip $ADDNOISE -extroot SkyChip $rawfile $cmffile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $diff_skyfile_id -sourceID 36 -bad-psfqf-frac $BAD_PSFQF_FRAC -coords
     558
     559    echo mkcmf -diff -photcode SIMTEST.$filter.SkyChip $ADDNOISE -extroot SkyChip $rawfile $invfile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $diff_skyfile_id -sourceID 36 -bad-psfqf-frac $BAD_PSFQF_FRAC -coords
     560    exec mkcmf -diff -photcode SIMTEST.$filter.SkyChip $ADDNOISE -extroot SkyChip $rawfile $invfile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $diff_skyfile_id -sourceID 36 -bad-psfqf-frac $BAD_PSFQF_FRAC -coords
    542561
    543562    insert.dif $ID $ID $stkID $word:8
     
    557576  end
    558577  if ($SMALLTEST)
    559     echo relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -nloop 0 -D STAR_TOOFEW 0 -update -boundary-tree tess.3pi.fits -is-diff-db -statmode WT_MEAN
    560     exec relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -nloop 0 -D STAR_TOOFEW 0 -update -boundary-tree tess.3pi.fits -is-diff-db -statmode WT_MEAN
     578    echo relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -images g,r,i,z,y -nloop 0 -D STAR_TOOFEW 0 -update -boundary-tree tess.3pi.fits -is-diff-db -statmode WT_MEAN
     579    exec relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -images g,r,i,z,y -nloop 0 -D STAR_TOOFEW 0 -update -boundary-tree tess.3pi.fits -is-diff-db -statmode WT_MEAN
    561580  else
    562     echo relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update
    563     exec relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update
     581    echo relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -images g,r,i,z,y -update
     582    exec relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -images g,r,i,z,y -update
    564583  end
    565584
     
    592611    $stkID = $word:0
    593612    $skyID = $word:1
    594     $cmffile = $word:2
     613    sprintf cmffile "%s.%02d.cmf" $word:2 $stkID
    595614    $filter = $word:4
    596615
     
    652671  dbinsert addProcessedExp (add_id, fault) values ($addID, 0)
    653672
    654   dbinsert diffRun (diff_id, tess_id, state, diff_mode, software_ver) values ($difID, $TESS_ID, "full", 2, "38000M")
    655   dbinsert diffInputSkyfile (diff_id, warp1, stack2, diff_skyfile_id, tess_id, skycell_id) values ($difID, $wrpID, $stkID, $diffSkyfileID, $TESS_ID,  $SKYCELL )
    656   dbinsert diffSkyfile (diff_id, skycell_id, path_base) values ($difID, $SKYCELL, "$filename")
     673  dbinsert diffRun (diff_id, tess_id, state, diff_mode, software_ver) values ($difID, "$TESS_ID", "full", 2, "38000M")
     674  dbinsert diffInputSkyfile (diff_id, warp1, stack2, diff_skyfile_id, tess_id, skycell_id) values ($difID, $wrpID, $stkID, $diffSkyfileID, "$TESS_ID", "$SKYCELL" )
     675  dbinsert diffSkyfile (diff_id, skycell_id, path_base) values ($difID, "$SKYCELL", "$filename")
    657676end
    658677
     
    669688  exec rm -f $output
    670689
    671   local i j
     690  local i j ra dec
    672691  output $output
    673692  for i 10 1024 100
    674693    for j 10 1024 100
    675       fprintf " %6.1f %6.1f  %7.3f" $i $j {-15.0 + $1 + 2.5*($i + $j)/1000.0}
     694      $ra  = 10.0 + $i*0.25/3600
     695      $dec = 20.0 + $j*0.25/3600
     696      fprintf " %10.6f %10.6f %7.3f %6.1f %6.1f  %7.3f" $ra $dec {10.0 + $1 + 2.5*($i + $j)/1000.0} $i $j {-15.0 + $1 + 2.5*($i + $j)/1000.0}
    676697    end
    677698  end
    678699  # XXX add 2 duplicate detections
    679700  $i = 110; $j = 210
    680   fprintf " %6.1f %6.1f  %7.3f" $i $j {-15.0 + $1 + 2.5*($i + $j)/1000.0}
     701  # fprintf " %10.6f %10.6f %7.3f %6.1f %6.1f  %7.3f" $ra $dec {10.0 + $1 + 2.5*($i + $j)/1000.0} $i $j {-15.0 + $1 + 2.5*($i + $j)/1000.0}
     702  # fprintf " %6.1f %6.1f  %7.3f" $i $j {-15.0 + $1 + 2.5*($i + $j)/1000.0}
    681703  $i = 210; $j = 110
    682   fprintf " %6.1f %6.1f  %7.3f" $i $j {-15.0 + $1 + 2.5*($i + $j)/1000.0}
     704  # fprintf " %10.6f %10.6f %7.3f %6.1f %6.1f  %7.3f" $ra $dec {10.0 + $1 + 2.5*($i + $j)/1000.0} $i $j {-15.0 + $1 + 2.5*($i + $j)/1000.0}
     705  # fprintf " %6.1f %6.1f  %7.3f" $i $j {-15.0 + $1 + 2.5*($i + $j)/1000.0}
    683706  output stdout
     707end
     708
     709macro check.mags
     710
     711  # NOTE: relphot refuses to set the warp averages if there is no boundary tree: otherwise it cannot choose the correct subset of measurements
     712  # relphot -D CATDIR testdata/catdir.mrg -D CAMERA simtest -region 8 12 18 22 -update -vv -averages -boundary-tree tess.3pi.fits
     713  # relphot -D CATDIR testdata/catdir.mrg -D CAMERA simtest -region 8 12 18 22 -update -vv -images g,r -reset -reset-zpts -D STAR_TOOFEW 0 -boundary-tree tess.3pi.fits
     714
     715  catdir testdata/catdir.mrg
     716  skyregion 8 12 18 22
     717  avextract ra dec g:psf:chp g:kron:chp g:psf:stk g:psf:wrp
     718
     719  set dg:psf:chp:stk = g:psf:chp - g:psf:stk
     720  set dg:psf:chp:wrp = g:psf:chp - g:psf:wrp
     721  lim g:psf:chp dg:psf:chp:stk; clear; box; plot g:psf:chp dg:psf:chp:stk -c blue -pt 7; plot g:psf:chp dg:psf:chp:wrp -c red -pt 2
     722
     723# for i 0 10
     724#   echo ra[$i] dec[$i] g:psf:chp[$i] g:kron:chp[$i] g:psf:stk[$i] g:psf:wrp[$i]
     725# end
     726end
     727
     728macro check.mags.meas
     729
     730  # NOTE: relphot refuses to set the warp averages if there is no boundary tree: otherwise it cannot choose the correct subset of measurements
     731  # relphot -D CATDIR testdata/catdir.mrg -D CAMERA simtest -region 8 12 18 22 -update -vv -averages -boundary-tree tess.3pi.fits
     732  # relphot -D CATDIR testdata/catdir.mrg -D CAMERA simtest -region 8 12 18 22 -update -vv -images g,r -reset -reset-zpts -D STAR_TOOFEW 0 -boundary-tree tess.3pi.fits
     733
     734  catdir testdata/catdir.mrg
     735  skyregion 8 12 18 22
     736
     737  mextract ra dec mag:rel:psf mag:rel:kron mag:ave:psf mag:ave:kron photcode
     738  set dM:psf = mag:ave:psf - mag:rel:psf
     739  lim -n 0 mag:ave:psf dM:psf; clear; box; plot mag:ave:psf dM:psf
     740
     741  set dM:kron = mag:ave:kron - mag:rel:kron
     742  lim -n 1 mag:ave:kron dM:kron; clear; box; plot mag:ave:kron dM:kron
    684743end
    685744
Note: See TracChangeset for help on using the changeset viewer.