IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39042 for trunk


Ignore:
Timestamp:
Nov 5, 2015, 1:07:37 PM (11 years ago)
Author:
eugene
Message:

make the forcedwarp gpc1 entries consistent with the data

File:
1 edited

Legend:

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

    r39035 r39042  
    2121
    2222list expfiles -glob sasdata.v39/*.smf
    23 list stkfiles -glob sasdata.v39/*skycal*.cmf
    2423list wrpfiles -glob sasdata.v39/*.wrp.*ff*.cmf
    2524list diffiles -glob sasdata.v39/*.WS.dif.*.cmf
     25list stkfiles -glob sasdata.v39/*skycal*.cmf
     26
     27# filter stack camera
     28$stkset:g = g.00000 sasdata.v39/RINGS.V3.skycell.1315.090.stk.3942577.skycal.4113018.cmf sasdata.v39/o5748g0363o.358745.cm.1218981.smf
     29$stkset:r = r.00000 sasdata.v39/RINGS.V3.skycell.1315.090.stk.3942579.skycal.4113020.cmf sasdata.v39/o5748g0394o.358770.cm.1218998.smf
     30$stkset:i = i.00000 sasdata.v39/RINGS.V3.skycell.1315.090.stk.3942578.skycal.4113019.cmf sasdata.v39/o5748g0436o.358811.cm.1219048.smf
     31$stkset:z = z.00000 sasdata.v39/RINGS.V3.skycell.1315.090.stk.3942581.skycal.4113022.cmf sasdata.v39/o5748g0489o.358899.cm.1219134.smf
     32$stkset:y = y.00000 sasdata.v39/RINGS.V3.skycell.1315.090.stk.3942580.skycal.4113021.cmf sasdata.v39/o5748g0520o.358905.cm.1219149.smf
    2633
    2734# fforce summary files are missing metadata from header.  it is supplied
     
    5663
    5764  insert.cam
     65  insert.stk
    5866  insert.wrp
    59   insert.stk
    6067  insert.dif
    6168  insert.minis
     
    6572  init.db
    6673  insert.cam
     74  insert.stk
    6775  insert.wrp
    68   insert.stk
    6976  insert.dif
    7077  insert.minis
     
    259266  end
    260267
    261   local wrpID stkID filename path_base
    262 
    263   $stkID = 1
     268  local wrpID stkID filename path_base wrpFileID skycell filterID mjd addID expID ffID filterChar
     269
     270# $stkID = 500
     271# $skyID = $stkID + 10
     272# $skycalID = $stkID + 20
     273# dbinsert fullForceRun (ff_id, skycal_id) values ($stkID, $skycalID)
     274# dbinsert stackSumSkyfile (stack_id, mjd_obs) values ($stkID, $mjd)
     275# dbinsert skycalRun (sky_id, skycal_id, stack_id) values ($skyID, $skycalID, $stkID)
     276# dbinsert skycalResult (skycal_id, path_base) values ($skycalID, "$path_base")
     277# dbinsert stackRun (stack_id, skycell_id, filter, software_ver) values ($stkID, "$skycell", "$filter", "37500M")
    264278
    265279  for i 0 $wrpfiles:n
     
    268282    substr $filename 0 {$Nchar - 4} path_base; # the database needs the path without the extension (.smf/.cmf)
    269283
    270     # a single exposure
    271     $wrpID = $i + 100
    272 
     284    $wrpFileID = `echo $filename | fields IMAGEID | prcol 2`
     285    $skycell   = `echo $filename | fields SKYCELL | prcol 2`
     286    $filterID  = `echo $filename | fields FPA.FILTERID | prcol 2`
     287    $mjd       = `echo $filename | fields MJD-OBS | prcol 2`
     288
     289    ctimes -ref $mjd -var dateobs
     290    strsub $dateobs , " " -var myDateObs
     291
     292    # IDs for a single exposure
     293    $wrpID = $i + 200
     294    $expID = $i + 300
     295    $addID = $i + 400
     296
     297    # need to process the stacks first, then we can do the warps
     298    substr $filterID 0 1 filterChar
     299    $stkID = $stackID:$filterChar
     300
     301    $ffID     = $stkID + 10
     302#   $skyID    = $stkID + 20
     303#   $skycalID = $stkID + 30
     304
     305    sprintf expname "o0000g%04do" $expID
     306
     307    # many of these values are fakes for query purposes only.
     308
     309    dbinsert rawExp (exp_id, exp_name, exp_time, filter, bg, bg_stdev, ra, decl, dateobs) values ($expID, "$expname", 10.0, "$filterID", 100.0, 2.0, {$RA*3.1415/180.0}, {$DEC*3.1415/180.0}, "$myDateObs")
     310    dbinsert chipRun (exp_id, chip_id) values ($expID, $expID)
     311    dbinsert camRun (chip_id, cam_id, dist_group, software_ver) values ($expID, $expID, "testgroup", "38000M")
     312    dbinsert camProcessedExp (cam_id, path_base, fault) values ($expID, "$path_base", 0)
     313    dbinsert fakeRun (fake_id, cam_id) values ($expID, $expID)
     314    dbinsert warpRun (warp_id, fake_id, tess_id, state) values ($wrpID, $expID, $TESS_ID, "full")
     315    dbinsert warpImfile (warp_id, skycell_id, warp_skyfile_id) values ($wrpID, "$skycell", $wrpFileID)
     316
     317    # do I care if the class ID is invalid?
     318    dbinsert warpSkyCellMap (warp_id, skycell_id, class_id) values ($wrpID, "$skycell", "XY00")
     319
     320    dbinsert addProcessedExp (add_id, fault) values ($expID, 0)
     321
     322    dbinsert stackInputSkyfile (stack_id, warp_id) values ($stkID, $wrpID)
     323   
    273324    # we have a single fullForceRun for each stack, so we can match fullForceRun ids to stackRun ids
    274     dbinsert fullForceInput (ff_id, warp_id) values ($stkID, $wrpID)
    275     dbinsert fullForceResult (ff_id, warp_id, software_ver, path_base) values ($stkID, $wrpID, "38000M", "$path_base")
    276 
    277     dbinsert addRun (add_id, stage, state, stage_id, stage_extra1, minidvodb_name) values ($wrpID, "fullforce", "full", $wrpID, $wrpID, "$catdirbase")
    278 
    279     if ($i > 10) last
     325    dbinsert fullForceInput (ff_id, warp_id) values ($ffID, $wrpID)
     326    dbinsert fullForceResult (ff_id, warp_id, software_ver, path_base) values ($ffID, $wrpID, "38000M", "$path_base")
     327
     328    dbinsert addRun (add_id, stage, state, stage_id, stage_extra1, minidvodb_name) values ($addID, "fullforce", "full", $ffID, $wrpID, "$catdirbase")
    280329  end
    281330end
     
    300349    $mjd     = `echo $filename | fields MJD-OBS | prcol 2`
    301350   
     351    substr $filter 0 1 filterChar
     352    $stackID:$filterChar = $stkID
     353
    302354    # the warp_id is only needed to generate the list of input exposures
    303     $expID = $i + 1
     355    # we have a single fullForceRun for each stack, so we can match fullForceRun ids to stackRun ids
     356   
     357    $ffID     = $stkID + 10
     358    $skyID    = $stkID + 20
     359    $skycalID = $stkID + 30
     360
    304361    dbinsert stackRun (stack_id, skycell_id, filter, software_ver) values ($stkID, "$skycell", "$filter", "37500M")
    305    
    306     # we have a single fullForceRun for each stack, so we can match fullForceRun ids to stackRun ids
    307     $skyID    = $stkID
    308     $skycalID = $stkID + 20
    309     dbinsert fullForceRun (ff_id, skycal_id) values ($stkID, $skycalID)
    310    
    311     dbinsert stackInputSkyfile (stack_id, warp_id) values ($stkID, $expID)
     362    dbinsert fullForceRun (ff_id, skycal_id) values ($ffID, $skycalID)
    312363    dbinsert stackSumSkyfile (stack_id, mjd_obs) values ($stkID, $mjd)
    313364    dbinsert skycalRun (sky_id, skycal_id, stack_id) values ($skyID, $skycalID, $stkID)
    314365    dbinsert skycalResult (skycal_id, path_base) values ($skycalID, "$path_base")
    315366   
     367#   dbinsert stackInputSkyfile (stack_id, warp_id) values ($stkID, $expID)
     368
    316369    dbinsert addRun (add_id, stage, state, stage_id, minidvodb_name) values ($stkID, "skycal", "full", $skycalID, "$catdirbase")
    317370  end
     
    368421
    369422if ($SCRIPT)
    370   mkdb
    371   exit 0
    372 end
     423  if ($argv:n != 1)
     424    echo "mksasdata.dvo (mode)"
     425    exit 2
     426  end
     427
     428  echo $argv:0
     429
     430  if ("$argv:0" == "mkdb")
     431    mkdb
     432    exit 0
     433  end
     434  if ("$argv:0" == "mkfull")
     435    mkfull
     436    exit 0
     437  end
     438  echo "no valid mode"
     439  exit 3
     440end
Note: See TracChangeset for help on using the changeset viewer.