!---------------------------------------------------------------------- ! PR:P_SIGNAL.NIC ! Input file for GO SIGNAL ! Check for parameter &1 = read scan &1 ! R.Neri 9-Nov-1994 !---------------------------------------------------------------------- define character var_cali*3 var_data*3 var_flag*3 var_header*3 var_ante*3 define character xtext*20 ytext*20 file*5 text*20 wobbler*3 var_tele*3 define integer irecord ireceivers nx ny define integer m n k l nf nl num nxf nyf ns p define real posx1 posx2 posy define double ratio x2 y2 dx ! let command "SIGNAL" let execute "signal" let change_aspect .false. if (aspect.eq.0) then let change_aspect .true. let aspect 2 endif ! ! let var_flag 'exist(opacity_flag)' ! let var_cali 'exist(counts_per_jy)' ! let var_data 'exist(signal)' ! let var_header 'exist(date_observ)' ! let var_ante 'exist(wobbler_throw)' ! let file "s&1" if (file.ne."s") then file in bolo_data:&1 if (scan.lt.0) then say "Current input directory is :" sic log bolo_data: return endif if (nsubscan.eq.0) then say " This scan contains no data..." return endif ! set gain_amplifier on ! set gain_channel on var header on let restore_mask no let saa_mask no let restore_filter yes endif set blanking -99999.5 1 if (.not.exist(signal)) then say "No input file opened" return endif ! var * if (scan_type.ne.3.and.file.ne."s") then if (do_check) then check endif endif ! ! lst correction if lst[first] > lst[last] ! if (lst[1].gt.lst[nrecord]) then var dat wr let lst lst+86400 /where lst.le.lst[nrecord] ! var dat re endif ! !var ante let var_tele 'telescope' if (file.ne."s") then let wobbler 'exist(wobbler_throw)' if (wobbler.ne."NO") then let beamsep wobbler_throw-NINT(VAZM*60*WOBBLER_PERIOD|2*1000)|1000 if (var_tele.eq."CSO") then let beamsep wobbler_throw endif else let beamsep 0 endif endif if (file.ne."s") then let unbal 1 let zigzag -1*vazm*15 ! apparently required for Pico Veleta defin char simul*10 let simul 'source' if (simul.eq."simulation") then let zigzag 0 endif if (scan_type.eq.2) then let map_cell sint let radec_cell sint endif if (scan_type.ne.1) then let scan_list "" endif ! Specific for CSO if (var_tele.eq."CSO") then let zigzag 0 let unbal -1 let map_cell sint let radec_cell sint endif ! Specific for HHT if (var_tele.eq."HHT") then let zigzag 0 let map_cell sint let radec_cell sint endif endif ! !var header let name 'SCAN' if (scan.lt.10) then let name "000"'SCAN' else if (scan.lt.100) then let name "00"'SCAN' else if (scan.lt.1000) then let name "0"'SCAN' endif let irecord nrecord let ireceivers nchan if (irecord.eq.0) then return endif if (.not.exist(lst)) then return endif !var data !var cali !var flag ! let do_fit yes ! if (last.gt.ireceivers) then let last ireceivers endif if (first.ne.0.and.last.eq.0) then let last first endif if (first.gt.last) then let ns first let first last let last ns endif let nf first let nl last if (first.eq.0) then let nf 1 endif if (last.eq.0) then let nl ireceivers endif let num nl-nf+1 if (first.eq.0.and.last.eq.0) then let num ireceivers endif ! let nx 1 let nxf 1 if (xtype.eq."LST") then define real xaxis[irecord] let xaxis lst let text "vs Sec" let xtext "\GD LST (sec)" else if (xtype.eq."AZ") define real xaxis[irecord] let xaxis az let text "vs degrees" let xtext "Azimuth" else if (xtype.eq."EL") define real xaxis[irecord] let xaxis el let text "vs degrees" let xtext "Elevation" else if (xtype.eq."SIGNAL") define real xaxis[irecord,ireceivers] let xaxis signal let nx num let nxf 2 let text "vs Counts" let xtext "Counts" if (counts_per_jy.ne.0.and.scan_type.ne.3) then let text "vs Jy" let xtext "Jy" endif endif let ny 1 let nyf 1 let ytype 'ytype' /upper if (ytype.eq."LST") then define real yaxis[irecord] let yaxis lst let text "Sec "'TEXT' let ytext "\GD LST (sec)" else if (ytype.eq."AZ") define real yaxis[irecord] let yaxis az let text "degrees "'TEXT' let ytext "Azimuth" else if (ytype.eq."EL") define real yaxis[irecord] let yaxis el let text "degrees "'TEXT' let ytext "Elevation" else if (ytype.eq."SIGNAL") define real yaxis[irecord,ireceivers] let yaxis signal let ny num let nyf 2 if (counts_per_jy.ne.0.and.jansky_flag.eq..true..and.scan_type.ne.3) then let text "Jy "'TEXT' let ytext "Jy" else let text "Counts "'TEXT' let ytext "Counts" endif endif ! set plot land ! if (scan_type.eq.1) then if (sic$window.and.file.ne."s") then @ x_onf.nic endif else if (scan_type.eq.2.and.sic$window.and.file.ne."s") then @ x_otf.nic else if (scan_type.ge.3.and.sic$window.and.file.ne."s") then gui\panel "None" None gui\go endif ! @ p_header 'TEXT' ! if (limits.eq." ") then if (nxf.eq.1.and.nyf.eq.1) then lim /var xaxis yaxis else if (nxf.ne.1.and.nyf.eq.1) then lim /var xaxis[1] yaxis for i nf to nl lim = = < > /var xaxis[i] yaxis next else if (nxf.eq.1.and.nyf.ne.1) then lim /var xaxis yaxis[1] for i nf to nl if chan_flag[i].eq..false. then lim = = < > /var xaxis yaxis[i] endif next else if (nxf.ne.1.and.nyf.ne.1) then lim /var xaxis[1] yaxis[1] for i nf to nl for j nf to nl if chan_flag[i].eq..false. then lim = = < > /var xaxis[i] yaxis[j] endif next next endif else symbol alimits 'LIMITS' lim 'ALIMITS' endif ! if (scan_type.eq.2) then let type mdb else if (scan_type.eq.1) then let type onf endif ! let x2 box_xmax let y2 box_ymax let num nx*ny let n int(sqrt(num+1)) if (n**2.lt.num) then let n n+1 endif if (aspect.ne.0) then let ratio aspect else let ratio 0 endif if ratio.gt.1d0 then ! m > n let m int(sqrt((num)*ratio+1)) let n nint(m|ratio) if (m*n.lt.(num)) then let m m+1 if (m*n.lt.(num)) then let n n+1 endif endif else let n int(sqrt((num)|ratio+1)) let m nint(n*ratio) if (m*n.lt.(num)) then let n n+1 if (m*n.lt.(num)) then let m m+1 endif endif endif let dx (x2-box_xmin)|n|ratio let dx min((y2-box_ymin)|m,dx) set expand max(1|sqrt(x2|dx|ratio),.5) let posx1 (user_xmax-user_xmin)*.95+user_xmin let posx2 (user_xmax-user_xmin)*.05+user_xmin let posy (user_ymax-user_ymin)*.9+user_ymin tick 0 0 0 0 let k nf-1 let l nf let p 1 let q int(num|n) /new int if (q*n.ne.num) then let q q+1 endif if exist(boxes) then del /var boxes endif ! define real boxes[5,num] /global for j 1 to m for i 1 to n g\set box x2+(i-n-1)*dx*ratio x2+(i-n)*dx*ratio y2-j*dx y2+(1-j)*dx let k k+1 if (p.le.num) then let boxes[1,p] k let boxes[2,p] x2+(i-n-1)*dx*ratio let boxes[3,p] x2+(i-n)*dx*ratio let boxes[4,p] y2-j*dx let boxes[5,p] y2+(1-j)*dx let p p+1 endif if ((k.gt.nl).or.(l.gt.nl)) then g\set expand 1.0 ! if (var_cali.eq."NO") then ! var cali off ! endif ! if (var_flag.eq."NO") then ! var flag off ! endif ! if (var_data.eq."NO") then ! var data off ! endif if (change_aspect) then let aspect 0 endif return else if (i.eq.1.and.j.eq.q) then box label 'xtext' /x label 'ytext' /y else box n n endif if (nxf.eq.1.or.nyf.eq.1) then draw text posx1 posy "CH"'K' 4 /user endif if (chan_flag[k]) then pen 0 /col 1 draw text posx2 posy "FLAGGED" 6 /user pen 0 /col 0 endif if (nxf.eq.1.and.nyf.eq.1) then conn xaxis yaxis else if (nxf.eq.1.and.nyf.ne.1) then conn xaxis yaxis[k] else if (nxf.ne.1.and.nyf.eq.1) then conn xaxis[k] yaxis else if (nxf.ne.1.and.nyf.ne.1) then conn xaxis[k] yaxis[l] if (k.eq.nl) then let k nf-1 let l l+1 endif endif if (scan_type.eq.1.and.plot_level.and..not.chan_flag[k]) then @ subscan_mean 'k' endif g\set coord box endif next next ! ! if (var_cali.eq."NO") then ! var cali off ! endif ! if (var_data.eq."NO") then ! var data off ! endif ! if (var_flag.eq."NO") then ! var flag off ! endif if (change_aspect) then let aspect 0 endif