IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 12, 2014, 4:10:18 PM (12 years ago)
Author:
eugene
Message:

merge changes from branches/eam_branches/ipp-20140717

File:
1 edited

Legend:

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

    r35097 r37246  
    44
    55if (not($?VERBOSE)) set VERBOSE = 0
     6if (not($?PARALLEL)) set PARALLEL = 0
    67
    7 $OUTDIR = sas12
     8$OUTDIR = sasdata
     9
     10if (not($?KEEPDVO)) set KEEPDVO = 0
     11
     12list expfiles
     13  sasdata/o5745g0495o.356867.cm.982612
     14  sasdata/o5745g0507o.356882.cm.982626
     15  sasdata/o5745g0517o.356892.cm.982636
     16  sasdata/o5745g0527o.356909.cm.982650
     17end
    818
    919macro mkfull
    1020  init.db
    11   mkcatdir
     21  mkcatdir.cam
     22  mkcatdir.stk
     23  mkcal
     24  mkgpc1.cam
     25  mkgpc1.stk
    1226end
    1327
     
    1832  $dbpass = dvo
    1933
    20   # exposure center
    21   $RA = 333.8
    22   $DEC = 1.6
    23 
    24   # stack center
    25   # XXX the selected stack centers come from the input exposures, so I should use a gpc1 db with stacks associated with real exposures
    26   $RA = 331.6
    27   $DEC = -6.0
     34  # are these used to find the exposures in any way?
     35  # center of the test skycell
     36  $RA = 333.5
     37  $DEC = -5.0
    2838
    2939  break -auto off
     
    3646  # system-wide info
    3747  dbinsert ippToPspsFake (my_id) values (2)
    38   dbinsert skycell (radeg, decdeg, skycell_id) values ($RA, $DEC, "skycell.0000.000")
     48  dbinsert skycell (radeg, decdeg, skycell_id) values ($RA, $DEC, "skycell.1225.070")
    3949end
    4050
    4151# create a populated catdir with a set of cmf files, save the filenames in list for use by insert.exp
    42 macro mkcatdir
     52macro mkcatdir.cam
    4353  if ($0 != 1)
    4454    echo "mkcatdir"
     
    4959
    5060  local catdir
    51   $catdirbase = catdir.sas12
     61  $catdirbase = catdir.sas.cam
     62  $catdir = $OUTDIR/$catdirbase
     63
     64  exec rm -rf $catdir
     65
     66  for i 0 $expfiles:n
     67    $expfile = $expfiles:$i
     68
     69    exec addstar -D CAMERA gpc1 -D CATDIR $catdir -D CATFORMAT PS1_V5 $expfile.smf -update
     70  end
     71  exec addstar -D CATDIR $catdir -region 330 340 -10 0 -resort
     72end
     73
     74# create a populated catdir with a set of cmf files, save the filenames in list for use by insert.exp
     75macro mkcatdir.stk
     76  if ($0 != 1)
     77    echo "mkcatdir"
     78    break
     79  end
     80
     81  mkdir $OUTDIR
     82
     83  local catdir
     84  $catdirbase = catdir.sas.stk
    5285  $catdir = $OUTDIR/$catdirbase
    5386  exec rm -rf $catdir
    5487
    55   $expfile = sas12.test.psps/o5745g0620o.356996.cm.473458
    56   exec addstar -D CAMERA gpc1 -D CATDIR $catdir $expfile.smf
     88  # a single stack
     89  $stkfile = sasdata/RINGS.V3.skycell.1225.070.stk.3366216.skycal.1589960
     90  exec addstar -D CAMERA gpc1 -D CATFORMAT PS1_V5 -D CATDIR $catdir $stkfile.cmf
     91end
    5792
    58   # are these used to find the exposures in any way?
    59   $RA = 333.8
    60   $DEC = 1.6
     93macro mkcal
    6194
    62   # a single exposure
    63   $expID = 1
    64   dbinsert rawExp (exp_id, exp_name, exp_time, bg, bg_stdev, ra, decl) values ($expID, "o5745g0620o", 10.0, 100.0, 2.0, {$RA*3.1415/180.0}, {$DEC*3.1415/180.0})
    65   dbinsert chipRun (exp_id, chip_id) values ($expID, $expID)
    66   dbinsert camRun (chip_id, cam_id, dist_group, software_ver) values ($expID, $expID, "testgroup", "testsoft")
    67   dbinsert camProcessedExp (cam_id, path_base) values ($expID, "$expfile")
    68   dbinsert fakeRun (fake_id, cam_id) values ($expID, $expID)
    69   dbinsert warpRun (warp_id, fake_id) values ($expID, $expID)
    70   dbinsert warpSkyCellMap (warp_id, skycell_id, class_id) values ($expID, "skycell.0000.000", "XY00")
    71   dbinsert addRun (stage, state, stage_id, minidvodb_name) values ("cam", "full", $expID, "$catdirbase")
     95  local catdir
     96  $catdir = $OUTDIR/catdir.sas.cam
     97
     98  # merge the cam and stk databases together:
     99  exec dvomerge $OUTDIR/catdir.sas.stk into $catdir
     100
     101  # run relphot
     102  echo relphot -D CATDIR $catdir -region 330 340 -10 0 -images g,r,i,z,y -update -boundary-tree tess.3pi.fits
     103  exec relphot -D CATDIR $catdir -region 330 340 -10 0 -images g,r,i,z,y -update -boundary-tree tess.3pi.fits
     104
     105  echo relastro -v -D CATDIR $catdir -images -update-chips -region 330 340 -10 0 -update
     106  exec relastro -v -D CATDIR $catdir -images -update-chips -region 330 340 -10 0 -update
     107end
     108
     109# create a populated catdir with a set of cmf files, save the filenames in list for use by insert.exp
     110macro mkgpc1.cam
     111  if ($0 != 1)
     112    echo "mkgpc1.cam"
     113    break
     114  end
     115
     116  local catdirbase
     117  $catdirbase = catdir.sas.cam
     118
     119  for i 0 $expfiles:n
     120    $expfile = $expfiles:$i
     121
     122    # are these used to find the exposures in any way?
     123    $RA = 333.9
     124    $DEC = -3.8
     125
     126    # a single exposure
     127    $expID = $i + 1
     128    substr $expfile 8 11 expname
     129
     130    dbinsert rawExp (exp_id, exp_name, exp_time, bg, bg_stdev, ra, decl, dateobs) values ($expID, "$expname", 10.0, 100.0, 2.0, {$RA*3.1415/180.0}, {$DEC*3.1415/180.0}, "2010/01/01 00:00:00")
     131    dbinsert chipRun (exp_id, chip_id) values ($expID, $expID)
     132    dbinsert camRun (chip_id, cam_id, dist_group, software_ver) values ($expID, $expID, "testgroup", "38000M")
     133    dbinsert camProcessedExp (cam_id, path_base, fault) values ($expID, "$expfile", 0)
     134    dbinsert fakeRun (fake_id, cam_id) values ($expID, $expID)
     135    dbinsert warpRun (warp_id, fake_id) values ($expID, $expID)
     136    dbinsert warpSkyCellMap (warp_id, skycell_id, class_id) values ($expID, "skycell.1225.070", "XY00")
     137    dbinsert addRun (add_id, stage, state, stage_id, minidvodb_name) values ($expID, "cam", "full", $expID, "$catdirbase")
     138    dbinsert addProcessedExp (add_id, fault) values ($expID, 0)
     139   
     140    # catdirs for the exposures
     141    dbinsert minidvodbRun (minidvodb_name, minidvodb_id, state) values ("$catdirbase", 1, "merged")
     142    dbinsert minidvodbProcessed (minidvodb_id, fault) values (1, 0)
     143   
     144    dbinsert mergedvodbRun (minidvodb_id, merge_id, state, mergedvodb) values (1, 1, "full", "$catdirbase")
     145    dbinsert mergedvodbProcessed (merge_id, fault) values (1, 0)
     146  end
     147end
     148
     149# create a populated catdir with a set of cmf files, save the filenames in list for use by insert.exp
     150macro mkgpc1.stk
     151  if ($0 != 1)
     152    echo "mkgpc1.stk"
     153    break
     154  end
     155
     156  local catdirbase
     157  $catdirbase = catdir.sas.cam
     158
     159  $TIMEFORMAT = mjd
     160  $TIMEREF = 2001/01/01,00:00:00
     161  ctimes -abs 2010/01/01,00:00:00 -var mjd
    72162
    73163  # a single stack
    74   $stkfile = sas12.test.psps/RINGS.V3.skycell.1225.070.stk.1032983.skycal.40531
    75   exec addstar -D CAMERA gpc1 -D CATDIR $catdir $stkfile.cmf
     164  $stkfile = sasdata/RINGS.V3.skycell.1225.070.stk.3366216.skycal.1589960
    76165
    77   $stkID = 1
    78   dbinsert stackRun (stack_id, skycell_id, filter, software_ver) values ($stkID, "skycell.0000.000", "g.00000", "testsoft")
     166  break -auto off
     167  $tmpline = `echo $stkfile.cmf | fields IMAGEID`
     168  list words -split $tmpline
     169  $stkID = $words:1
     170  break -auto on
     171
     172  $expID = 1
     173  dbinsert stackRun (stack_id, skycell_id, filter, software_ver) values ($stkID, "skycell.1225.070", "i.00000", "37500M")
    79174  dbinsert stackInputSkyfile (stack_id, warp_id) values ($stkID, $expID)
    80   dbinsert stackSumSkyfile (stack_id) values ($stkID)
    81   dbinsert skycalRun (skycal_id, stack_id) values ($stkID, $stkID)
     175  dbinsert stackSumSkyfile (stack_id, mjd_obs) values ($stkID, $mjd)
     176  dbinsert skycalRun (sky_id, skycal_id, stack_id) values ($stkID, $stkID, $stkID)
    82177  dbinsert skycalResult (skycal_id, path_base) values ($stkID, "$stkfile")
    83178  dbinsert addRun (stage, state, stage_id, minidvodb_name) values ("skycal", "full", $stkID, "$catdirbase")
    84 
    85   # catdirs for the exposures
    86   dbinsert minidvodbRun (minidvodb_name, minidvodb_id, state) values ("$catdirbase", 1, "merged")
    87   dbinsert minidvodbProcessed (minidvodb_id, fault) values (1, 0)
    88  
    89   dbinsert mergedvodbRun (minidvodb_id, merge_id, state, mergedvodb) values (1, 1, "full", "$catdirbase")
    90   dbinsert mergedvodbProcessed (merge_id, fault) values (1, 0)
    91179
    92180  # catdirs for the stack
Note: See TracChangeset for help on using the changeset viewer.