IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 16, 2010, 5:30:27 PM (16 years ago)
Author:
watersc1
Message:

merge of stack association and warp/stack/diff jpegs

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/ippTasks/stack.pro

    r27929 r28375  
    1010### Initialise the books containing the tasks to do
    1111book init stackSumSkyfile
     12book init stackPendingSummary
    1213#book init stackCleanup
    1314
     
    1617$stack_revert_DB = 0
    1718#$stackCleanup_DB = 0
     19$stackSummary_DB = 0
    1820
    1921### Check status of stacking tasks
     
    2628macro stack.reset
    2729  book init stackSumSkyfile
     30  book init stackPendingSummary
    2831#  book init stackCleanup
    2932end
     
    4043    active false
    4144  end
     45  task stack.summary.load
     46    active true
     47  end
     48  task stack.summary.run
     49    active true
     50  end
    4251end
    4352
     
    5160  end
    5261  task stack.revert
     62    active false
     63  end
     64  task stack.summary.load
     65    active false
     66  end
     67  task stack.summary.run
    5368    active false
    5469  end
     
    349364# end
    350365
     366
     367
     368
    351369task stack.revert
    352370  host         local
     
    400418end
    401419
     420### Load tasks for doing the stack summary
     421### Tasks are loaded into stackPendingSummary
     422task           stack.summary.load
     423  host         local
     424
     425  periods      -poll $LOADPOLL
     426  periods      -exec $LOADEXEC
     427  periods      -timeout 1200
     428  trange       07:00:00 08:00:00 -nmax 1
     429  npending     1
     430
     431  stdout       NULL
     432  stderr       $LOGDIR/stack.summary.load
     433
     434  task.exec
     435    if ($LABEL:n == 0) break
     436    $run = stacktool -tosummary
     437    if ($DB:n == 0)
     438      option DEFAULT
     439    else
     440      # save the DB name for the exit tasks
     441      option $DB:$stackSummary_DB
     442      $run = $run -dbname $DB:$stackSummary_DB
     443      $stackSummary_DB ++
     444      if ($stackSummary_DB >= $DB:n) set stackSummary_DB = 0
     445    end
     446    add_poll_args run
     447    add_poll_labels run
     448    command $run
     449  end
     450
     451  # success
     452  task.exit     0
     453    # convert 'stdout' to book format
     454    ipptool2book stdout stackPendingSummary -key sass_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     455    if ($VERBOSE > 2)
     456      book listbook stackPendingSummary
     457    end
     458
     459    # delete existing entries in the appropriate pantaskStates
     460    process_cleanup stackPendingSummary
     461  end
     462
     463  # locked list
     464  task.exit     default
     465    showcommand failure
     466  end
     467
     468  task.exit     crash
     469    showcommand crash
     470  end
     471
     472  # operation times out?
     473  task.exit     timeout
     474    showcommand timeout
     475  end
     476end
     477
     478### Run tasks for doing the stack summary
     479task           stack.summary.run
     480  periods      -poll $RUNPOLL
     481  periods      -exec $RUNEXEC
     482  periods      -timeout 60
     483
     484  task.exec
     485    # if we are unable to run the 'exec', use a long retry time
     486    periods -exec $RUNEXEC
     487
     488    book npages stackPendingSummary -var N
     489    if ($N == 0) break
     490    if ($NETWORK == 0) break
     491
     492    # look for new images in stackPendingSummary (pantaskState == INIT)
     493    book getpage stackPendingSummary 0 -var pageName -key pantaskState INIT
     494    if ("$pageName" == "NULL") break
     495
     496    book setword stackPendingSummary $pageName pantaskState RUN
     497    book getword stackPendingSummary $pageName sass_id -var SASS_ID
     498    book getword stackPendingSummary $pageName camera -var CAMERA
     499    book getword stackPendingSummary $pageName workdir -var WORKDIR_TEMPLATE
     500    book getword stackPendingSummary $pageName dbname -var DBNAME
     501    book getword stackPendingSummary $pageName tess_id -var TESS_DIR
     502    book getword stackPendingSummary $pageName state -var RUN_STATE
     503    book getword stackPendingSummary $pageName projection_cell -var projection_cell
     504
     505    # set the host and workdir
     506    host anyhost
     507    strsub $WORKDIR_TEMPLATE @HOST@.0 $default_host -var WORKDIR
     508
     509    basename $TESS_DIR -var TESS_ID
     510
     511    ## generate outroot specific to this association
     512    sprintf outroot "%s/%s/%s.stk.%s.summary" $WORKDIR $TESS_ID $TESS_ID $SASS_ID
     513
     514    stdout $LOGDIR/stack.summary.log
     515    stderr $LOGDIR/stack.summary.log
     516
     517    $run = skycell_jpeg.pl --stage stack --stage_id $SASS_ID --camera $CAMERA --outroot $outroot
     518    add_standard_args run
     519
     520    # save the pageName for future reference below
     521    options $pageName
     522
     523    # create the command line
     524    if ($VERBOSE > 1)
     525        echo command $run
     526    end
     527    periods -exec 0.05
     528    command $run
     529  end
     530
     531  # default exit status
     532  task.exit       default
     533    process_exit stackPendingSummary $options:0 $JOB_STATUS
     534  end
     535
     536  # locked list
     537  task.exit       crash
     538    showcommand crash
     539    echo "hostname: $JOB_HOSTNAME"
     540    book setword stackPendingSummary $options:0 pantaskState CRASH
     541  end
     542
     543  # operation timed out?
     544  task.exit       timeout
     545    showcommand timeout
     546    book setword stackPendingSummary $options:0 pantaskState TIMEOUT
     547  end
     548end
     549
Note: See TracChangeset for help on using the changeset viewer.