IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16610


Ignore:
Timestamp:
Feb 22, 2008, 10:19:22 AM (18 years ago)
Author:
eugene
Message:

fleshed out automate process

Location:
trunk/ippTasks
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/automate.pro

    r16570 r16610  
    1 ## mkdetrend.pro : autorun the detrend analysis : -*- sh -*-
     1## automate.pro : autorun the detrend analysis : -*- sh -*-
    22
    33# example automation stage
     
    3030end
    3131
     32macro automate.on
     33  task automate.block
     34    active true
     35  end
     36  task automate.check
     37    active true
     38  end
     39  task automate.launch
     40    active true
     41  end
     42end
     43
     44macro automate.off
     45  task automate.block
     46    active false
     47  end
     48  task automate.check
     49    active false
     50  end
     51  task automate.launch
     52    active false
     53  end
     54end
     55
    3256$automate_Nblock = -1
    3357task automate.block
     
    4670    book npages automate -var Npage -key pantaskState INIT.BLOCK
    4771    if ($Npage == 0)
    48       echo "no entries in INIT.BLOCK state"
     72      if ($VERBOSE >= 2)
     73        echo "no entries in INIT.BLOCK state"
     74      end
    4975      break
    5076    end
     
    5379    $automate_Nblock ++
    5480    if ($automate_Nblock >= $Npage) set automate_Nblock = 0
    55     echo "automate.block $automate_Nblock"
    5681
    5782    # search the automate book for an entry which is unstarted (state INIT.BLOCK)
    5883    book getpage automate $automate_Nblock -var pageName -key pantaskState INIT.BLOCK
    5984    if ("$pageName" == "NULL")
    60       echo "entry $automate_Nblock not in INIT.BLOCK state"
     85      if ($VERBOSE >= 2)
     86        echo "entry $automate_Nblock not in INIT.BLOCK state"
     87      end
    6188      break
    6289    end
     
    6693      # if there is no block needed, we can immediate progress to the next stage (INIT.CHECK)
    6794      book setword automate $pageName pantaskState INIT.CHECK
    68       echo "$pageName is ready : INIT.CHECK"
     95      if ($VERBOSE >= 2)
     96        echo "$pageName is ready : INIT.CHECK"
     97      end
    6998      break
    7099    end
     
    72101    book setword automate $pageName pantaskState RUN.BLOCK
    73102
    74     if ($VERBOSE >= 1)
     103    if ($VERBOSE >= 2)
    75104      echo "starting automate block for $pageName"
    76105      echo "command $blockCommand"
     
    86115    $pageName = $options:0
    87116
    88     echo "complete $pageName test, checking results"
    89 
    90117    # convert 'stdout' to book format
    91118    # XXX to use other tests, we'll need to modify this
    92     ipptool2book stdout detExp -key det_id -uniq
     119    ipptool2book stdout tmpBlock
    93120    if ($VERBOSE > 2)
    94       book listbook detExp
     121      book listbook tmpBlock
    95122    end
    96123
    97124    # if the block test returns any valid pages (valid results), the block is set, don't move to check
    98     book npages detExp -var Npage
    99     if ($Npage == 0)
    100       echo "$pageName is not blocked, ready for CHECK"
     125    book npages tmpBlock -var Npage
     126    if ($Npage == 0)
     127      if ($VERBOSE >= 2)
     128        echo "$pageName is not blocked, ready for CHECK"
     129      end
    101130      book setword automate $pageName pantaskState INIT.CHECK
    102131    else
    103       echo "$pageName is blocked, not ready for CHECK"
     132      if ($VERBOSE >= 2)
     133        echo "$pageName is blocked, not ready for CHECK"
     134      end
    104135      book setword automate $pageName pantaskState INIT.BLOCK
    105136    end
    106137
    107138    # drop the detExt book after we've grabbed the state
    108     book delete detExp
     139    book delete tmpBlock
    109140  end
    110141
     
    136167    book npages automate -var Npage -key pantaskState INIT.CHECK
    137168    if ($Npage == 0)
    138       echo "no entries in INIT.CHECK state"
     169      if ($VERBOSE >= 2)
     170        echo "no entries in INIT.CHECK state"
     171      end
    139172      break
    140173    end
     
    143176    $automate_Ncheck ++
    144177    if ($automate_Ncheck >= $Npage) set automate_Ncheck = 0
    145     echo "automate.check $automate_Ncheck"
    146178
    147179    # search the automate book for an entry which is unstarted (state INIT.CHECK)
    148180    book getpage automate $automate_Ncheck -var pageName -key pantaskState INIT.CHECK
    149181    if ("$pageName" == "NULL")
    150       echo "entry $automate_Ncheck not in INIT.CHECK state"
     182      if ($VERBOSE >= 2)
     183        echo "entry $automate_Ncheck not in INIT.CHECK state"
     184      end
    151185      break
    152186    end
     
    156190      # if there is no check needed, we can immediate progress to the next stage (INIT.LAUNCH)
    157191      book setword automate $pageName pantaskState INIT.LAUNCH
    158       echo "$pageName is ready : INIT.LAUNCH"
     192      if ($VERBOSE >= 2)
     193        echo "$pageName is ready : INIT.LAUNCH"
     194      end
    159195      break
    160196    end
     
    162198    book setword automate $pageName pantaskState RUN.CHECK
    163199
    164     if ($VERBOSE >= 1)
     200    if ($VERBOSE >= 2)
    165201      echo "starting automate check for $pageName"
    166202      echo "command $checkCommand"
     
    176212    $pageName = $options:0
    177213
    178     echo "complete $pageName test, checking results"
    179 
    180214    # convert 'stdout' to book format
    181215    # XXX to use other tests, we'll need to modify this
    182     ipptool2book stdout detExp -key det_id -uniq
     216    ipptool2book stdout tmpCheck
    183217    if ($VERBOSE > 2)
    184       book listbook detExp
    185     end
    186 
    187     book npages detExp -var Npage
    188     if ($Npage == 0)
    189       echo "$pageName not ready for LAUNCH"
     218      book listbook tmpCheck
     219    end
     220
     221    book npages tmpCheck -var Npage
     222    if ($Npage == 0)
     223      if ($VERBOSE >= 2)
     224        echo "$pageName not ready for LAUNCH"
     225      end
    190226      book setword automate $pageName pantaskState INIT.CHECK
    191227    else
    192       echo "$pageName is ready for LAUNCH"
     228      if ($VERBOSE >= 2)
     229        echo "$pageName is ready for LAUNCH"
     230      end
    193231      book setword automate $pageName pantaskState INIT.LAUNCH
    194232    end
    195233
    196234    # drop the detExt book after we've grabbed the state
    197     book delete detExp
     235    book delete tmpCheck
    198236  end
    199237
     
    225263    book npages automate -var Npage -key pantaskState INIT.LAUNCH
    226264    if ($Npage == 0)
    227       echo "no entries in INIT.LAUNCH state"
     265      if ($VERBOSE >= 2)
     266        echo "no entries in INIT.LAUNCH state"
     267      end
    228268      break
    229269    end
     
    232272    $automate_Nlaunch ++
    233273    if ($automate_Nlaunch >= $Npage) set automate_Nlaunch = 0
    234     echo "automate.launch $automate_Nlaunch"
    235274
    236275    # search the automate book for an entry which is unstarted (state INIT.LAUNCH)
    237276    book getpage automate $automate_Nlaunch -var pageName -key pantaskState INIT.LAUNCH
    238277    if ("$pageName" == "NULL")
    239       echo "entry $automate_Nlaunch not in INIT.LAUNCH state"
     278      if ($VERBOSE >= 2)
     279        echo "entry $automate_Nlaunch not in INIT.LAUNCH state"
     280      end
    240281      break
    241282    end
     
    245286      # if there is no launch needed, we can immediate progress to the next stage (INIT.LAUNCH)
    246287      book setword automate $pageName pantaskState INIT.LAUNCH
    247       echo "$pageName is ready : INIT.LAUNCH"
     288      if ($VERBOSE >= 2)
     289        echo "$pageName is ready : INIT.LAUNCH"
     290      end
    248291      break
    249292    end
     
    251294    book setword automate $pageName pantaskState RUN.LAUNCH
    252295
    253     if ($VERBOSE >= 1)
     296    if ($VERBOSE >= 2)
    254297      echo "starting automate launch for $pageName"
    255298      echo "command $launchCommand"
     
    265308    $pageName = $options:0
    266309
    267     echo "completed $pageName launch"
    268310    book setword automate $pageName pantaskState DONE.LAUNCH
    269311  end
  • trunk/ippTasks/simtest.auto

    r16570 r16610  
    44automate METADATA
    55  name       STR BIAS
    6   block      STR "dettool -runs -det_type BIAS -dbname eamtest"
     6  block      STR "dettool -runs -active -det_type BIAS -dbname eamtest"
    77  check      STR NONE
    88  launch     STR "dettool -definebyquery -workdir path://EAMWORK -inst SIMTEST -det_type BIAS -select_exp_type BIAS -dbname eamtest"
     
    1111automate METADATA
    1212  name       STR DARK
    13   block      STR "dettool -runs -det_type DARK -dbname eamtest"
     13  block      STR "dettool -runs -active -det_type DARK -dbname eamtest"
    1414  check      STR "detselect -search -inst SIMTEST -det_type BIAS -dbname eamtest"
    1515  launch     STR "dettool -definebyquery -workdir path://EAMWORK -inst SIMTEST -det_type DARK -select_exp_type DARK -dbname eamtest"
     
    1818automate METADATA
    1919  name       STR SHUTTER
    20   block      STR "dettool -runs -det_type SHUTTER -dbname eamtest"
     20  block      STR "dettool -runs -active -det_type SHUTTER -dbname eamtest"
    2121  check      STR "detselect -search -inst SIMTEST -det_type DARK -dbname eamtest"
    2222  launch     STR "dettool -definebyquery -workdir path://EAMWORK -inst SIMTEST -det_type SHUTTER -filter r -select_exp_type FLAT -select_filter r -dbname eamtest"
     
    2525automate METADATA
    2626  name       STR FLAT-r
    27   block      STR "dettool -runs -det_type FLAT -filter r -dbname eamtest"
     27  block      STR "dettool -runs -active -det_type FLAT -filter r -dbname eamtest"
    2828  check      STR "detselect -search -inst SIMTEST -det_type SHUTTER -dbname eamtest"
    2929  launch     STR "dettool -definebyquery -workdir path://EAMWORK -inst SIMTEST -det_type FLAT -filter r -select_exp_type FLAT -select_filter r -dbname eamtest"
     
    3232automate METADATA
    3333  name       STR FLAT-i
    34   block      STR "dettool -runs -det_type FLAT -filter i -dbname eamtest"
     34  block      STR "dettool -runs -active -det_type FLAT -filter i -dbname eamtest"
    3535  check      STR "detselect -search -inst SIMTEST -det_type SHUTTER -dbname eamtest"
    3636  launch     STR "dettool -definebyquery -workdir path://EAMWORK -inst SIMTEST -det_type FLAT -filter i -select_exp_type FLAT -select_filter i -dbname eamtest"
     
    3939automate METADATA
    4040  name       STR OBJECT-r
    41   block      STR "chiptool -block -label object.r -dbname eamtest"
     41  block      STR "chiptool -unmasked -label object.r -dbname eamtest"
    4242  check      STR "detselect -search -inst SIMTEST -det_type FLAT -dbname eamtest -filter r"
    4343  launch     STR "chiptool -unblock -label object.r -dbname eamtest"
     
    4646automate METADATA
    4747  name       STR OBJECT-i
    48   block      STR "chiptool -block -label object.i -dbname eamtest"
     48  block      STR "chiptool -unmasked -label object.i -dbname eamtest"
    4949  check      STR "detselect -search -inst SIMTEST -det_type FLAT -dbname eamtest -filter i"
    5050  launch     STR "chiptool -unblock -label object.i -dbname eamtest"
    5151END
    5252
     53### there is a weakness in the label / block business: the labels are
     54### generic, and the blocks are against those fairly generic words.
     55### that makes it difficult to block and unblock science exposures
     56### based on different detrend types that are available.  For example,
     57### to block the r-band against the absence of the desired r-band
     58### flat, we would need to specify a label specific to the r-band
     59### images and remove that block when ready.
     60
     61### a better approach might be to modify the labels rather than the
     62### blocks.  we can define, eg, chiptool -set_label -definebyquery to
     63### turn assign the label names based on various properties of the
     64### interesting images.
     65
     66### here is what the automate element might look like for such a circumstance:
     67
     68### automate METADATA
     69###   name       STR OBJECT-i
     70###   block      STR "chiptool -dbname eamtest -unmasked -label wait -filter i -time_begin 2008/1/1 -time_end 2008/1/2"
     71###   check      STR "detselect -dbname eamtest -search -inst SIMTEST -det_type FLAT -dbname eamtest -filter i -time_begin 2008/1/1 -time_end 2008/1/2"
     72###   launch     STR "chiptool -dbname eamtest -set_label proc -label wait -dbname eamtest -time_begin 2008/1/1 -time_end 2008/1/2"
     73### END
     74
     75### XXX still not quite there....
Note: See TracChangeset for help on using the changeset viewer.