IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 2, 2006, 12:36:59 PM (20 years ago)
Author:
eugene
Message:

updates to match new refactoring of tables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/detrend.process.pro

    r9081 r9104  
    99# detrend_process.pl 1 850131b mc bias 850131b.fits 850131b
    1010
    11 ## these tasks use the queue DetrendImfilesToProcess
    12 ## the DetrendImfilesToProcess queue contains:
     11## these tasks use the queue DetrendProcessImfiles
     12## the DetrendProcessImfiles queue contains:
    1313## STATE DET_ID TYPE EXP_KEY CLASS CLASS_ID URI
    1414
    15 queueinit DetrendImfilesToProcess
     15queueinit DetrendProcessImfiles
     16queueinit DetrendProcessExposures
    1617if ($?network == 0)
    1718  $network = 1
     
    2223
    2324# select images ready for copy
    24 # new entries are added to queue DetrendImfilesToProcess
     25# new entries are added to queue DetrendProcessImfiles
    2526# compare the new list with the ones already selected
    26 task           dettool.raw.load
     27task           dettool.process.load
    2728  command      dettool -raw -simple
    2829  host         local
     
    5354      $CLASS_ID = $word:4
    5455      $URI      = $word:5
    55       queuepush DetrendImfilesToProcess -uniq -key 1:3:5 "NEW $DET_ID $TYPE $EXP_KEY $CLASS $CLASS_ID $URI"
     56      queuepush DetrendProcessImfiles -uniq -key 1:3:5 "NEW $DET_ID $TYPE $EXP_KEY $CLASS $CLASS_ID $URI"
    5657    end
    5758
    5859    # delete existing entries which are DONE
    59     queuedrop DetrendImfilesToProcess -key 0 DONE
    60   end
    61 
    62   # locked list
    63   task.exit    1
    64     echo       "new.images: exec failure"
    65   end
    66 
    67   # default exit status
    68   task.exit    default
    69     echo       "new.images: unknown exit status: $EXIT"
    70   end
    71 
    72   # operation times out?
    73   task.exit    timeout
    74     echo       "new.images: timeout"
     60    queuedrop DetrendProcessImfiles -key 0 DONE
     61  end
     62
     63  # error
     64  task.exit    default
     65    echo       "detrend.process: failure"
     66  end
     67
     68  # operation times out?
     69  task.exit    timeout
     70    echo       "detrend.process: timeout"
    7571  end
    7672end
    7773
    7874# copy new images, sending job to desired host
    79 task           dettool.raw.process
     75task           dettool.process.run
    8076  periods      -poll 0.5
    8177  periods      -exec 2.0
     
    8379
    8480  task.exec
    85     queuesize DetrendImfilesToProcess -var N
     81    queuesize DetrendProcessImfiles -var N
    8682    if ($N == 0) break
    8783    if ($network == 0) break
    8884   
    89     # look for new images on the internal DetrendImfilesToProcess queue
     85    # look for new images on the internal DetrendProcessImfiles queue
    9086    # caution with these 'if' statements: syntax errors
    9187    # will make the task fail without given a good status
    92     queuepop DetrendImfilesToProcess -var line -key 0 NEW
     88    queuepop DetrendProcessImfiles -var line -key 0 NEW
    9389    if ("$line" == "NULL") break
    9490
    9591    strpop line state
    96     queuepush DetrendImfilesToProcess -replace -key 1:3:5 "RUN $line"
    97 
    98     ## the DetrendImfilesToProcess queue contains:
     92    queuepush DetrendProcessImfiles -replace -key 1:3:5 "RUN $line"
     93
     94    ## the DetrendProcessImfiles queue contains:
    9995    # STATE DET_ID TYPE EXP_KEY CLASS CLASS_ID URI
    10096    ## NOTE: the queue has the STATE prepended
     
    119115    # create example job options as a demonstration
    120116    options "$line"
    121     echo command detrend_process.pl --det_id $DET_ID --exp_id $EXP_KEY --class $CLASS --class_id $CLASS_ID --det_type bias --input_uri $URI
    122     command detrend_process.pl --det_id $DET_ID --exp_id $EXP_KEY --class $CLASS --class_id $CLASS_ID --det_type bias --input_uri $URI
     117    echo command detrend_process_imfile.pl --det_id $DET_ID --exp_id $EXP_KEY --class $CLASS --class_id $CLASS_ID --det_type bias --input_uri $URI
     118    command detrend_process_imfile.pl --det_id $DET_ID --exp_id $EXP_KEY --class $CLASS --class_id $CLASS_ID --det_type bias --input_uri $URI
    123119  end
    124120
    125121  # success
    126122  task.exit 0
    127     queuepush DetrendImfilesToProcess -replace -key 1:3:5 "DONE $options:0"
     123    queuepush DetrendProcessImfiles -replace -key 1:3:5 "DONE $options:0"
    128124  end
    129125
    130126  # default exit status
    131127  task.exit    default
    132     queuepush DetrendImfilesToProcess -replace -key 1:3:5 "FAIL $options:0"
    133   end
    134 
    135   # operation times out?
    136   task.exit    timeout
    137     queuepush DetrendImfilesToProcess -replace -key 1:3:5 "TIMEOUT $options:0"
    138   end
    139 end
     128    queuepush DetrendProcessImfiles -replace -key 1:3:5 "FAIL $options:0"
     129  end
     130
     131  # operation times out?
     132  task.exit    timeout
     133    queuepush DetrendProcessImfiles -replace -key 1:3:5 "TIMEOUT $options:0"
     134  end
     135end
     136
     137# select images ready for copy
     138# new entries are added to queue DetrendProcessExposures
     139# compare the new list with the ones already selected
     140task           dettool.processexp.load
     141  command      dettool -toprocessdexp -simple
     142  host         local
     143
     144  periods      -poll 1
     145  periods      -exec 5
     146  periods      -timeout 30
     147
     148  stdout dettool.processexp.log
     149  stderr dettool.processexp.log
     150
     151  # success
     152  task.exit    0
     153    # XXX is it necessary for these to be local?
     154    # drop after this task macro is done?
     155    local i Nqueue
     156
     157    # compare output with newImage queue
     158    # only add entries which don't exist in queue
     159    queuesize stdout -var Nqueue
     160    for i 0 $Nqueue
     161      queuepop stdout -var line
     162      list word -split $line
     163      $DET_ID   = $word:0
     164      $TYPE     = $word:1
     165      $EXP_KEY  = $word:2
     166      queuepush DetrendProcessExposures -uniq -key 1:3 "NEW $DET_ID $TYPE $EXP_KEY"
     167    end
     168
     169    # delete existing entries which are DONE
     170    queuedrop DetrendProcessExposures -key 0 DONE
     171  end
     172
     173  # error
     174  task.exit    default
     175    echo       "detrend.process: failure"
     176  end
     177
     178  # operation times out?
     179  task.exit    timeout
     180    echo       "detrend.process: timeout"
     181  end
     182end
     183
     184# copy new images, sending job to desired host
     185task           dettool.processexp.run
     186  periods      -poll 0.5
     187  periods      -exec 2.0
     188  periods      -timeout 60
     189
     190  task.exec
     191    queuesize DetrendProcessExposures -var N
     192    if ($N == 0) break
     193    if ($network == 0) break
     194   
     195    # look for new images on the internal DetrendProcessExposures queue
     196    # caution with these 'if' statements: syntax errors
     197    # will make the task fail without given a good status
     198    queuepop DetrendProcessExposures -var line -key 0 NEW
     199    if ("$line" == "NULL") break
     200
     201    strpop line state
     202    queuepush DetrendProcessExposures -replace -key 1:3:5 "RUN $line"
     203
     204    ## the DetrendProcessExposures queue contains:
     205    # STATE DET_ID TYPE EXP_KEY CLASS CLASS_ID URI
     206    ## NOTE: the queue has the STATE prepended
     207    list word -split $line
     208    $DET_ID   = $word:0
     209    $TYPE     = $word:1
     210    $EXP_KEY  = $word:2
     211
     212    stdout $EXP_KEY.detproc.$CLASS_ID.log
     213    stderr $EXP_KEY.detproc.$CLASS_ID.log
     214
     215    # specify choice of remote host:
     216    if ($parallel)
     217      host anyhost
     218    else
     219      host local
     220    end
     221
     222    # create example job options as a demonstration
     223    options "$line"
     224    echo command detrend_process_exp.pl --det_id $DET_ID --exp_id $EXP_KEY --det_type bias
     225    command detrend_process_exp.pl --det_id $DET_ID --exp_id $EXP_KEY --det_type bias
     226  end
     227
     228  # success
     229  task.exit 0
     230    queuepush DetrendProcessExposures -replace -key 1:3:5 "DONE $options:0"
     231  end
     232
     233  # default exit status
     234  task.exit    default
     235    queuepush DetrendProcessExposures -replace -key 1:3:5 "FAIL $options:0"
     236  end
     237
     238  # operation times out?
     239  task.exit    timeout
     240    queuepush DetrendProcessExposures -replace -key 1:3:5 "TIMEOUT $options:0"
     241  end
     242end
Note: See TracChangeset for help on using the changeset viewer.