by Jean H <jghasban@[EMAIL PROTECTED]
>
Mar 24, 2008 at 11:11 AM
negra wrote:
> Hello all!
>
> Could anybody help me with spatial subsetting one image by another in
> idl. It's easy in Envi, but I must process a large number of files.
>
> Thanks!
> Gulshat
> *** Sent From/Enviado desde: http://groups.expo.st
***
>
>
Hi,
you can follow these steps in IDL:
get access to ENVI's functions: envi, /restore_base_save_files
envi_batch_init
Open your mask image: ENVI_OPEN_FILE
Get the map information: ENVI_GET_MAP_INFO
Extract the corners coordinates from the map info.
Open your image to subset
get the data of the image to subset: read_binary
change the mask coordinates to the image coordinates (geographical
coords to column/row coordinates): ENVI_CONVERT_FILE_COORDINATES
Now subset the image: sub = image[x[0]:x[1],y[0]:y[1]]
Save the data: ENVI_WRITE_ENVI_FILE (you might want to do a
envi_file_query on the mask image AND on the original image to get the
proper header values)
Jean