IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 19, 2010, 5:46:14 PM (16 years ago)
Author:
watersc1
Message:

First pass on exposure level jpegs for warp/stack/diff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20100519/ippTasks/diff.pro

    r27920 r28045  
    4444    active false
    4545  end
     46  task diff.summary.load
     47    active true
     48  end
     49  task diff.summary.run
     50    active true
     51  end
    4652end
    4753
     
    5864  end
    5965  task diff.revert
     66    active false
     67  end
     68  task diff.summary.load
     69    active false
     70  end
     71  task diff.summary.run
    6072    active false
    6173  end
     
    193205    # host anyhost
    194206    # $WORKDIR = $WORKDIR_TEMPLATE
    195 
    196207    if (($DIFF_MODE == 1)||("$DIFF_MODE" == "NULL"))
    197208        $DIFF_TAG = ""
     
    477488  end
    478489end
     490
     491### Load tasks for doing the diffs
     492### Tasks are loaded into diffPendingSkyCell.
     493task           diff.summary.load
     494  host         local
     495
     496  periods      -poll $LOADPOLL
     497  periods      -exec $LOADEXEC
     498  periods      -timeout 1200
     499  npending     1
     500
     501  stdout NULL
     502  stderr $LOGDIR/diff.summary.log
     503
     504  task.exec
     505    if ($LABEL:n == 0) break
     506    $run = difftool -tosummary
     507    if ($DB:n == 0)
     508      option DEFAULT
     509    else
     510      # save the DB name for the exit tasks
     511      option $DB:$diffSummary_DB
     512      $run = $run -dbname $DB:$diffSummary_DB
     513      $diffSummary_DB ++
     514      if ($diffSummary_DB >= $DB:n) set diffSummary_DB = 0
     515    end
     516    add_poll_args run
     517    add_poll_labels run
     518    command $run
     519  end
     520
     521  # success
     522  task.exit    0
     523    # convert 'stdout' to book format
     524    # XXX change tess_id to tess_dir when db is updated
     525    ipptool2book stdout diffPendingSummary -key diff_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     526    if ($VERBOSE > 2)
     527      book listbook diffPendingSummary
     528    end
     529
     530    # delete existing entries in the appropriate pantaskStates
     531    process_cleanup diffPendingSummary
     532  end
     533
     534  # locked list
     535  task.exit    default
     536    showcommand failure
     537  end
     538
     539  task.exit    crash
     540    showcommand crash
     541  end
     542
     543  # operation times out?
     544  task.exit    timeout
     545    showcommand timeout
     546  end
     547end
     548
     549### Run tasks for calculating the diff overlaps
     550### Tasks are taken from diffPendingSkyCell.
     551task           diff.summary.run
     552  periods      -poll $RUNPOLL
     553  periods      -exec $RUNEXEC
     554  periods      -timeout 60
     555
     556  task.exec
     557    # if we are unable to run the 'exec', use a long retry time
     558    periods -exec $RUNEXEC
     559
     560    book npages diffPendingSummary -var N
     561    if ($N == 0) break
     562    if ($NETWORK == 0) break
     563   
     564    # look for new images in diffPendingSkyCell (pantaskState == INIT)
     565    book getpage diffPendingSummary 0 -var pageName -key pantaskState INIT
     566    if ("$pageName" == "NULL") break
     567
     568    book setword diffPendingSummary $pageName pantaskState RUN
     569    book getword diffPendingSummary $pageName diff_id -var DIFF_ID
     570    book getword diffPendingSummary $pageName camera -var CAMERA
     571    book getword diffPendingSummary $pageName workdir -var WORKDIR_TEMPLATE
     572    book getword diffPendingSummary $pageName dbname -var DBNAME
     573    book getword warpPendingSummary $pageName tess_id -var TESS_DIR
     574    book getword diffPendingSummary $pageName diff_mode -var DIFF_MODE
     575    book getword diffPendingSummary $pageName exp_tag -var EXP_TAG
     576    book getword diffPendingSummary $pageName state -var RUN_STATE
     577
     578    # set the host and workdir based on the skycell hash
     579    host anyhost
     580    strsub $WORKDIR_TEMPLATE @HOST@.0 $default_host -var WORKDIR
     581#    set.workdir.by.skycell $SKYCELL_ID $WORKDIR_TEMPLATE $default_host WORKDIR
     582
     583#    if ("$PATH_BASE" == "NULL")
     584
     585    if (($DIFF_MODE == 1)||("$DIFF_MODE" == "NULL"))
     586        $DIFF_TAG = ""
     587    end
     588    if ($DIFF_MODE == 2)
     589        $DIFF_TAG = "WS."
     590    end
     591    if ($DIFF_MODE == 3)
     592        $DIFF_TAG = "SW."
     593    end
     594    if ($DIFF_MODE == 4)
     595        $DIFF_TAG = "SS."
     596    end
     597
     598    basename $TESS_DIR -var TESS_ID
     599
     600    sprintf outroot "%s/%s/%s/%s.%s.%sdif.%s.%s" $WORKDIR $TESS_ID $SKYCELL_ID $TESS_ID $SKYCELL_ID $DIFF_TAG $DIFF_ID
     601        ## generate outroot specific to this exposure
     602
     603
     604    stdout $LOGDIR/diff.summary.log
     605    stderr $LOGDIR/diff.summary.log
     606
     607    $run = skycell_jpeg.pl --stage diff --stage_id $DIFF_ID --camera $CAMERA --outroot $outroot
     608    add_standard_args run
     609
     610    # save the pageName for future reference below
     611    options $pageName
     612
     613    # create the command line
     614    if ($VERBOSE > 1)
     615      echo command $run
     616    end
     617    periods -exec 0.05
     618    command $run
     619  end
     620
     621  # default exit status
     622  task.exit    default
     623    process_exit diffPendingSummary $options:0 $JOB_STATUS
     624  end
     625
     626  # locked list
     627  task.exit    crash
     628    showcommand crash
     629    echo "hostname: $JOB_HOSTNAME"
     630    book setword diffPendingSummary $options:0 pantaskState CRASH
     631  end
     632
     633  # operation timed out?
     634  task.exit    timeout
     635    showcommand timeout
     636    book setword diffPendingSummary $options:0 pantaskState TIMEOUT
     637  end
     638end
Note: See TracChangeset for help on using the changeset viewer.