IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35331


Ignore:
Timestamp:
Mar 27, 2013, 3:39:27 PM (13 years ago)
Author:
bills
Message:

add survey.lapgroup and supporting macros

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/survey.pro

    r34976 r35331  
    1818 book create SURVEY_STATICSKYSINGLE
    1919 book create SURVEY_SKYCAL
     20 book create SURVEY_LAPGROUP
    2021 $haveSurveyBooks = TRUE
    2122end
     
    3334$SURVEY_PUBLISH_DB = 0
    3435$SURVEY_SKYCAL_DB = 0
     36$SURVEY_LAPGROUP_DB = 0
    3537$SURVEY_STATICSKYSINGLE_DB = 0
    3638$SURVEY_EXEC = 120
     
    7880    active true
    7981  end
     82  task survey.lapgroup
     83    active true
     84  end
    8085end
    8186
     
    118123  end
    119124  task survey.skycal
     125    active false
     126  end
     127  task survey.lapgroup
    120128    active false
    121129  end
     
    494502macro survey.show.skycal
    495503  if ($0 != 1)
    496     echo "USAGE: survey.show.skyacl"
     504    echo "USAGE: survey.show.skycal"
    497505    break
    498506  end
    499507  book listbook SURVEY_SKYCAL
     508end
     509
     510macro survey.add.lapgroup
     511  if ($0 != 3)
     512    echo "USAGE: survey.add.lapgroup (label) (seq_id)"
     513    break
     514  end
     515  book newpage SURVEY_LAPGROUP $1
     516  book setword SURVEY_LAPGROUP $1 LABEL $1
     517  book setword SURVEY_LAPGROUP $1 SEQ_ID $2
     518  book setword SURVEY_LAPGROUP $1 STATE PENDING
     519end
     520
     521macro survey.del.lapgroup
     522  if ($0 != 2)
     523    echo "USAGE: survey.del.lapgroup (label)"
     524    break
     525  end
     526  book delpage SURVEY_LAPGROUP $1
     527end
     528
     529macro survey.show.lapgroup
     530  if ($0 != 1)
     531    echo "USAGE: survey.show.lapgroup"
     532    break
     533  end
     534  book listbook SURVEY_LAPGROUP
    500535end
    501536
     
    15611596  end
    15621597end
     1598
     1599task survey.lapgroup
     1600  host local
     1601 
     1602  periods      -poll $SURVEY_POLL
     1603  periods      -exec $SURVEY_EXEC
     1604  periods      -timeout $SURVEY_TIMEOUT
     1605  npending     1
     1606
     1607  stdout $LOGDIR/survey.lapgroup.log
     1608  stderr $LOGDIR/survey.lapgroup.log
     1609
     1610  task.exec
     1611    book npages SURVEY_LAPGROUP -var N
     1612    if ($N == 0)
     1613#      echo "No labels for processing"
     1614      break
     1615    endif
     1616
     1617    book getpage SURVEY_LAPGROUP 0 -var label -key STATE NEW
     1618    if ("$label" == "NULL")
     1619      # All labels have been done --- reset
     1620#      echo "Resetting labels"
     1621      for i 0 $N
     1622        book getpage SURVEY_LAPGROUP $i -var label
     1623        book setword SURVEY_LAPGROUP $label STATE NEW
     1624      end
     1625      book getpage SURVEY_LAPGROUP 0 -var label -key STATE NEW
     1626
     1627      # Select different database
     1628      $SURVEY_LAPGROUP ++
     1629      if ($SURVEY_LAPGROUP >= $DB:n) set SURVEY_LAPGROUP = 0
     1630    end
     1631
     1632    book setword SURVEY_LAPGROUP $label STATE DONE
     1633    book getword SURVEY_LAPGROUP $label SEQ_ID -var SEQ_ID
     1634
     1635    # For now the list of filters
     1636    $run = laptool -definegroup -seq_id $SEQ_ID -set_label $label -filter g.00000 -filter r.00000 -filter i.00000 -filter z.00000 -filter y.00000
     1637
     1638    if ($DB:n == 0)
     1639      option DEFAULT
     1640    else
     1641      $run = $run -dbname $DB:$SURVEY_LAPGROUP_DB
     1642      option $DB:$SURVEY_LAPGROUP_DB
     1643    end
     1644   
     1645    # echo $run
     1646    command $run
     1647  end
     1648
     1649  # success
     1650  task.exit    0
     1651#    echo "Success"
     1652  end
     1653
     1654  # locked list
     1655  task.exit    default
     1656    showcommand failure
     1657  end
     1658
     1659  task.exit    crash
     1660    showcommand crash
     1661  end
     1662
     1663  # operation times out?
     1664  task.exit    timeout
     1665    showcommand timeout
     1666  end
     1667end
Note: See TracChangeset for help on using the changeset viewer.