IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28375 for trunk/ippTasks


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:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/ippTasks/diff.pro

    r27920 r28375  
    1111book init diffSkyfile
    1212#book init diffCleanup
     13book init diffPendingSummary
    1314
    1415### Database lists
     
    1617$diffAdvance_DB = 0
    1718$diff_revert_DB = 0
     19$diffSummary_DB = 0
    1820#$diffCleanup_DB = 0
    1921
     
    2729macro diff.reset
    2830  book init diffSkyfile
     31  book init diffPendingSummary
    2932#  book init diffCleanup
    3033end
     
    4447    active false
    4548  end
     49  task diff.summary.load
     50    active true
     51  end
     52  task diff.summary.run
     53    active true
     54  end
    4655end
    4756
     
    5867  end
    5968  task diff.revert
     69    active false
     70  end
     71  task diff.summary.load
     72    active false
     73  end
     74  task diff.summary.run
    6075    active false
    6176  end
     
    193208    # host anyhost
    194209    # $WORKDIR = $WORKDIR_TEMPLATE
    195 
    196210    if (($DIFF_MODE == 1)||("$DIFF_MODE" == "NULL"))
    197211        $DIFF_TAG = ""
     
    477491  end
    478492end
     493
     494### Load tasks for doing the diffs
     495### Tasks are loaded into diffPendingSkyCell.
     496task           diff.summary.load
     497  host         local
     498
     499  periods      -poll $LOADPOLL
     500  periods      -exec $LOADEXEC
     501  periods      -timeout 1200
     502  npending     1
     503
     504  stdout NULL
     505  stderr $LOGDIR/diff.summary.log
     506
     507  task.exec
     508    if ($LABEL:n == 0) break
     509    $run = difftool -tosummary
     510    if ($DB:n == 0)
     511      option DEFAULT
     512    else
     513      # save the DB name for the exit tasks
     514      option $DB:$diffSummary_DB
     515      $run = $run -dbname $DB:$diffSummary_DB
     516      $diffSummary_DB ++
     517      if ($diffSummary_DB >= $DB:n) set diffSummary_DB = 0
     518    end
     519    add_poll_args run
     520    add_poll_labels run
     521    command $run
     522  end
     523
     524  # success
     525  task.exit    0
     526    # convert 'stdout' to book format
     527    # XXX change tess_id to tess_dir when db is updated
     528    ipptool2book stdout diffPendingSummary -key diff_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     529    if ($VERBOSE > 2)
     530      book listbook diffPendingSummary
     531    end
     532
     533    # delete existing entries in the appropriate pantaskStates
     534    process_cleanup diffPendingSummary
     535  end
     536
     537  # locked list
     538  task.exit    default
     539    showcommand failure
     540  end
     541
     542  task.exit    crash
     543    showcommand crash
     544  end
     545
     546  # operation times out?
     547  task.exit    timeout
     548    showcommand timeout
     549  end
     550end
     551
     552### Run tasks for calculating the diff overlaps
     553### Tasks are taken from diffPendingSkyCell.
     554task           diff.summary.run
     555  periods      -poll $RUNPOLL
     556  periods      -exec $RUNEXEC
     557  periods      -timeout 60
     558
     559  task.exec
     560    # if we are unable to run the 'exec', use a long retry time
     561    periods -exec $RUNEXEC
     562
     563    book npages diffPendingSummary -var N
     564    if ($N == 0) break
     565    if ($NETWORK == 0) break
     566   
     567    # look for new images in diffPendingSkyCell (pantaskState == INIT)
     568    book getpage diffPendingSummary 0 -var pageName -key pantaskState INIT
     569    if ("$pageName" == "NULL") break
     570
     571    book setword diffPendingSummary $pageName pantaskState RUN
     572    book getword diffPendingSummary $pageName diff_id -var DIFF_ID
     573    book getword diffPendingSummary $pageName camera -var CAMERA
     574    book getword diffPendingSummary $pageName workdir -var WORKDIR_TEMPLATE
     575    book getword diffPendingSummary $pageName dbname -var DBNAME
     576    book getword diffPendingSummary $pageName tess_id -var TESS_DIR
     577    book getword diffPendingSummary $pageName diff_mode -var DIFF_MODE
     578    book getword diffPendingSummary $pageName state -var RUN_STATE
     579
     580    # set the host and workdir based on the skycell hash
     581    host anyhost
     582    strsub $WORKDIR_TEMPLATE @HOST@.0 $default_host -var WORKDIR
     583#    set.workdir.by.skycell $SKYCELL_ID $WORKDIR_TEMPLATE $default_host WORKDIR
     584
     585#    if ("$PATH_BASE" == "NULL")
     586
     587    if (($DIFF_MODE == 1)||("$DIFF_MODE" == "NULL"))
     588        $DIFF_TAG = ""
     589    end
     590    if ($DIFF_MODE == 2)
     591        $DIFF_TAG = "WS."
     592    end
     593    if ($DIFF_MODE == 3)
     594        $DIFF_TAG = "SW."
     595    end
     596    if ($DIFF_MODE == 4)
     597        $DIFF_TAG = "SS."
     598    end
     599
     600    basename $TESS_DIR -var TESS_ID
     601
     602    ## generate outroot specific to this exposure
     603    sprintf outroot "%s/%s/%s.%sdif.%s.summary" $WORKDIR $TESS_ID $TESS_ID $DIFF_TAG $DIFF_ID
     604
     605
     606    stdout $LOGDIR/diff.summary.log
     607    stderr $LOGDIR/diff.summary.log
     608
     609    $run = skycell_jpeg.pl --stage diff --stage_id $DIFF_ID --camera $CAMERA --outroot $outroot
     610    add_standard_args run
     611
     612    # save the pageName for future reference below
     613    options $pageName
     614
     615    # create the command line
     616    if ($VERBOSE > 1)
     617      echo command $run
     618    end
     619    periods -exec 0.05
     620    command $run
     621  end
     622
     623  # default exit status
     624  task.exit    default
     625    process_exit diffPendingSummary $options:0 $JOB_STATUS
     626  end
     627
     628  # locked list
     629  task.exit    crash
     630    showcommand crash
     631    echo "hostname: $JOB_HOSTNAME"
     632    book setword diffPendingSummary $options:0 pantaskState CRASH
     633  end
     634
     635  # operation timed out?
     636  task.exit    timeout
     637    showcommand timeout
     638    book setword diffPendingSummary $options:0 pantaskState TIMEOUT
     639  end
     640end
  • 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
  • trunk/ippTasks/warp.pro

    r27926 r28375  
    1313book init warpPendingSkyCell
    1414book init warpPendingCleanup
     15book init warpPendingSummary
    1516
    1617### Database lists
     
    1920$warp_revert_overlap_DB = 0
    2021$warp_revert_warped_DB = 0
     22$warpSummary_DB = 0
    2123
    2224### Check status of warping tasks
     
    3032  book init warpInputExp
    3133  book init warpPendingSkyCell
     34  book init warpPendingSummary
    3235end
    3336
     
    5558    active true
    5659  end
     60  task warp.summary.load
     61    active true
     62  end
     63  task warp.summary.run
     64    active true
     65  end
    5766end
    5867
     
    7887  end
    7988  task warp.revert.warped
     89    active false
     90  end
     91  task warp.summary.load
     92    active false
     93  end
     94  task warp.summary.run
    8095    active false
    8196  end
     
    525540  end
    526541end
     542
     543### Load tasks for doing the warps
     544### Tasks are loaded into warpPendingSkyCell.
     545task           warp.summary.load
     546  host         local
     547
     548  periods      -poll $LOADPOLL
     549  periods      -exec $LOADEXEC
     550  periods      -timeout 1200
     551  npending     1
     552
     553  stdout NULL
     554  stderr $LOGDIR/warp.summary.log
     555
     556  task.exec
     557    if ($LABEL:n == 0) break
     558    $run = warptool -tosummary
     559    if ($DB:n == 0)
     560      option DEFAULT
     561    else
     562      # save the DB name for the exit tasks
     563      option $DB:$warpSummary_DB
     564      $run = $run -dbname $DB:$warpSummary_DB
     565      $warpSummary_DB ++
     566      if ($warpSummary_DB >= $DB:n) set warpSummary_DB = 0
     567    end
     568    add_poll_args run
     569    add_poll_labels run
     570    command $run
     571  end
     572
     573  # success
     574  task.exit    0
     575    # convert 'stdout' to book format
     576    # XXX change tess_id to tess_dir when db is updated
     577    ipptool2book stdout warpPendingSummary -key warp_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     578    if ($VERBOSE > 2)
     579      book listbook warpPendingSummary
     580    end
     581
     582    # delete existing entries in the appropriate pantaskStates
     583    process_cleanup warpPendingSummary
     584  end
     585
     586  # locked list
     587  task.exit    default
     588    showcommand failure
     589  end
     590
     591  task.exit    crash
     592    showcommand crash
     593  end
     594
     595  # operation times out?
     596  task.exit    timeout
     597    showcommand timeout
     598  end
     599end
     600
     601### Run tasks for calculating the warp overlaps
     602### Tasks are taken from warpPendingSkyCell.
     603task           warp.summary.run
     604  periods      -poll $RUNPOLL
     605  periods      -exec $RUNEXEC
     606  periods      -timeout 60
     607
     608  task.exec
     609    # if we are unable to run the 'exec', use a long retry time
     610    periods -exec $RUNEXEC
     611
     612    book npages warpPendingSummary -var N
     613    if ($N == 0) break
     614    if ($NETWORK == 0) break
     615   
     616    # look for new images in warpPendingSkyCell (pantaskState == INIT)
     617    book getpage warpPendingSummary 0 -var pageName -key pantaskState INIT
     618    if ("$pageName" == "NULL") break
     619
     620    book setword warpPendingSummary $pageName pantaskState RUN
     621    book getword warpPendingSummary $pageName warp_id -var WARP_ID
     622    book getword warpPendingSummary $pageName camera -var CAMERA
     623    book getword warpPendingSummary $pageName workdir -var WORKDIR_TEMPLATE
     624    book getword warpPendingSummary $pageName dbname -var DBNAME
     625    book getword warpPendingSummary $pageName tess_id -var TESS_DIR
     626    book getword warpPendingSummary $pageName exp_tag -var EXP_TAG
     627    book getword warpPendingSummary $pageName state -var RUN_STATE
     628
     629    # set the host and workdir based on the skycell hash
     630    host anyhost
     631    strsub $WORKDIR_TEMPLATE @HOST@.0 $default_host -var WORKDIR
     632#    set.workdir.by.skycell $SKYCELL_ID $WORKDIR_TEMPLATE $default_host WORKDIR
     633
     634#    if ("$PATH_BASE" == "NULL")
     635        ## generate outroot specific to this exposure
     636    basename $TESS_DIR -var TESS_ID
     637
     638    sprintf outroot "%s/%s/%s.wrp.%s.%s" $WORKDIR $EXP_TAG $EXP_TAG $WARP_ID $TESS_ID
     639
     640
     641    stdout $LOGDIR/warp.summary.log
     642    stderr $LOGDIR/warp.summary.log
     643
     644    $run = skycell_jpeg.pl --stage warp --stage_id $WARP_ID --camera $CAMERA --outroot $outroot
     645    add_standard_args run
     646
     647    # save the pageName for future reference below
     648    options $pageName
     649
     650    # create the command line
     651    if ($VERBOSE > 1)
     652      echo command $run
     653    end
     654    periods -exec 0.05
     655    command $run
     656  end
     657
     658  # default exit status
     659  task.exit    default
     660    process_exit warpPendingSummary $options:0 $JOB_STATUS
     661  end
     662
     663  # locked list
     664  task.exit    crash
     665    showcommand crash
     666    echo "hostname: $JOB_HOSTNAME"
     667    book setword warpPendingSummary $options:0 pantaskState CRASH
     668  end
     669
     670  # operation timed out?
     671  task.exit    timeout
     672    showcommand timeout
     673    book setword warpPendingSummary $options:0 pantaskState TIMEOUT
     674  end
     675end
Note: See TracChangeset for help on using the changeset viewer.