X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 03 Aug 2011 03:54 PM by  anon
performing arithmetic on tif files through ENVI
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
03 Aug 2011 03:54 PM
    Hi folks - I need to do some Landsat processing programmetrically, as in, through a script. I need to do basica arithmetic functions on landsat individual bands (tif files). I began to go about this by using ENVI functions, ie, calling ENVI_GET_DATA, to read in the data, and then hopefully, be able to perfrom arithmentic on the pixel values. Is this possible on a tif iamge through ENVI functions? I can apparently *open* a tif file using ENVI_OPEN_DATA_FILE, but it is not clear to me I can actually *read* the pixel values in the tif file and perform basic math on the image as a whole. I know how to do this in IDL, but I wanted to use ENVI as there are other aspects of using ENVI functions in my script, and I was trying to be consistent (ie, using fids vs luns consistently). help! I've read the ENVI programming guide, and I cannot seem to find an answer as to how to do this. I've tried assuming this should work, but my script doesn't work and throws a pretty peculiar error - so I wanted to know if this was even valid to try to do. thank you, Cyndy

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    04 Aug 2011 08:38 AM
    If you can open the file, then you can read the data. Since the landsat files are fairly large, I would avoid using ENVI_GET_DATA which will need to read in the entire band data to a variable in memory. A better approach is to use the ENVI Tiling routines. There are several examples of how these are used in the ENVI help. If the equations are simple, you can also use MATH_DOIT which does not require you read the data into any variables or tile the process. The routine takes care of file I/O for you and you just need to pass in the file parameters (FID, DIMS, POS, etc).
    You are not authorized to post a reply.