25 Jul 2012 11:25 AM |
|
I am a student, just getting started with IDL programming, and I am hoping to process a large amount of LANDSAT images with ENVI in a batch mode. By nature of LANDSAT files, they are very large, and take a long time to run through my program which retrieves statistics from the image. I am hoping to resize the image automatically , but am not sure/have been unable to find a command that allows me to do this.
Any suggestions?
I am also having difficulties extracting the data to a .csv file. Any advice ?
|
|
|
|
MariM Veteran Member
Posts:2396  
25 Jul 2012 02:54 PM |
|
Have you looked at ENVI's RESIZE_DOIT routine? This allows you to resize the pixels to be larger, thus making your image smaller. If you only want to process a subset of data, then you can pass in the dimensions you want to process using the DIMS keyword which is present in most ENVI routines.
Then you can output the data to an ascii file using ENVI_OUTPUT_TO_EXTERNAL_FORMAT with the /ASCII keyword. If you specifically want to write to CSV then use IDL's WRITE_CSV routine.
|
|
|
|
Deleted User New Member
Posts:  
25 Jul 2012 03:47 PM |
|
Thank you for your help.
I've played around with the resize tool, but I'm looking more into cropping the image rather than scaling it. Manually, the procedure is located under ENVI's Basic Tools> Resize Data (Spatial/Spectral)>Spatial Subset>Map. Unfortunately, I am unable to find how to get the code for this exact process.
|
|
|
|
Deleted User New Member
Posts:  
25 Jul 2012 03:56 PM |
|
As mentioned above, when using ENVI routines, you specify a spatial subset using the DIMS keyword. You should find a DIMS keyword for most ENVI routines. If you don't plan to do any further processing in your program, then you could do something like open the original ENVI file using ENVI_OPEN_FILE, then write a subset of that file using ENVI_OUTPUT_TO_EXTERNAL_FORMAT. You would want to set the /ENVI keyword, to indicate that the output file should be in ENVI format. And you will use the DIMS keyword to specify the spatial subset.
- Peg
|
|
|
|
Deleted User New Member
Posts:  
25 Jul 2012 04:13 PM |
|
Thank you Peg,
Will I be able to use the UTM coordinates in the DIMS keyword? All examples I've seen use x,y. Since the files I am processing are LANDSAT images, it's important that I can specify the subset using a geo-referenced (lat/long) coordinate system so that ENVI clips out the same area each time.
|
|
|
|
Deleted User New Member
Posts:  
25 Jul 2012 04:19 PM |
|
Not directly. You will need to figure out which image coordinates correspond to the UTM coordinates first. You can use the routine ENVI_CONVERT_FILE_COORDINATES for that.
- Peg
|
|
|
|