;+ ; NAME: ; map_noaa ; ; PURPOSE: ; map a NOAA polar orbiter satellite image (5 channel packed-GAC or ; single channel LAC) from the ; NOAA satellite active archive ; The program now uses imagemap.pro by Hermann Mannstein and ; Liam Gumley to map the image. ; ; CATEGORY: ; NOAA satellite image processing ; ; CALLING SEQUENCE: ; map_noaa,filename=filename,sat_image=sat_image,channel=channel,info=info,$ ; limit=limit,p0lat=p0lat,p0lon=p0lon,title=title,_extra=e,$ ; pixrange=pixrange,colrange=colrange,position=position,/lowres,$ ; missing=missing,temp=temp,/get_temp,/nzzstyle,/nomap,/fillcont ; EXAMPLE: ; map_noaa,filename='/home/dominik/idl/dataexamples/G14_95072818_058',$ ; channel=4,limit=[20,-100,70,-60] ; INPUTS: ; ; OPTIONAL INPUT PARAMETERS: ; a) Parameter for satellite image ; Pass either ; filename: (STRING or STRARR) the filename(s) of the GAC- or LAC-image(s) ; or ; sat_image: the NOAA satellite image structure read with load_noaa. ; Important: sat_image can be used either as OUTPUT or as INPUT parameter. ; It is used as OUTPUT, if the parameter filename is provided. ; Otherwise it can be used as INPUT parameter to pass the NOAA-image ; to the mapping routine. ; info: A structure returned by load_noaa with useful image information ; (info is an OUTPUT PARAMETER if map_noaa is called with filename). ; channel: (integer) The channel number 1,2:VIS, 3:VIS/IR, 4,5:IR ; The program asks for the channel number if not provided. ; pixrange (FltArr(2)) Image pixel values less or equal pixrange[0] ; will be set to the minimum color index and values greater or equal ; to pixrange[1] to the maximum color index. ; colrange (BytArr(2)) The color range [colmin,colmax] used to plot the ; image. Default is [1B,!d.table_size-1B]. ; ; b) Parameters for map and plotting ; limit: the domain, intarr(4) ; [lats,lonw,latn,lone] ; title: map title (if not provided, a default title is created) ; Set title='' if not title should be printed ; _extra: all parameters accepted by map_set-procedure can be provided to map_noaa ; ; p0lat: The latitude of the point on the earth's surface at the center ; of the projection plane (see map_set for details) ; p0lon: Same as p0lat, but longitude. ; position: Normalized coordinates for map display window [X1,Y1,X2,Y2] ; (default is to let MAP_SET determine the window size) ; This is useful when used in conjunction with the ; ESRG BOXPOS procedure. For example, ; IMAGEMAP, IMAGE, LAT, LON, POS = BOXPOS( /RMARG ) ; will leave room at the right for a COLOR_KEY colorbar ; missing: The color index for missing points (0-255). Default is 0. ; ; KEYWORD INPUT PARAMETERS: ; lowres: set this keyword to interpolate missing points (useful with GAC) ; nzzstyle: if set, the continental outlines are plotted in white (thick) and ; black (thin) lines ; nomap: if set, no new map projection is created. The image is plotted over an ; existing projection ; get_temp: to read the brightness temperatures for an IR channel (3,4, or 5) ; the brightness temperatures will be returned in "temp" ; fillcont: If set, the upper half of the color indices range will be ; used for pixels over land and the lower half for pixels ; over sea. ; ; OUTPUTS: ; sat_image: Array(scansize,no_of_scans) of PIXEL_STRUCT: the NOAA-image ; (IMPORTANT:sat_image can only be used as OUTPUT parameter if the ; parameter filename is provided) ; info: A structure containing useful information about the image (like ; sat_image this info is only used as OUTPUT parameter, if filename ; if provided in the call to map_noaa). ; temp: FltArr(scansice,no_of_scans) the brightness temperatures. Set the ; keyword "get_temp" in order to return the brigthness temperatures ; of an IR channel in this parameter. ; ; COMMON BLOCKS: ; ; SIDE EFFECTS: ; ; RESTRICTIONS: ; ; PROCEDURE: ; ; MODIFICATION HISTORY: ; Dominik Brunner, 1997 ; (now at KNMI, The Netherlands) ; brunner@knmi.nl or dominik@atmos.umnw.ethz.ch ; Revised: ; Dominik Brunner, KNMI, The Netherlands, 5-AUG 1995 ; map_noaa now uses the much faster imagemap.pro routine for ; mapping ; 08/01/2001, Dominik Brunner, adapted to support new KLM-series ;- PRO map_noaa,filename=filename,sat_image=sat_image,channel=channel,info=info,$ limit=limit,p0lat=p0lat,p0lon=p0lon,title=title,_extra=e,missing=missing,$ pixrange=pixrange,colrange=colrange,lowres=lowres,temp=temp,$ position=position,get_temp=get_temp,nzzstyle=nzzstyle,nomap=nomap,$ fillcont=fillcont,klm=klm ON_ERROR,2 ;******************************************************************** ; check for input parameters ;******************************************************************** IF keyword_set(get_temp) AND (n_elements(filename) EQ 0) THEN BEGIN print,"You must provide the filename if you'd like to calculate the" print,'brightness temperatures for a NOAA image!!!' return ENDIF if n_elements(filename) EQ 0 THEN BEGIN if n_elements(sat_image) eq 0 then begin load_noaa,image=sat_image,channel=channel,info=info,$ temp=temp,get_temp=get_temp,klm=klm endif IF n_elements(sat_image) EQ 0 THEN return filename='none' endif ; get the channel number from info.channel if image is not read from a file IF (n_elements(info) NE 0) AND (filename[0] EQ 'none') THEN channel=info.channel if (n_elements(channel) eq 0) then BEGIN print,'' IF filename[0] EQ 'none' THEN print,'Channel of current image unknown!' print,'Select one of the following channels:' print,'1: VIS' print,'2: VIS' print,'3: channel 3 , intermediate channel' print,'4: IR' print,'5: IR' read,'Enter channel number: ',channel ENDIF if n_elements(z_value) EQ 0 then z_value=-0.001 ; loop over the filenames and plot them nfiles=n_elements(filename) FOR i=0,nfiles-1 DO BEGIN ; load the image IF filename[i] NE 'none' THEN BEGIN ; check if file exists otherwise return IF NOT file_exists(filename[i]) THEN BEGIN print,'Error! File ',filename[i],' does not exist' return ENDIF load_noaa,filename[i],channel=channel,image=sat_image,info=info,$ temp=temp,get_temp=get_temp,klm=klm ENDIF ELSE BEGIN ; check if data set is new KLM or old (new KLM uses LongInt for ; earth positions IF n_elements(sat_image) EQ 0 THEN BEGIN print,'no image defined - returning' return ENDIF klm= size(sat_image[0].earth_pos[0],/type) EQ 3 ENDELSE ; create a map title (set title='' for no title) if n_elements(title) eq 0 then begin if n_elements(info) ne 0 then begin dtg=hiptime2dtg(idate2hiptime(info.scan_start)) year=strmid(dtg,0,4) month=strmid(dtg,4,2) day=strmid(dtg,6,2) hour=strmid(dtg,8,2) minu=strmid(dtg,10,2) sec=strmid(dtg,12,2) title='NOAA-'+STRING(info.spacecraft_id,format='(i2)')+' image from '+$ day+'/'+month+'/'+year+' '+hour+':'+minu+' UTC, channel'+$; minute strcompress(string(format='(1I)',info.channel)) endif else title='NOAA POLAR ORBITER IMAGE' title=title[0] endif ; plot the image IF i GT 0 THEN nomap=1 ELSE nomap=0 IF i LT (nfiles-1) THEN BEGIN noplot=1 & noborder=1 ENDIF ELSE BEGIN noplot=0 & noborder=0 ENDELSE ; determine the pixel value range IF n_elements(pixrange) NE 2 THEN BEGIN imin=min( sat_image.value, max = imax ) pixrange=[imin,imax] ENDIF IF klm THEN scale=10000. ELSE scale=128. imagemap,sat_image.value,sat_image.earth_pos[0]/scale,$ sat_image.earth_pos[1]/scale,newimage=newimage,$ pixrange=pixrange,colrange=colrange,limit=limit,p0lat=p0lat,$ p0lon=p0lon,_extra=e,title=title,lowres=lowres,missing=missing,$ nomap=nomap,noplot=noplot,noborder=noborder,position=position,$ fillcont=(keyword_set(fillcont) AND NOT noplot) ENDFOR end