!------------------------------------------------------------------------ ! Plot mask (adapted from pro/p_map.nic) ! !------------------------------------------------------------------------ ! ! ! Display mask ! clear plot def real x2 dx y2 aamin aamax def double xmark ratio def integer m n n1 n2 nmap num def character var_ante*3 var_hea*3 test*5 temp_type*5 ! let test "r"&1 if (test.eq."r") then let test "r"'NAME' if (test.eq."r") then if (.not.exist(signal)) then return endif if (scan.lt.0) then return else let name 'SCAN' endif endif else let name &1 endif ! on error return let temp_type 'type' let type mdb @ p_load.nic aaa ! load image & compute extrema if needed ! @ p_header.nic 'AAA%SOURCE' 'NAME' ! draw header if do_color then @ p_color.nic ! setup nice colour table endif ! ! initialize RMASK[,,] from MASK ! def inte nx ny nz let nx aaa%dim[1] let ny aaa%dim[2] let nz aaa%dim[3] def inte ia[nx,ny] def inte ib[nx,ny] def real rmask[nx,ny,nz] ! let ib mask !* def inte i0 i1 for i 1 to nz let i0 2**(i-1) let i1 2**i let ia 0 let ia 1 /WHERE (MOD(IB,i1).EQ.i0) let rmask[i] ia let ib ib-i0*ia next del /var i0 i1 ! rgdata rmask /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 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 return endif if (aaa%ndim.le.2) then rgdata aaa /variable else if (aaa%ndim.eq.3) then rgdata rmask[k] /variable else rgdata aaa[k,1] /variable endif plot /scaling linear -2 2 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 i.eq.1.and.(k+n.gt.n2) then box /uni sec label "\GDAz (arcsec)" /x label "\GDEl (arcsec)" /y else box n n /uni sec endif set coord box next next let type 'temp_type' set expand 1.0