IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38239 for trunk/ippTasks


Ignore:
Timestamp:
May 7, 2015, 12:36:11 PM (11 years ago)
Author:
watersc1
Message:

Pruned nightly_science with gpc2 support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/nightly_science.pro

    r38229 r38239  
    55macro nightly.science.on
    66    ns.initday.on
    7     ns.detrends.off
     7#    ns.detrends.off
    88    ns.dqstats.on
    99    ns.stacks.on
     
    1313macro nightly.science.off
    1414    ns.initday.off
    15     ns.detrends.off
     15#    ns.detrends.off
    1616    ns.dqstats.off
    1717    ns.stacks.off
     
    3333end
    3434
    35 macro ns.detrends.on
    36   task ns.detrends.load
    37     active true
    38   end
    39 end
    4035
    4136macro ns.dqstats.on
     
    4641
    4742macro ns.stacks.on
    48   task ns.stacks.load
    49     active false
    50   end
    5143  task ns.stacks.run
    5244    active true
    5345  end
    54   task ns.stacks.confirm
    55     active false
    56   end
    5746end
    5847
    5948macro ns.diffs.on
    60   task ns.diffs.load
    61     active false
    62   end
    6349  task ns.diffs.run
    6450    active true
     
    7258end
    7359
    74 macro ns.detrends.off
    75   task ns.detrends.load
    76     active false
    77   end
    78 end
    79 
    8060macro ns.dqstats.off
    8161  task ns.dqstats.load
     
    8565
    8666macro ns.stacks.off
    87   task ns.stacks.load
    88     active false
    89   end
    9067  task ns.stacks.run
    9168    active false
    9269  end
    93   task ns.stacks.confirm
    94     active false
    95   end
    96 
    9770end
    9871
    9972macro ns.diffs.off
    100   task ns.diffs.load
    101     active false
    102   end
    10373  task ns.diffs.run
    104     active false
    105   end
    106 end
    107 
    108 macro ns.stacks.confirm.on
    109   task ns.stacks.confirm
    110     active true
    111   end
    112 end
    113 
    114 macro ns.stacks.confirm.off
    115   task ns.stacks.confirm
    11674    active false
    11775  end
     
    12886book init nsDiffs
    12987book init nsStacks
     88
     89# Hard coded values
     90$camera_map:gpc1 = "GPC1"
     91$camera_map:gpc2 = "GPC2"
     92
     93# Macro to manage the camera maps
     94macro ns.add.camera_map
     95    if ($0 != 3)
     96        echo "USAGE: ns.add.camera_map (dbname) (camera)"
     97        break
     98    end
     99
     100    $camera_map:$1 = $2
     101end
     102
    130103#
    131104# Macros to control the book.
    132105#
    133106macro ns.add.date
    134   if ($0 != 3)
    135     echo "USAGE: ns.add.date (YYYY-MM-DD) (dbname)"
     107  if ($0 != 4)
     108    echo "USAGE: ns.add.date (YYYY-MM-DD) (dbname) (camera)"
    136109    break
    137110  end
     111
     112   if ($?camera_map:$2)
     113      if ($camera_map:$2 != "$3")
     114         echo "camera $3 does not match expected camera $camera_map:$2"
     115         break
     116      end
     117   else
     118      echo "dbname $2 does not have a camera_map entry"
     119      break
     120   end
    138121
    139122   # build key from date and database name
     
    143126   book setword nsData $key date $1
    144127   book setword nsData $key dbname $2
     128   book setword nsData $key camera $3
    145129
    146130   book newpage nsDiffs $key
     
    159143       book getword nsData $key date -var date
    160144       book getword nsData $key dbname -var dbname
     145       book getword nsData $key camera -var camera
    161146       book getword nsData $key nsState -var state
    162147       book getword nsStacks $key nsStackState -var Sstate
    163148       book getword nsDiffs $key nsDiffState -var Dstate
    164149       book getword nsDiffs $key nsObservingState -var Ostate
    165        echo $key $date $dbname $state $Sstate $Dstate $Ostate
     150# I've moved dbname to end as czartool reads information from here, and it may be fixed length
     151       echo $key $date $state $Sstate $Dstate $Ostate $dbname $camera
     152
    166153    end
    167154end
     
    184171  periods         -exec $LOADEXEC
    185172  periods         -timeout 300
    186   trange          0:00:00 1:00:00 -nmax 1
     173  trange          0:00:00 1:00:00 -nmax 2
    187174  npending        1
    188175
     
    199186        book setword nsData $key nsState NEW
    200187        book setword nsData $key dbname $thisDB
     188        book setword nsData $key camera $camera_map:$thisDB
     189
    201190        book newpage nsStacks $key
    202191        book setword nsStacks $key date $today
     
    207196
    208197       #command echo $today
    209        $run = nightly_science.pl --clean_old --date $today --dbname $thisDB
     198       $run = nightly_science.pl --clean_old --date $today --dbname $thisDB --camera $camera_map:$thisDB
    210199       command $run
    211200    end
     
    229218
    230219#
    231 # Queue off any possible detrend verification runs
    232 #
    233 task              ns.detrends.load
    234   host            local
    235   periods         -poll $LOADPOLL
    236   periods         -exec $LOADEXEC
    237   periods         -timeout 30
    238   trange          23:00:00 23:59:59 -nmax 1
    239   npending        1
    240 
    241   task.exec
    242     stdout $LOGDIR/ns.detrends.log
    243     stdout $LOGDIR/ns.detrends.log
    244     $today = `date -u +%Y-%m-%d`
    245 
    246     $run = nightly_science.pl --queue_detrends --date $today --dbname $DB:0
    247 #     add_standard_args $run
    248      command $run
    249   end
    250  
    251   task.exit       0
    252     # nothign to do here
    253   end
    254   # locked list
    255   task.exit       default
    256     showcommand failure
    257   end
    258   task.exit       crash
    259     showcommand crash
    260   end
    261   # operation times out
    262   task.exit       timeout
    263     showcommand timeout
    264   end
    265 end
    266 
    267 #
    268220# Queue dqstats runs
    269221#
     222
     223# CZW: 2015-05-05 One day we will stop making these, but that day is not today. 
     224#      According to Ken, we do not need to implement this for gpc2, as nothing is
     225#      written on the OTIS/scheduler side to accept these products.  We should
     226#      continue to generate these for gpc1, as the machinery does exist to check
     227#      for them, and not generating them may cause that to fail (even if nothing
     228#      is done with the results).
     229
    270230task              ns.dqstats.load
    271231  host            local
     
    305265
    306266#
    307 # Check to see if the warps are finished
    308 #
    309 task              ns.stacks.load
    310   active          false
    311   host            local
    312   periods         -poll $LOADPOLL
    313   periods         -exec $LOADEXEC
    314   periods         -timeout 120
    315   npending        1
    316 
    317   task.exec
    318      stdout NULL
    319      stderr $LOGDIR/ns.stacks.log
    320 
    321      book getpage nsData $ns_stackPAGE -var key
    322      book getword nsStacks $key date -var date
    323      book getword nsStacks $key nsStackState -var ns_STATE
    324      book getword nsDiffs $key nsDiffState -var ns_diff_STATE
    325      book getword nsData $key dbname -var DBNAME
    326      book npages nsData -var Npages
    327 
    328     if ($VERBOSE > 5)
    329        echo "ns.stacks.load: " $ns_stackPAGE $date $DBNAME $ns_STATE $Npages
    330     end
    331 
    332      $ns_stackPAGE ++
    333      if ($ns_stackPAGE >= $Npages) set ns_stackPAGE = 0
    334      option $key
    335 
    336      if ("$ns_STATE" != "TOWARP") break
    337 
    338      $run = nightly_science.pl --check_stacks --date $date --dbname $DBNAME
    339 #     add_standard_args $run
    340      command $run
    341 
    342    end
    343 
    344   # success
    345   task.exit   0
    346 #    convert 'stdout' to book format
    347     book delpage nsStacks $options:0
    348     ipptool2book stdout nsStacks -uniq -key date
    349 
    350     book getword nsStacks $options:0 nsNmacros -var ns_Nmacros
    351     if ("$ns_Nmacros" != "NULL")
    352         for i 0 $ns_Nmacros
    353             sprintf macroName "ns%dMacro" $i
    354             book getword nsStacks $options:0 $macroName -var macroCmd
    355             $macroCmd
    356         end
    357     end
    358 
    359     if ($VERBOSE > 2)
    360         book listbook nsData
    361     end
    362   end
    363 
    364   # locked list
    365   task.exit    default
    366     showcommand failure
    367   end
    368   task.exit    crash
    369     showcommand crash
    370   end
    371   #operation times out?
    372   task.exit    timeout
    373     showcommand timeout
    374   end
    375 end
    376 
    377 #
    378267# Check to see if the warps are finished and so we can make stacks.
    379268#
     
    395284     book getword nsDiffs $key nsDiffState -var ns_diff_STATE
    396285     book getword nsData $key dbname -var DBNAME
     286     book getword nsData $key camera -var CAMERA
    397287     book npages nsData -var Npages
    398288
     
    406296
    407297     if (("$ns_STATE" != "STACKING")&&("$ns_STATE" != "TOWARP")&&("$ns_STATE" != "FORCETOWARP")) break
    408      $run = nightly_science.pl --queue_stacks --date $date --dbname $DBNAME
     298     $run = nightly_science.pl --queue_stacks --date $date --dbname $DBNAME --camera $CAMERA
    409299#     add_standard_args $run
    410300     command $run
     
    444334end
    445335
    446 #
    447 # Confirm that all the stacks that can be built have been built, or at least attempted.
    448 #
    449 task              ns.stacks.confirm
    450   active          false
    451   host            local
    452   periods         -poll $LOADPOLL
    453   periods         -exec $LOADEXEC
    454   periods         -timeout 120
    455   npending        1
    456 
    457   task.exec
    458      stdout NULL
    459      stderr $LOGDIR/ns.stacks.log
    460 
    461      book getpage nsData $ns_CstackPAGE -var key
    462      book getword nsStacks $key date -var date
    463      book getword nsStacks $key nsStackState -var ns_STATE
    464      book getword nsData $key dbname -var DBNAME
    465      book npages nsData -var Npages
    466 
    467      if ($VERBOSE > 5)
    468         echo "ns.stacks.confirm: " $ns_CstackPAGE $key $date $DBNAME $ns_STATE $Npages
    469      end
    470 
    471      $ns_CstackPAGE ++
    472      if ($ns_CstackPAGE >= $Npages) set ns_CstackPAGE = 0
    473      option $key
    474 
    475      if ("$ns_STATE" != "STACKING") break
    476      $run = nightly_science.pl --confirm_stacks --date $date --dbname $DBNAME
    477 #     add_standard_args $run
    478      command $run
    479    end
    480   # success
    481   task.exit   0
    482 #    convert 'stdout' to book format
    483     book delpage nsStacks $options:0
    484     ipptool2book stdout nsStacks -uniq -key date
    485 
    486     book getword nsStacks $options:0 nsNmacros -var ns_Nmacros
    487     if ("$ns_Nmacros" != "NULL")
    488         for i 0 $ns_Nmacros
    489             sprintf macroName "ns%dMacro" $i
    490             book getword nsStacks $options:0 $macroName -var macroCmd
    491             $macroCmd
    492         end
    493     end
    494 
    495     if ($VERBOSE > 2)
    496         book listbook nsData
    497     end
    498   end
    499 
    500   # locked list
    501   task.exit    default
    502     showcommand failure
    503   end
    504   task.exit    crash
    505     showcommand crash
    506   end
    507   #operation times out?
    508   task.exit    timeout
    509     showcommand timeout
    510   end
    511 end
    512 
    513 
    514 #
    515 # Check to see if the warps are finished
    516 #
    517 task              ns.diffs.load
    518   active          false
    519   host            local
    520   periods         -poll $LOADPOLL
    521   periods         -exec $LOADEXEC
    522   periods         -timeout 120
    523   npending        1
    524 
    525   task.exec
    526      stdout NULL
    527      stderr $LOGDIR/ns.diffs.log
    528 
    529      book getpage nsData $ns_diffPAGE -var key
    530      book getword nsDiffs $key date -var date
    531      book getword nsDiffs $key nsDiffState -var ns_STATE
    532      book getword nsStacks $key nsStackState -var ns_stack_STATE
    533      book getword nsData $key dbname -var DBNAME
    534      book npages nsData -var Npages
    535 
    536     if ($VERBOSE > 5)
    537        echo "ns.diffs.load: " $ns_diffPAGE $key $date $DBNAME $ns_STATE $Npages
    538     end
    539 
    540      $ns_diffPAGE ++
    541      if ($ns_diffPAGE >= $Npages) set ns_diffPAGE = 0
    542      option $key
    543 
    544      if ("$ns_STATE" != "TOWARP") break
    545      $run = nightly_science.pl --check_diffs --date $date --dbname $DBNAME
    546 #     add_standard_args $run
    547      command $run
    548    end
    549 
    550   # success
    551   task.exit   0
    552 #    convert 'stdout' to book format
    553     book delpage nsDiffs $options:0
    554     ipptool2book stdout nsDiffs -uniq -key date
    555 
    556     book getword nsDiffs $options:0 nsNmacros -var ns_Nmacros
    557     if ("$ns_Nmacros" != "NULL")
    558         for i 0 $ns_Nmacros
    559             sprintf macroName "ns%dMacro" $i
    560             book getword nsDiffs $options:0 $macroName -var macroCmd
    561             $macroCmd
    562         end
    563     end
    564 
    565     if ($VERBOSE > 2)
    566         book listbook nsData
    567     end
    568   end
    569 
    570   # locked list
    571   task.exit    default
    572     showcommand failure
    573   end
    574   task.exit    crash
    575     showcommand crash
    576   end
    577   #operation times out?
    578   task.exit    timeout
    579     showcommand timeout
    580   end
    581 end
    582336
    583337#
     
    601355     book getword nsStacks $key nsStackState -var ns_stack_STATE
    602356     book getword nsData $key dbname -var DBNAME
     357     book getword nsData $key camera -var CAMERA
    603358     book npages nsData -var Npages
    604359
     
    612367
    613368     if (("$ns_STATE" != "DIFFING")&&("$ns_STATE" != "QUEUEDIFFS")&&("$ns_STATE" != "TOWARP")&&("$ns_STATE" != "FORCETOWARP")) break
    614      $run = nightly_science.pl --queue_diffs --date $date --dbname $DBNAME
     369     $run = nightly_science.pl --queue_diffs --date $date --dbname $DBNAME --camera $CAMERA
    615370#     add_standard_args $run
    616371     command $run
     
    652407
    653408
     409# This is the graveyard of tasks that we've defined in the past, but either never use, or never let go active.
     410
     411# if (0)
     412
     413
     414# macro ns.detrends.on
     415#   task ns.detrends.load
     416#     active true
     417#   end
     418# end
     419
     420
     421# macro ns.detrends.off
     422#   task ns.detrends.load
     423#     active false
     424#   end
     425# end
     426
     427# macro ns.stacks.confirm.on
     428#   task ns.stacks.confirm
     429#     active true
     430#   end
     431# end
     432
     433# macro ns.stacks.confirm.off
     434#   task ns.stacks.confirm
     435#     active false
     436#   end
     437# end
     438
     439
     440
     441
     442
     443# #
     444# # Queue off any possible detrend verification runs
     445# #
     446# task              ns.detrends.load
     447#   host            local
     448#   periods         -poll $LOADPOLL
     449#   periods         -exec $LOADEXEC
     450#   periods         -timeout 30
     451#   trange          23:00:00 23:59:59 -nmax 1
     452#   npending        1
     453
     454#   task.exec
     455#     stdout $LOGDIR/ns.detrends.log
     456#     stdout $LOGDIR/ns.detrends.log
     457#     $today = `date -u +%Y-%m-%d`
     458
     459#     $run = nightly_science.pl --queue_detrends --date $today --dbname $DB:0
     460# #     add_standard_args $run
     461#      command $run
     462#   end
     463 
     464#   task.exit       0
     465#     # nothign to do here
     466#   end
     467#   # locked list
     468#   task.exit       default
     469#     showcommand failure
     470#   end
     471#   task.exit       crash
     472#     showcommand crash
     473#   end
     474#   # operation times out
     475#   task.exit       timeout
     476#     showcommand timeout
     477#   end
     478# end
     479
     480
     481# #
     482# # Check to see if the warps are finished
     483# #
     484# task              ns.stacks.load
     485#   active          false
     486#   host            local
     487#   periods         -poll $LOADPOLL
     488#   periods         -exec $LOADEXEC
     489#   periods         -timeout 120
     490#   npending        1
     491
     492#   task.exec
     493#      stdout NULL
     494#      stderr $LOGDIR/ns.stacks.log
     495
     496#      book getpage nsData $ns_stackPAGE -var key
     497#      book getword nsStacks $key date -var date
     498#      book getword nsStacks $key nsStackState -var ns_STATE
     499#      book getword nsDiffs $key nsDiffState -var ns_diff_STATE
     500#      book getword nsData $key dbname -var DBNAME
     501#      book npages nsData -var Npages
     502
     503#     if ($VERBOSE > 5)
     504#        echo "ns.stacks.load: " $ns_stackPAGE $date $DBNAME $ns_STATE $Npages
     505#     end
     506
     507#      $ns_stackPAGE ++
     508#      if ($ns_stackPAGE >= $Npages) set ns_stackPAGE = 0
     509#      option $key
     510
     511#      if ("$ns_STATE" != "TOWARP") break
     512
     513#      $run = nightly_science.pl --check_stacks --date $date --dbname $DBNAME
     514# #     add_standard_args $run
     515#      command $run
     516
     517#    end
     518
     519#   # success
     520#   task.exit   0
     521# #    convert 'stdout' to book format
     522#     book delpage nsStacks $options:0
     523#     ipptool2book stdout nsStacks -uniq -key date
     524
     525#     book getword nsStacks $options:0 nsNmacros -var ns_Nmacros
     526#     if ("$ns_Nmacros" != "NULL")
     527#       for i 0 $ns_Nmacros
     528#           sprintf macroName "ns%dMacro" $i
     529#           book getword nsStacks $options:0 $macroName -var macroCmd
     530#           $macroCmd
     531#       end
     532#     end
     533
     534#     if ($VERBOSE > 2)
     535#       book listbook nsData
     536#     end
     537#   end
     538
     539#   # locked list
     540#   task.exit    default
     541#     showcommand failure
     542#   end
     543#   task.exit    crash
     544#     showcommand crash
     545#   end
     546#   #operation times out?
     547#   task.exit    timeout
     548#     showcommand timeout
     549#   end
     550# end
     551
     552# #
     553# # Confirm that all the stacks that can be built have been built, or at least attempted.
     554# #
     555# task              ns.stacks.confirm
     556#   active          false
     557#   host            local
     558#   periods         -poll $LOADPOLL
     559#   periods         -exec $LOADEXEC
     560#   periods         -timeout 120
     561#   npending        1
     562
     563#   task.exec
     564#      stdout NULL
     565#      stderr $LOGDIR/ns.stacks.log
     566
     567#      book getpage nsData $ns_CstackPAGE -var key
     568#      book getword nsStacks $key date -var date
     569#      book getword nsStacks $key nsStackState -var ns_STATE
     570#      book getword nsData $key dbname -var DBNAME
     571#      book npages nsData -var Npages
     572
     573#      if ($VERBOSE > 5)
     574#       echo "ns.stacks.confirm: " $ns_CstackPAGE $key $date $DBNAME $ns_STATE $Npages
     575#      end
     576
     577#      $ns_CstackPAGE ++
     578#      if ($ns_CstackPAGE >= $Npages) set ns_CstackPAGE = 0
     579#      option $key
     580
     581#      if ("$ns_STATE" != "STACKING") break
     582#      $run = nightly_science.pl --confirm_stacks --date $date --dbname $DBNAME
     583# #     add_standard_args $run
     584#      command $run
     585#    end
     586#   # success
     587#   task.exit   0
     588# #    convert 'stdout' to book format
     589#     book delpage nsStacks $options:0
     590#     ipptool2book stdout nsStacks -uniq -key date
     591
     592#     book getword nsStacks $options:0 nsNmacros -var ns_Nmacros
     593#     if ("$ns_Nmacros" != "NULL")
     594#       for i 0 $ns_Nmacros
     595#           sprintf macroName "ns%dMacro" $i
     596#           book getword nsStacks $options:0 $macroName -var macroCmd
     597#           $macroCmd
     598#       end
     599#     end
     600
     601#     if ($VERBOSE > 2)
     602#       book listbook nsData
     603#     end
     604#   end
     605
     606#   # locked list
     607#   task.exit    default
     608#     showcommand failure
     609#   end
     610#   task.exit    crash
     611#     showcommand crash
     612#   end
     613#   #operation times out?
     614#   task.exit    timeout
     615#     showcommand timeout
     616#   end
     617# end
     618
     619
     620
     621
     622# #
     623# # Check to see if the warps are finished
     624# #
     625# task              ns.diffs.load
     626#   active          false
     627#   host            local
     628#   periods         -poll $LOADPOLL
     629#   periods         -exec $LOADEXEC
     630#   periods         -timeout 120
     631#   npending        1
     632
     633#   task.exec
     634#      stdout NULL
     635#      stderr $LOGDIR/ns.diffs.log
     636
     637#      book getpage nsData $ns_diffPAGE -var key
     638#      book getword nsDiffs $key date -var date
     639#      book getword nsDiffs $key nsDiffState -var ns_STATE
     640#      book getword nsStacks $key nsStackState -var ns_stack_STATE
     641#      book getword nsData $key dbname -var DBNAME
     642#      book npages nsData -var Npages
     643
     644#     if ($VERBOSE > 5)
     645#        echo "ns.diffs.load: " $ns_diffPAGE $key $date $DBNAME $ns_STATE $Npages
     646#     end
     647
     648#      $ns_diffPAGE ++
     649#      if ($ns_diffPAGE >= $Npages) set ns_diffPAGE = 0
     650#      option $key
     651
     652#      if ("$ns_STATE" != "TOWARP") break
     653#      $run = nightly_science.pl --check_diffs --date $date --dbname $DBNAME
     654# #     add_standard_args $run
     655#      command $run
     656#    end
     657
     658#   # success
     659#   task.exit   0
     660# #    convert 'stdout' to book format
     661#     book delpage nsDiffs $options:0
     662#     ipptool2book stdout nsDiffs -uniq -key date
     663
     664#     book getword nsDiffs $options:0 nsNmacros -var ns_Nmacros
     665#     if ("$ns_Nmacros" != "NULL")
     666#       for i 0 $ns_Nmacros
     667#           sprintf macroName "ns%dMacro" $i
     668#           book getword nsDiffs $options:0 $macroName -var macroCmd
     669#           $macroCmd
     670#       end
     671#     end
     672
     673#     if ($VERBOSE > 2)
     674#       book listbook nsData
     675#     end
     676#   end
     677
     678#   # locked list
     679#   task.exit    default
     680#     showcommand failure
     681#   end
     682#   task.exit    crash
     683#     showcommand crash
     684#   end
     685#   #operation times out?
     686#   task.exit    timeout
     687#     showcommand timeout
     688#   end
     689# end
     690
     691
     692# # END GRAVEYARD
     693# end
     694
     695
    654696# #
    655697# # Queue sweetspot runs
Note: See TracChangeset for help on using the changeset viewer.