IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 31376


Ignore:
Timestamp:
Apr 25, 2011, 3:00:33 PM (15 years ago)
Author:
heather
Message:

merging in addstar changes

Location:
trunk/ippTasks
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/addstar.pro

    r30327 r31376  
    1717
    1818macro addstar.on
    19   task addstar.exp.load
     19  task addstar.exp.load.stack
     20    active true
     21  end
     22  task addstar.exp.load.cam
     23    active true
     24  end
     25  task addstar.exp.load.staticsky
    2026    active true
    2127  end
     
    2632
    2733macro addstar.off
    28   task addstar.exp.load
     34  task addstar.exp.load.stack
     35    active false
     36  end
     37  task addstar.exp.load.cam
     38    active false
     39  end
     40  task addstar.exp.load.staticsky
    2941    active false
    3042  end
     
    5466# new entries are added to addPendingExp
    5567# skip already-present entries
    56 task           addstar.exp.load
     68task           addstar.exp.load.stack
    5769  host         local
    5870
     
    6779  task.exec
    6880   # if ($LABEL:n == 0) break
    69     $run = addtool -pendingexp
     81    $run = addtool -pendingexp -stage stack
    7082    if ($DB:n == 0)
    7183      option DEFAULT
     
    109121end
    110122
     123task           addstar.exp.load.cam
     124  host         local
     125
     126  periods      -poll $LOADPOLL
     127  periods      -exec $LOADEXEC
     128  periods      -timeout 30
     129  npending     1
     130
     131  stdout NULL
     132  stderr $LOGDIR/addstar.exp.log
     133
     134  task.exec
     135   # if ($LABEL:n == 0) break
     136    $run = addtool -pendingexp -stage cam
     137    if ($DB:n == 0)
     138      option DEFAULT
     139    else
     140      # save the DB name for the exit tasks
     141      option $DB:$addstar_DB
     142      $run = $run -dbname $DB:$addstar_DB
     143      $addstar_DB ++
     144      if ($addstar_DB >= $DB:n) set addstar_DB = 0
     145    end
     146    add_poll_args run
     147    add_poll_labels run
     148    command $run
     149  end
     150
     151  # success
     152  task.exit    0
     153    # convert 'stdout' to book format
     154    ipptool2book stdout addPendingExp -key add_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     155    if ($VERBOSE > 2)
     156      book listbook addPendingExp
     157    end
     158
     159    # delete existing entries in the appropriate pantaskStates
     160    process_cleanup addPendingExp
     161  end
     162
     163  # default exit status
     164  task.exit    default
     165    showcommand failure
     166  end
     167
     168  task.exit    crash
     169    showcommand crash
     170  end
     171
     172  # operation times out?
     173  task.exit    timeout
     174    showcommand timeout
     175  end
     176end
     177task           addstar.exp.load.staticsky
     178  host         local
     179
     180  periods      -poll $LOADPOLL
     181  periods      -exec $LOADEXEC
     182  periods      -timeout 30
     183  npending     1
     184
     185  stdout NULL
     186  stderr $LOGDIR/addstar.exp.log
     187
     188  task.exec
     189   # if ($LABEL:n == 0) break
     190    $run = addtool -pendingexp -stage staticsky
     191    if ($DB:n == 0)
     192      option DEFAULT
     193    else
     194      # save the DB name for the exit tasks
     195      option $DB:$addstar_DB
     196      $run = $run -dbname $DB:$addstar_DB
     197      $addstar_DB ++
     198      if ($addstar_DB >= $DB:n) set addstar_DB = 0
     199    end
     200    add_poll_args run
     201    add_poll_labels run
     202    command $run
     203  end
     204
     205  # success
     206  task.exit    0
     207    # convert 'stdout' to book format
     208    ipptool2book stdout addPendingExp -key add_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     209    if ($VERBOSE > 2)
     210      book listbook addPendingExp
     211    end
     212
     213    # delete existing entries in the appropriate pantaskStates
     214    process_cleanup addPendingExp
     215  end
     216
     217  # default exit status
     218  task.exit    default
     219    showcommand failure
     220  end
     221
     222  task.exit    crash
     223    showcommand crash
     224  end
     225
     226  # operation times out?
     227  task.exit    timeout
     228    showcommand timeout
     229  end
     230end
    111231# run the addstar script on pending exposures
    112232task           addstar.exp.run
     
    132252    book getword addPendingExp $pageName exp_tag -var EXP_TAG
    133253    book getword addPendingExp $pageName add_id -var ADD_ID
    134     book getword addPendingExp $pageName camroot -var CAMROOT
     254    book getword addPendingExp $pageName stageroot -var STAGEROOT
     255    book getword addPendingExp $pageName stage -var STAGE 
    135256    book getword addPendingExp $pageName workdir -var WORKDIR_TEMPLATE
    136257    book getword addPendingExp $pageName reduction -var REDUCTION
     
    157278
    158279    ## generate outroot specific to this exposure (& chip)
    159     sprintf outroot "%s/%s/%s.add.%s" $WORKDIR $EXP_TAG $EXP_TAG $ADD_ID
     280
     281    if ("$STAGE" == "cam")
     282        sprintf outroot "%s/%s/%s.add.%s" $WORKDIR $EXP_TAG $EXP_TAG $ADD_ID
     283    end
     284    if ("$STAGE" == "staticsky")
     285        sprintf outroot "%s.add.%s" $STAGEROOT $ADD_ID
     286    end
     287    if ("$STAGE" == "stack")
     288        sprintf outroot "%s.add.%s" $STAGEROOT $ADD_ID
     289    end
     290 
    160291
    161292    stdout $LOGDIR/addstar.exp.log
    162293    stderr $LOGDIR/addstar.exp.log
    163294
    164     $run = addstar_run.pl --exp_tag $EXP_TAG --add_id $ADD_ID --camera $CAMERA --dvodb $DVODB --camroot $CAMROOT --outroot $outroot --redirect-output
     295    $run = addstar_run.pl --add_id $ADD_ID --camera $CAMERA --dvodb $DVODB --stage $STAGE --stageroot $STAGEROOT --outroot $outroot --redirect-output
    165296    if ("$REDUCTION" != "NULL")
    166297      $run = $run --reduction $REDUCTION
  • trunk/ippTasks/survey.pro

    r30531 r31376  
    231231
    232232macro survey.add.addstar
    233   if ($0 != 4)
    234     echo "USAGE: survey.add.addstar (label) (dvodb) (minidvodb_group)"
     233  if ($0 != 5)
     234    echo "USAGE: survey.add.addstar (label) (dvodb) (minidvodb_group) (stage)"
    235235    break
    236236  end
     
    238238  book setword SURVEY_ADDSTAR $1 DVODB $2
    239239  book setword SURVEY_ADDSTAR $1 MINIDVODB_GROUP $3
     240  book setword SURVEY_ADDSTAR $1 STAGE $4 
    240241  book setword SURVEY_ADDSTAR $1 STATE PENDING
    241242end
     
    753754    book getword SURVEY_ADDSTAR $label DVODB -var dvodb
    754755    book getword SURVEY_ADDSTAR $label MINIDVODB_GROUP -var minidvodb_group
     756    book getword SURVEY_ADDSTAR $label STAGE -var stage
     757   
    755758 
    756759 #   $run = addtool -definebyquery -destreaked -label $label -set_dvodb $dbodb
     
    763766    end
    764767   
    765     $run = $run -definebyquery -destreaked -label $label -set_dvodb $dvodb -set_minidvodb_group $minidvodb_group -set_minidvodb -set_label $minidvodb_group
     768    $run = $run -definebyquery -label $label -set_dvodb $dvodb -set_minidvodb_group $minidvodb_group -set_minidvodb -set_label $minidvodb_group -stage $stage
    766769    # echo $run
     770    if ($stage == 'cam')
     771        #only queue destreaked cams. stacks and staticsky don't need this
     772        $run = $run -destreaked
     773    end
     774   
     775
    767776    command $run
    768777  end
Note: See TracChangeset for help on using the changeset viewer.