topIMDISP Image display
Parameters
IMAGE
in
required
Keywords
RANGE
BOTTOM
NCOLORS
MARGIN
INTERP
DITHER
ASPECT
POSITION
default: [0.0,0.0,1.0,1.0]
OUT_POS
NOSCALE
NORESIZE
ORDER
USEPOS
CHANNEL
BACKGROUND
ERASE
AXIS
NEGATIVE
Examples
;- Load test data
openr, lun, filepath('ctscan.dat', subdir='examples/data'), /get_lun
ctscan = bytarr(256, 256)
readu, lun, ctscan
free_lun, lun
openr, lun, filepath('hurric.dat', subdir='examples/data'), /get_lun
hurric = bytarr(440, 330)
readu, lun, hurric
free_lun, lun
read_jpeg, filepath('rose.jpg', subdir='examples/data'), rose
help, ctscan, hurric, rose
;- Display single images
!p.multi = 0
loadct, 0
imdisp, hurric, /erase
wait, 3.0
imdisp, rose, /interp, /erase
wait, 3.0
;- Display multiple images without color table splitting
;- (works on 24-bit displays only; top 2 images are garbled on 8-bit displays)
!p.multi = [0, 1, 3, 0, 0]
loadct, 0
imdisp, ctscan, margin=0.02
loadct, 13
imdisp, hurric, margin=0.02
imdisp, rose, margin=0.02
wait, 3.0
;- Display multiple images with color table splitting
;- (works on 8-bit or 24-bit displays)
!p.multi = [0, 1, 3, 0, 0]
loadct, 0, ncolors=64, bottom=0
imdisp, ctscan, margin=0.02, ncolors=64, bottom=0
loadct, 13, ncolors=64, bottom=64
imdisp, hurric, margin=0.02, ncolors=64, bottom=64
imdisp, rose, margin=0.02, ncolors=64, bottom=128
wait, 3.0
;- Display an image at a specific position, over-riding aspect and margin
!p.multi = 0
loadct, 0
imdisp, hurric, position=[0.0, 0.0, 1.0, 0.5], /usepos, /erase
wait, 3.0
;- Display an image with axis overlay
!p.multi = 0
loadct, 0
imdisp, rose, /axis, /erase
wait, 3.0
;- Display an image with contour plot overlay
!p.multi = 0
loadct, 0
imdisp, hurric, out_pos=out_pos, /erase
contour, smooth(hurric, 10, /edge), /noerase, position=out_pos, $
xstyle=1, ystyle=1, levels=findgen(5)*40.0, /follow
wait, 3.0
;- Display a small image with correct resizing
!p.multi = 0
loadct, 0
data = (dist(8))[1:7, 1:7]
imdisp, data, /erase
wait, 3.0
imdisp, data, /interp
wait, 3.0
;- Display a true color image without and with interpolation
!p.multi = 0
imdisp, rose, /erase
wait, 3.0
imdisp, rose, /interp
wait, 3.0
;- Display a true color image as a photographic negative
imdisp, rose, /negative, /erase
wait, 3.0
;- Display a true color image on PostScript output
;- (note that color table is handled automatically)
current_device = !d.name
set_plot, 'PS'
device, /color, bits_per_pixel=8, filename='imdisp_true.ps'
imdisp, rose, /axis, title='PostScript True Color Output'
device, /close
set_plot, current_device
;- Display a pseudo color image on PostScript output
current_device = !d.name
set_plot, 'PS'
device, /color, bits_per_pixel=8, filename='imdisp_pseudo.ps'
loadct, 0
imdisp, hurric, /axis, title='PostScript Pseudo Color Output'
device, /close
set_plot, current_device
;- Display an image where only the offset and size are known
;- Read world elevation data
file = filepath('worldelv.dat', subdir='examples/data')
openr, lun, file, /get_lun
data = bytarr(360, 360)
readu, lun, data
free_lun, lun
;- Reorganize array so it spans 180W to 180E
world = data
world[0:179, *] = data[180:*, *]
world[180:*, *] = data[0:179, *]
;- Create remapped image
map_set, /orthographic, /isotropic, /noborder
remap = map_image(world, x0, y0, xsize, ysize, compress=1)
;- Convert offset and size to position vector
pos = fltarr(4)
pos[0] = x0 / float(!d.x_vsize)
pos[1] = y0 / float(!d.y_vsize)
pos[2] = (x0 + xsize) / float(!d.x_vsize)
pos[3] = (y0 + ysize) / float(!d.y_vsize)
;- Display the image
loadct, 0
imdisp, remap, pos=pos, /usepos
map_continents
map_grid
Version history
Version
$Id: imdisp.pro 136 2006-07-10 15:20:19Z pinsard $
History
Liam.Gumley@ssec.wisc.edu
http://cimss.ssec.wisc.edu/~gumley
Copyright (C) 1999, 2000 Liam E. Gumley
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Known issues
Restrictions
The image is displayed on the current graphics device.
Requires IDL 5.0 or higher (square bracket array syntax).