!------------------------------------------------------------------------ ! P_MAP.NIC (in analogy to P_LMV.GRAPHIC by R.Lucas) ! ! &1 = input file ! ! General Procedure to plot multiple contour maps of spectral line images ! Options: ! CONTOUR do/not draw contours ! BITMAP do/not plot bitmap ! PLOTBEAM do/not insert the beam ! ! Global variables defined in DEFINE.GRAPHIC ! ! Calls ! P_LOAD.NIC (to load images) ! P_HEADER.NIC (to plot header information) ! P_LEVELS.NIC (to compute automatic contour levels) ! P_SCALE.NIC (to compute scaling for bitmaps) ! P_BEAM.NIC (to plot the clean beam, if any) ! !------------------------------------------------------------------------ set plot land def real x2 dx y2 aamin aamax def double xmark ratio def integer m n n1 n2 nmap num f_first l_last save_last save_first def character var_ante*3 var_hea*3 test*25 scan_name*30 save_name*30 def character save_scan_list*1000 ! let execute "map" let aspect 0 let test "r&1" let save_name 'name' if (test.eq."r") then let test "r"'NAME' if (test.eq."r") then if (.not.exist(signal)) then say "Use first SIGNAL or specify filename" return endif if (scan.lt.0) then return else 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 save_name 'name' endif endif else let name &1 sic search 'name'.'type' let save_name 'name' if (.not.sic$exist) then let name 0'name' sic search 'name'.'type' if (.not.sic$exist) then let name 0'name' sic search 'name'.'type' if (.not.sic$exist) then let name 'save_name' say "File "'NAME'"."'TYPE'" does not exist" return endif endif say "Filename selected is: "'name'"."'type' endif endif if (type.eq."onf".or.type.eq."ONF") then sic search 'name'.'type' if (.not.sic$exist) then say "File "'NAME'"."'TYPE'" does not exist" let name 'save_name' return endif let save_scan_list 'scan_list' let scan_list " " @ onoff_map let name 'save_name' let scan_list 'save_scan_list' return endif ! let save_last last let save_first first if (plotweight.eq..false..and.(type.eq."cnv".or.type.eq."CNV")) then let f_first first let l_last last let first 1 let last 1 endif if (plotweight.eq..true..and.(type.eq."cnv".or.type.eq."CNV").and.last.eq.1) then let last 2 endif ! on error return @ p_load.nic aaa ! load image & compute extrema if needed @ p_level.nic aaa ! compute levels @ p_scale.nic aaa ! compute scaling ! @ p_header.nic 'AAA%SOURCE' 'NAME' ! draw header if do_color then @ p_color.nic ! setup nice colour table endif ! rgdata aaa /variable if size.eq.0 then limits /rg else if (size.gt.0) then limits size|2 -size|2 -size|2 size|2 seconds endif if (aspect.eq.0) then let ratio abs((user_xmax-user_xmin)|(user_ymax-user_ymin)) else let ratio aspect endif let box_aspect ratio tick 0 0 0 0 ! let x2 box_xmax let y2 box_ymax if (first.le.0) then let n1 1 else let n1 min(first,aaa%dim[3]) endif if (last.eq.0) then let n2 aaa%dim[3] else let n2 min(last,aaa%dim[3]) endif let num n2-n1+1 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 set expand max(2.0|(m+n),.6) let nmap n2-n1+1 let dx (x2-box_xmin)|n|ratio let dx min((y2-box_ymin)|m,dx) ! define integer k istep if (step.lt.0) then let istep -1 let k n2+1 else let istep 1 let k n1-1 endif ! let scan_name 'scan' if (scan.lt.1000) then let scan_name '0''scan_name' if (scan.lt.100) then let scan_name '0''scan_name' if (scan.lt.10) then let scan_name '0''scan_name' endif endif endif if (do_support.and.scan_name.ne.name.and.exist(support_cnv)) then say "W-SUPPORT, Support not defined for this scan / image" endif ! 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+istep if ((k.gt.num+n1-1)) then set expand 1.0 let last save_last return endif if (aaa%ndim.le.2) then rgdata aaa /variable else if (aaa%ndim.eq.3) then rgdata aaa[k] /variable else rgdata aaa[k,1] /variable endif if (plotweight.and.((type.eq."CNV".or.type.eq."cnv").and.k.eq.2)) then plot endif if (bitmap.and..not.((type.eq."CNV".or.type.eq."cnv").and.k.eq.2)) then plot /scaling linear true_scale[1] true_scale[2] endif if (contour) then if ((levels.eq."PER".or.levels.eq."per").and.spacing.eq.-1) then rgmap quiet /per 1.0 let true_spacing 0 else rgmap quiet /abs 1.0 endif endif if (cross.ne.0) then set coord user dra relo 0 cross*sec dra line 0 -cross*sec dra relo cross*sec 0 dra line -cross*sec 0 endif if (plotbeam) then let var_ante 'exist(beam_az)' if (var_ante.eq."NO") then var ante endif if (beam_az.ne.0) then @ p_beam.nic endif if (var_ante.eq."NO") then var ante off endif endif if i.eq.1.and.(k+n.gt.n2) then if (type.eq."CNV".or.type.eq."cnv") then if (axis.eq."ABS".or.axis.eq."abs") then box /abs var hea label "RIGHT ASCENSION ("'AAA%EPOCH'")" /x label "DECLINATION" /y if (var_hea.eq."NO") then var hea off endif else if (axis.eq."REL".or.axis.eq."rel") then box /uni sec label "\GD\Ga (arcsec)" /x label "\GD\Gd (arcsec)" /y endif else box /uni sec label "\GDAz (arcsec)" /x label "\GDEl (arcsec)" /y endif else box n n /uni sec endif set coord box if (type.ne."CNV".and.type.ne."cnv") then dra text 0.1 -0.1 "CH"'K' 3 /box 7 else if (plot_gain.eq..true.) then pen 0 /col 1 define real level compute level max aaa[2] levels .5*level to .9*level by .1*level rgdata aaa[2] /var rgmap q /abs del /var level pen /col 0 rgdata aaa[1] /var endif endif if (do_support.and.scan_name.eq.name) then if (type.eq."EKH".or.type.eq."ekh".or.type.eq."SAA".or.type.eq."saa") then if (exist(support_ekh)) then def real xsup /like support_ekh let xsup support_ekh*pi|3600|180 poly xsup[k] /var /plot del /var xsup endif else if (type.eq."MDB".or.type.eq."mdb") then if (exist(support_mdb)) then def real xsup /like support_mdb let xsup support_mdb*pi|3600|180 poly xsup[k] /var /plot del /var xsup endif else if (type.eq."CNV".or.type.eq."cnv") then if (exist(support_cnv)) then def real xsup /like support_cnv let xsup support_cnv*pi|3600|180 poly xsup /var /plot del /var xsup endif endif endif next next if (plotweight.eq..false..and.(type.eq."CNV".or.type.eq."cnv")) then let first f_first let last l_last endif set expand 1.0 let last save_last let first save_first