! @(#)pipeline.start 16.1.1.1 (ESO-DMD) 06/19/01 15:29:16 ! +++++++++++++++++++++++++++++++++++++ ! ! Midas procedure pipeline.start for NTT/VLT pipeline ! K. Banse 961209, 990922, 000721, 010618 (SB), 020131 ! ! this procedure creates the additional keywords needed for the Pipeline ! ! if called within the context RBS it also takes parameters ! ! +++++++++++++++++++++++++++++++++++++~ ! write/keyw recipe_time/c/1/60 " " all write/keyword recipe_secs/i/1/3 0,0,0 !used for elapsed time write/keyword recipe_name/c/1/80 " " all !name of recipe ! write/keyw pipeline/i/1/15 0,1,0,0,0,0,300,0,0,-1,0,0,0,0,0 ! pipeline(1) = exit status of top level recipe ! = 0, o.k. - else look at keyword PROGSTAT for error code ! pipeline(2) = working_direc_delete_flag, ! 1 - delete old subdirectory ./tmp_XY_pipe ! and create new subdirectory ./tmp_XY_pipe ! 0 - stay where we are ! pipeline(3) = name counter for `set_of_frames.prg' on output, ! pipeline(4) = name counter for `set_of_frames.prg' on input, ! so they are static between log/recipe proc in + out ! pipeline(5) = display flag: 0 = we don't have display capabilities ! 1 = we have a display, ! 2 = we have a display linked to niceRBS ! this flag is set via procedure `pipeline.control' ! pipeline(6) = flag for super-recipe (1 = super rec., 0 = normal rec.) ! pipeline(7) = max_time in seconds of current recipe ! pipeline(8) = 1 if DFS_DATA_REDUCED_OLAS env.variable is set, else = 0 ! pipeline(9) = 1 for DFS_PIPE_ALLPRODUCTS env.variable = NO, else = 0 ! pipeline(10) = -1 or unit of connected display Midas (if we have one) ! pipeline(11) = Product_Overwrite_flag, 1 = Yes, 0 = No ! pipeline(12) = if = 1, RBs are executed inside Midas, else via RBS ! write/keyw pipeline_disp/c/1/20 none !to hold display from niceRBS !version of DO, RBS, DIC-PRO, Instrument_pipeline, each with 10 chars write/keyw pipeline_vers/c*32/1/4 " " all ! ! find out if we are running inside Midas (context RBS) show/context rbs >Null if outputi(5) .gt. 0 then pipeline(12) = 1 pipeline_vers(1) = "DO-0_0 " pipeline_vers(2) = "RBS-0_0 " pipeline_vers(3) = "PRO-0.0 " ! ! get the current version of DO, RBS and ! else define/local fc/i/1/3 0,0,0 $\rm -f $MID_WORK/do.version $ pilDataOrganizer -V >$MID_WORK/do.version open/file MID_WORK:do.version read fc if fc(1) .lt. 0 then pipeline_vers(1) = "DO-0_00 " goto next_a endif pipeline_vers(1) = "DO-0_0 " ! write/keyw out_b " " all read/file {fc(1)} out_b 60 if fc(2) .gt. 1 then fc(3) = m$index(out_b,"DO-") if fc(3) .gt. 0 pipeline_vers(1) = out_b({fc(3)}:) endif close/file {fc(1)} ! next_a: $\rm -f $MID_WORK/rbs.version $ pilScheduler -v >$MID_WORK/rbs.version open/file MID_WORK:rbs.version read fc if fc(1) .lt. 0 then pipeline_vers(2) = "RBS-0.00 " goto next_b endif ! write/keyw out_b " " all read/file {fc(1)} out_b 60 close/file {fc(1)} ! if out_b(1:3) .ne. "RBS" then pipeline_vers(2) = "RBS-0.0" else pipeline_vers(2) = out_b endif ! next_b: $\rm -f $MID_WORK/pro.version $cp $INS_ROOT/SYSTEM/Dictionary/ESO-VLT-DIC.PRO $MID_WORK/pro.version open/file MID_WORK:pro.version read fc if fc(1) .lt. 0 then pipeline_vers(3) = "PRO-0.00 " goto next_c endif pipeline_vers(3) = "PRO-0.0 " ! read_loop: write/keyw out_b " " all read/file {fc(1)} out_b 80 if fc(2) .lt. 0 goto pro_eof ! if out_b(1:9) .eq. "Revision:" then write/keyw inputc {out_b(10:)} !move string to begin of keyw. pipeline_vers(3) = "PRO-"//inputc endif goto read_loop pro_eof: close/file {fc(1)} endif ! next_c: write/out Pipeline will use: write/out " DO version:" {pipeline_vers(1)} write/out " RBS version:" {pipeline_vers(2)} write/out " DIC PRO version:" {pipeline_vers(3)} ! write/keyw pipeline_aux/i/1/8 2,0,80,2,0,0,0,0 !auxiliary flags ! pipeline_aux(1) = X-color for labels (default = 2 (white)) ! pipeline_aux(2) = font no. for labels (default = 0) ! pipeline_aux(3) = display size (as percent) ! pipeline_aux(4) = color of send/message ! pipeline_aux(5-8) = spares ! write/keyword rbname/c/1/120 " " all !name of RB definition file write/keyword rbinstrument/c/1/20 " " all !instrument of RB ! write/keyword recqualm/c/1/100 " " all !to hold the quality message write/keyword recquali/i/1/1 0 !the recipe quality status ! 0 = all o.k., else not o.k. write/keyword longlog/c/1/120 " " all !long log file form pipeline write/keyw base_name/c/1/128 " " all ! ! overwrite definition of command LOG/RECIPE ! set/midas user=exp show/context RBS !test, if we're called within context RBS if outputi(5) .eq. 0 then inputc = "NoDisplay" else inputc = p1 !in context RBS we're always called with P1 endif clear/cont -all set/midas commands=350,800 create/comm log/recipe @d recipe_log create/comm load/image @d pipeload !overwrite command create/comm send/message @d sendmess set/midas user=user ! @d pipeline.control {inputc} !default is No Display log(12) = -1 !so >Null doesn't log ! @d save_log init !init log date ! inputc = m$symbol("DFS_DATA_REDUCED_OLAS") !test, if var. is set if inputc(1:4) .ne. "DFS_" pipeline(8) = 1 !Yes. inputc = m$symbol("DFS_PIPE_ALLPRODUCTS") !test, if NO if inputc(1:1) .eq. "N" pipeline(9) = 1 !Yes.