IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18683


Ignore:
Timestamp:
Jul 23, 2008, 1:55:39 PM (18 years ago)
Author:
Paul Price
Message:

Adding stack, diff, magic automation. Added new task (automate.regular) which runs commands on a regular basis: there is no progression from block->check->launch, but the commands just run over and over.

Location:
trunk/ippTasks
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/automate.pro

    r17605 r18683  
    3737  ipptool2book tmp automate -key name -uniq -setword pantaskState INIT.BLOCK
    3838  queuedelete tmp
     39
     40  ## Pull out the ones that are to be run regularly
     41  local npages
     42  book npages automate -var npages
     43  for i 0 $npages
     44    book getpage automate $i -var pageName
     45    if ("$pageName" != "NULL")
     46      book getword automate $pageName regular -var regularCommand
     47      if ("$regularCommand" != "NULL")
     48         book setword automate $pageName pantaskState INIT.REGULAR
     49      end
     50    end
     51  end
     52
    3953end
    4054
     
    4963    active true
    5064  end
     65  task automate.regular
     66    active true
     67  end
    5168end
    5269
     
    5976  end
    6077  task automate.launch
     78    active false
     79  end
     80  task automate.regular
    6181    active false
    6282  end
     
    335355end
    336356
     357
     358$automate_Nregular = 0
     359task automate.regular
     360  host         local
     361
     362  periods      -poll 1
     363  periods      -exec 5
     364  periods      -timeout 30
     365  active       true
     366  npending     1
     367
     368  task.exec
     369    local Npage pageName
     370
     371    # how many pages are waiting to be started?
     372    book npages automate -var Npage -key pantaskState INIT.REGULAR
     373    if ($Npage == 0)
     374      if ($VERBOSE >= 2)
     375        echo "no entries in INIT.REGULAR state"
     376      end
     377      break
     378    end
     379
     380    # cycle over the number of INIT.REGULAR pages: no point to loop over the others
     381    $automate_Nregular ++
     382    if ($automate_Nregular >= $Npage) set automate_Nregular = 0
     383
     384    # search the automate book for an entry which is unstarted (state INIT.REGULAR)
     385    book getpage automate $automate_Nregular -var pageName -key pantaskState INIT.REGULAR
     386    if ("$pageName" == "NULL")
     387      if ($VERBOSE >= 2)
     388        echo "entry $automate_Nregular not in INIT.REGULAR state"
     389      end
     390      break
     391    end
     392 
     393    book getword automate $pageName regular -var regularCommand
     394    if (("$regularCommand" == "NULL") || ("$regularCommand" == "NONE"))
     395      if ($VERBOSE >= 2)
     396        echo "Warning: $pageName has no regular command"
     397      end
     398      break
     399    end
     400
     401    book setword automate $pageName pantaskState RUN.REGULAR
     402
     403    if ($VERBOSE >= 2)
     404      echo "starting automate regular for $pageName"
     405      echo "command $regularCommand"
     406    end
     407
     408    options $pageName
     409    command $regularCommand
     410  end
     411
     412  task.exit $EXIT_SUCCESS
     413    local pageName Npage
     414
     415    $pageName = $options:0
     416
     417    book setword automate $pageName pantaskState INIT.REGULAR
     418  end
     419
     420  # all failures here (what state?)
     421  task.exit    default
     422    showcommand failure
     423    book setword automate $pageName pantaskState FAIL.REGULAR
     424  end
     425
     426  # operation times out?
     427  task.exit    timeout
     428    showcommand timeout
     429    book setword automate $pageName pantaskState INIT.REGULAR
     430  end
     431end
     432
  • trunk/ippTasks/simtest.auto

    r17606 r18683  
    5858END
    5959
     60### Stack automation???
     61automate METADATA
     62  name       STR STACK
     63  regular    STR "stacktool -definebyquery -all -workdir file://@CWD@/stack -min_new 4 -min_frac 2 -select_good_frac_min 0.2 -dbname @DBNAME@"
     64END
     65
     66### Diff automation???
     67automate METADATA
     68  name       STR DIFF
     69  regular    STR "difftool -definebyquery -workdir file://@CWD@/diff -good_frac 0.2 -dbname @DBNAME@"
     70END
     71
     72### Magic automation???
     73automate METADATA
     74  name       STR MAGIC
     75  regular    STR "magictool -definebyquery -workdir file://@CWD@/magic -good_frac 0.2 -dbname @DBNAME@"
     76END
     77
     78
     79
     80
    6081### automate METADATA
    6182###   name       STR OBJECT-r
  • trunk/ippTasks/simtest.basic.config

    r18592 r18683  
    4141
    4242### Carina
    43 #  CENTER.RA  F32 270.75
    44 #  CENTER.DEC F32 -23.7
     43  CENTER.RA  F32 270.75
     44  CENTER.DEC F32 -23.7
    4545### COSMOS field
    46   CENTER.RA  F32 150.119167
    47   CENTER.DEC F32   2.205833
     46#  CENTER.RA  F32 150.119167
     47#  CENTER.DEC F32   2.205833
    4848
    4949  OFFSET.RA  F32 3600.0 # linear offset in arcsec (do not include cos(DEC) correction)
     
    7979
    8080### Carina
    81 #  CENTER.RA  F32 270.75
    82 #  CENTER.DEC F32 -23.7
     81  CENTER.RA  F32 270.75
     82  CENTER.DEC F32 -23.7
    8383### COSMOS field
    84   CENTER.RA  F32 150.119167
    85   CENTER.DEC F32   2.205833
     84#  CENTER.RA  F32 150.119167
     85#  CENTER.DEC F32   2.205833
    8686
    8787  OFFSET.RA  F32 3600.0 # linear offset in arcsec (do not include cos(DEC) correction)
Note: See TracChangeset for help on using the changeset viewer.