IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42912


Ignore:
Timestamp:
Jul 7, 2025, 12:32:35 PM (12 months ago)
Author:
eugene
Message:

working on new burntool

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20250626/tools/eam/burntool.20250520/src/bt.getchip.pt

    r42911 r42912  
    11
    2 # master book is btChipNight listing all CHIPNIGHT books
     2# the master book btChipNights lists all of CHIPNIGHT books
    33# CHIPNIGHT books are named after the nights and chips, e.g. 20250704.XY01
    44
     5if (not($BT_CHIPNIGHT_NSEQ)) set BT_CHIPNIGHT_NSEQ = 0
     6
    57# get the next available chip (one chip from an exposure for a single night)
    6 task bt.getchip.run
     8# all ops are done within the task exec
     9task bt.getchip
    710  periods      -poll $BT_POLL
    811  periods      -exec $BT_EXEC
    912  periods      -timeout 1800
     13  host         local
    1014
    1115  task.exec
     
    1317    periods -exec $BT_EXEC
    1418
     19    # XXX is this sensible? 
    1520    if ($BT_PAUSE) break
    1621   
    17     # how many hosts are defined?
    18     book npages btChipNight -var Nnights
     22    # how many nights are defined?
     23    book npages btChipNights -var Nnights
    1924
    2025    # if we have reached the end, restart the loop over chip hosts
     
    2530    end
    2631   
    27     # XXX CHIPNIGHT could be the same as the page name
    28     book getpage btChipNight $BT_CHIPNIGHT_NSEQ           -var BT_CHIPNIGHT_PAGE
    29     book getword btChipNight $BT_CHIPNIGHT_PAGE CHIPNIGHT -var BT_CHIPNIGHT_BOOK
    30     book getword btChipNight $BT_CHIPNIGHT_PAGE STATE     -var BT_CHIPNIGHT_STATE
     32    # grab info for this CHIPNIGHT
     33    book getpage btChipNights $BT_CHIPNIGHT_NSEQ           -var BT_CHIPNIGHT_PAGE
     34    book getword btChipNights $BT_CHIPNIGHT_PAGE CHIPNIGHT -var BT_CHIPNIGHT_BOOK
     35    book getword btChipNights $BT_CHIPNIGHT_PAGE STATE     -var BT_CHIPNIGHT_STATE
    3136
    3237    # ENTRY tracks the sequence number in the CHIPNIGHT
    33     book getword btChipNight $BT_CHIPNIGHT_PAGE ENTRY     -var BT_CHIPNIGHT_ENTRY
     38    book getword btChipNights $BT_CHIPNIGHT_PAGE ENTRY     -var BT_CHIPNIGHT_ENTRY
    3439
    35     # PREVTABLE (previousTable) will be NULL at the start (populated below)
    36     book getword btChipNight $BT_CHIPNIGHT_PAGE PREVTABLE -var previousTable
     40    # OUTTABLE (previousTable) will be NULL at the start (populated below)
     41    book getword btChipNights $BT_CHIPNIGHT_PAGE OUTTABLE -var previousTable
    3742
    3843    # is this chip/night ready to go?
     
    6469    book getpage $BT_CHIPNIGHT_BOOK $BT_CHIPNIGHT_ENTRY -var pageName
    6570    if ("$pageName" == "NULL")
    66       # this is a programming error
    67       stop
     71      ??
    6872      echo "PROGRAMMING ERROR"
    69       break
     73      exit
    7074    end
    7175
     
    7478
    7579    # save info about currently active entry
    76     book setword btChipNight $BT_CHIPNIGHT_PAGE STATE       RUN
    77     book setword btChipNight $BT_CHIPNIGHT_PAGE ENTRY       $BT_CHIPNIGHT_ENTRY
    78     book setword btChipNight $BT_CHIPNIGHT_PAGE PREVTABLE   $outTableReal
     80    book setword btChipNights $BT_CHIPNIGHT_PAGE STATE       RUN
     81    book setword btChipNights $BT_CHIPNIGHT_PAGE ENTRY       $BT_CHIPNIGHT_ENTRY
     82    book setword btChipNights $BT_CHIPNIGHT_PAGE OUTTABLE    $outTableReal
    7983
    8084    # XXX choose something sensible:
    81     # stdout $mypath/$YEAR/$DATEOBS/log.burntool.run.$CHIP_ID.v$ITER
    82     # stderr $mypath/$YEAR/$DATEOBS/log.burntool.run.$CHIP_ID.v$ITER
     85    stdout log.bt.getchip
     86    stderr log.bt.getchip
    8387
    8488    periods -exec 0.05
    8589    command echo selected $exposure, $class_id for processing
    8690  end
    87 
    88   task.exit 0
    89     bt.getchip.exit OK
    90   end
    91 
    92   # exit values other than 0:
    93   task.exit    default
    94     bt.getchip.exit FAIL
    95     showcommand failure
    96   end
    97 
    98   task.exit    crash
    99     bt.getchip.exit CRASH
    100     showcommand crash
    101   end
    102 
    103   # operation times out?
    104   task.exit    timeout
    105     bt.getchip TIMEOUT
    106     showcommand timeout
    107   end
    10891end
    109 
    110 macro bt.getchip.exit
    111   if ($0 != 2)
    112     echo "USAGE: bt.getchip.exit (quality)"
    113     break
    114   end
    115 
    116   local myBook myPage chPage
    117   $myBook = $options:0
    118   $myPage = $options:1
    119   $chPage = $options:2
    120 
    121   book setword $myBook $myPage pantaskState DONE
    122 
    123   # what else needs to happen after the job is done?
    124 
    125   # decrement NRUN for this host
    126   book getword btChipNight $chPage NRUN -var BT_CHIPNIGHT_NRUN
    127   $BT_CHIPNIGHT_NRUN --
    128   book setword btChipNight $chPage NRUN      $BT_CHIPNIGHT_NRUN
    129 
    130   # update the night/exp/chip list as well
    131   # this chip state set to DONE or FAIL
    132   # book delpage burnhost.book $options:0
    133 end
    134 
    13592
    13693######### supporting methods #############
     
    149106  local rawImfileReal outTableReal previousTable expname chipID myHost
    150107
    151   ### XXX need to track entry in btChipNight so bt.onechip.exit can update
     108  ### XXX need to track entry in btChipNights so bt.onechip.exit can update
    152109
    153110  book getword $BT_CHIPNIGHT_BOOK $pageName rawImfileReal -var rawImfileReal
Note: See TracChangeset for help on using the changeset viewer.