On May 1, 11:51 am, edhanna2...@gmail.com wrote:
> Hi,
>
> When using the IDL code below or similar (which uses one of the built-
> in colour tables to display a range of data), does anyone have any
> idea how I can force a particular value (e.g. -999 = nodata) to be NOT
> plotted in the image, e.g. ocean/land area surrounding Greenland Ice
> Sheet in this instance? At the moment it's plotting the image fine
> except that it's colouring parts of the grid (nodata) that I don't
> want it to, which makes my results less clear than they should be.
>
> Many thanks,
>
> Edward
>
> pro icedh2
>
> ;common colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr
> loadct,33,bottom=0
> ;tvlct, r_orig, g_orig, b_orig
> set_plot,'ps', /int
>
> device, /portrait, bits=8, xoffset=1, yoffset=1.75, xsize=6, ysize=7,$
> /inches, /color,$
>
> filename='/home/gg1eh/era40/runoff/
> runoffmon_dh1995to2005_base19772006.ps'
>
> openu,1,'/home/gg1eh/era40/runoff/runoffmon_dh1995to2005_bas e19772006'
>
> ;device,/close
>
> nx=329L
> ny=561L
> h1=fltarr(nx,ny)
> readu,1,h1
> ;print,h1
> ;byteorder,h1, /FTOXDR
> close,1
>
> map_set,71,-44,/stereographic,limit=[58,-60,82,-20],$
> title= 'GrIS annual dH/dt: 1995-2005 (base 1977-2006)',$
>
> position=[0,0,1,1],/grid,/noerase
>
> data = bytscl(h1,min=-1.0,max=0.5,top=255)
>
> lats=fltarr(nx,ny)
> lons=fltarr(nx,ny)
> pi=3.141592654
> for iy = 0 , ny-1 do begin
> for ix = 0 , nx-1 do begin
> ;print,ix,iy,data
> i=((ix+1)-149.0)*5000.0;
> j=((iy+1)-681.0)*5000.0;
> a=2*atan(sqrt((i*i)+(j*j))/(2*6371221*0.9728));
> ;print,i,j,a
> lats[ix,iy]=asin(cos(a))*(180.0/pi);
> lons[ix,iy]=atan(i/(-j))*(180.0/pi)-44.0;
> ;print,lons[ix,iy],lats[ix,iy]
> ;stop
> endfor
> endfor
> print,'gothere22'
>
> data=reform(data,nx*ny)
> lats=reform(lats,nx*ny)
> lons=reform(lons,nx*ny)
> print,'gothere23'
>
> data =
> map_patch(data,lons,lats,xstart=xs,ystart=ys,xsize=xsize,ysi ze=ysize,$
> triangulate=1,missing=0)
>
> tv, data, xs, ys, xsize=xsize, ysize=ysize
> map_grid,latdel=5,londel=10,/label
> map_continents
> border = intarr(2,2)
> contour, border,
> position=[0,0,1,1],xticks=1,yticks=1,xstyle=1,ystyle=1, $
> XCharsize=0.001,YCharsize=0.001, /nodata, /noerase
> print,'gothere24'
>
> levs=(findgen(11)*0.15-1.0)
> levs2=fltarr(11,2)
> levs2(*,0)=levs(*)
> levs2(*,1)=levs(*)
> cl=findgen(11)*25.599
> contour,levs2,levs,[0,1],/
> cell_fill,levels=levs,position=[0.2,0.0,0.7,0.05],$
> /noerase,xticks=1,yticks=1,xstyle=1,ystyle=1, XCharsize=1.25,
> YCharsize=0.001,$
> c_colors=cl, xtitle = 'dH/dt (m/yr)'
>
> print,'gothere25'
> device,/close
> set_plot,'X'
>
> print,'gothere26'
> end
a clever use if "where()" comes to mind...
|