PRO SHOWIMAGE, FILE, BAND, $ RANGE=RANGE, MASKFILE=MASKFILE, TEST=TEST, COLORS=COLORS ;- Display a MODIS image and optionally overlay the IMAPP cloudmask ;- Check arguments if (n_params() eq 0) then message, 'Usage: SHOWIMAGE, FILE, BAND' if (n_elements(file) eq 0) then message, 'Argument FILE is undefined' if (n_elements(band) eq 0) then message, 'Argument BAND is undefined' if (n_elements(test) eq 0) then test = [2] if (n_elements(colors) eq 0) then colors = [1] ;- Set unit keywords if (band le 19) or (band eq 26) then begin refl = 1 temp = 0 endif else begin refl = 0 temp = 1 endelse ;- Get the MODIS data modis_level1b_read, file, band, data, refl=refl, temp=temp dims = size(data, /dimensions) nx = dims[0] ny = dims[1] ;- Load the cloudmask if required if (n_elements(maskfile) eq 1) then begin ;- Get the mask data hdfid = hdf_sd_start(maskfile) hdf_sd_varread, hdfid, 'Cloud_Mask', mask hdf_sd_end, hdfid ;- Reorder the mask data mask = transpose(temporary(mask), [2, 0, 1]) endif ;- Set the scaling range for the image if (n_elements(range) ne 2) then range = imclip(data) ;- Create the scaled MODIS image image = bytscl(data, min=range[0], max=range[1], $ top=(!d.table_size - 16 - 1)) + 16B ;- Overlay the cloudmask if required if (n_elements(mask) gt 0) then $ image = mask_image(image, mask, test, colors) ;- Load graphics colors loadcolors loadct, 0, bottom=16, /silent ;- Display the image imdisp, image, order=1, margin=0, bottom=16, /noscale END