pro read_icesat_icethk, season,npoints,lat,lon,x,y,thick ; ; This routine reads the ice thickness (cm) fields on the Icesat data webpage: ; ; Input: season = 4-character string describing Icesat campaign time period ; (e.g. 'on03' to 'on08','fm03' to 'fm06 & 'fm08' but 'ma07') ; ; Output: npoints = number of valid ice thickness grid points ; lat = latitude ; lon = longitude ; x = SSMI x-location (km) ; y = SSMI y-location (km) ; thick = ice thickness (cm) ; ; Added: Plot window, Save plot and generate legend, Stefan Kern, Sep. 9 2010 !order = 1 loadct,39 tvlct,r,g,b,/get npoints=0 & llat=0. & llon=0. & xx=0. & yy=0. & tt=0. openr,unitr,'icesat_icethk_'+season+'.dat',/get_lun readf,unitr,npoints lat = fltarr(npoints) lon = fltarr(npoints) x = fltarr(npoints) y = fltarr(npoints) thick = fltarr(npoints) for i=0,npoints-1 do begin readf,unitr,llat,llon,xx,yy,tt lat(i) = llat lon(i) = llon x(i) = xx y(i) = yy thick(i) = tt endfor free_lun,unitr window,0,xsize=400,ysize=400,retain=2 map_set,90,0,0,/stereographic,scale=60E6,/continents,/hires,/isotropic,xmargin=0.0,ymargin=0.0 plots,lon,lat,color=bytscl(0.01*thick,min=0.0,max=6.0,top=254),psym=2 map_continents,/hires xyouts,0.8,0.88,/normal,charsize=2.5,charthick=2.5,color=255,'!3'+season+'!5' image=TVRD(/true) WRITE_TIFF,'icesat_icethk_'+season+'.tiff',image,red=r,green=g,blue=b,xresol=300,yresol=300 set_plot,'ps' device,file='legend_ICESat_IceThicknessArctic.ps',xsize=16,ysize=4,xoffset=3,yoffset=10,color=1,bits_per_pixel=8 plot_legend_neu,0.1,0.43,0.9,0.57,0,6,'Ice Thickness [m]',6,2.5,'h',1,'n',0,0,254 device,/close_file set_plot,'x' stop end ; This is an old Routine to plot a color-legend bar as postscript file into the working directory (written at IUP, Bremen, Germany) ;---------------------------------------------------------------------------- PRO PLOT_LEGEND_NEU,$ x0,y0,x1,y1,min,max,title,ticks,csize,dir_flag,art,col_flag,colors,von,bis ;+ ; arguments : x0,y0,x1,y1 Plot-Koordinaten (0.0 <= x0|y0|x1|y1 <=1.0) ; min, max min,max Werte der Legendenbeschriftung ; title Legendentitel ; ticks ticks ; art Art der Tickmarks: mittig oder an Farbgrenzen ; 1 = an Farbgrenzen ist Default ; csize charsize der Legende, 1.0 = default ; dir_flag Plot-Ausrichtung : 'h' = horizontal ; 'v' = vertikal ; col_flag Farbtabelle? 'y'/'n' ; colors uebergebene Farbtabelle ; von erster Farbwert in der Legende (>= 0) ; bis letzter Farbwert in der Legende (<= 255) ;---------------------------------------------------------------------------- ; purpose : device-unabhaengige Procedure zum Darstellen einer Legende ; author : th (als plot_legend.pro) ; modified by : sk ; last edit : 16.04.94 ; last modified : 15.10.98 ;---------------------------------------------------------------------------- ;- !P.charthick = 2.5 !P.THICK=2 IF (dir_flag EQ 'h') THEN BEGIN ; Matrix mit color table IF (col_flag EQ 'n') THEN BEGIN colors = BYTARR(bis-von+1,10) ; erzeugen ohne +1 FOR i=von,bis DO BEGIN ;-1 FOR j=0,9 DO BEGIN colors(i-von,j) = i ; + 1 ENDFOR ENDFOR ENDIF ELSE ticks = bis ; IF (!d.name eq 'PS') THEN BEGIN TV, colors, x0, y0, XSIZE = x1-x0, YSIZE = y1-y0, /NORM ENDIF ELSE BEGIN px = FLTARR(2) ; falls keine scalable Pixel py = FLTARR(2) ; Farbtabelle interpolieren px(0) = x0 * !d.x_vsize ; px(1) = x1 * !d.x_vsize py(0) = y0 * !d.y_vsize py(1) = y1 * !d.y_vsize sx = px(1)-px(0)+1 sy = py(1)-py(0)+1 sz = SIZE(colors) TV,POLY_2D(colors,[[0,0],[sz(1)/sx,0]],[[0,sz(2)/sy],[0,0]], $ 0,sx, sy) , px(0), py(0) ENDELSE ; tmp = !P.POSITION ; alte p.position retten !P.POSITION = [x0,y0,x1,y1] IF (art) THEN range = [min,max] ELSE range = [min,max+1] name = [' ',' '] y = FLTARR(1) x = FLTARR(1) x(0) = 0 y(0) = 0 old_charsize = !P.CHARSIZE ; alte charsize retten !P.CHARSIZE = csize print, 'Farbe richtig gesetzt?' IF (art) THEN $ PLOT, x, y, YRANGE = range, XRANGE = range, TITLE = title, $ /NOERASE, XSTYLE = 1, YSTYLE = 1, XTICKS = ticks, YTICKS = 1, $ YTICKNAME = name,CHARSIZE=csize, COLOR = 0 IF NOT(art) THEN $ PLOT, x, y, XRANGE = range, YRANGE = range, TITLE = title, $ /NOERASE, XSTYLE = 1, XTICKS = ticks, $ XTICKV = [0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5], $ XTICKNAME = ['0', '1', '2', '3', '4', '5', '6', '7', '8'], $ YTICKS=1, YSTYLE=1, YTICKNAME = name, /NODATA,CHARSIZE=csize !P.CHARSIZE = old_charsize ; ; endif else begin ; vertikal plot IF (col_flag EQ 'n') THEN BEGIN ; colors = BYTARR(10,bis-von) ; alte version colors = BYTARR(10,bis-von+1) ; FOR i=0,bis-von-1 DO BEGIN ; alte version FOR i=0,bis-von DO BEGIN FOR j=0, 9 DO BEGIN colors(j,i) = bis - i ENDFOR ENDFOR ENDIF ELSE ticks = bis ; if (!d.name eq 'PS') then begin TV, colors, x0,y0, XSIZE = x1-x0, YSIZE = y1-y0, /NORM endif else begin px = FLTARR(2) ; falls keine scalable Pixels py = FLTARR(2) ; Farbtabelle interpolieren px(0) = x0 * !d.x_vsize ; px(1) = x1 * !d.x_vsize py(0) = y0 * !d.y_vsize py(1) = y1 * !d.y_vsize sx = px(1)-px(0)+1 sy = py(1)-py(0)+1 sz = SIZE(colors) TV,POLY_2D(colors,[[0,0],[sz(1)/sx,0]],[[0,sz(2)/sy],[0,0]], $ 0,sx, sy) , px(0), py(0) endelse ; tmp = !P.POSITION ; alte p.position retten !P.POSITION = [x0,y0,x1,y1] range = [min,max] name = [' ',' '] y = FLTARR(1) x = FLTARR(1) x(0) = 0 y(0) = 0 old_charsize = !P.CHARSIZE ; alte charsize retten old_font = !P.FONT !P.FONT=5 !P.CHARSIZE = csize PLOT, x, y, YRANGE = range, XRANGE = range, YTITLE = title, $ /NOERASE, XSTYLE = 1, YSTYLE = 1, XTICKS = 1, YTICKS = 1, $ XTICKNAME = name,YTICKNAME = name, CHARSIZE=csize, COLOR = 0 AXIS, YAXIS=1, YSTYLE=1, YTICKS=ticks, YRANGE=range, $ CHARSIZE=csize, COLOR = 0 !P.CHARSIZE = old_charsize !P.FONT = old_font endelse ; !P.POSITION = tmp ; Plot-Position reset ; END ; ;----------------------------------------------------------------------