X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 14 Aug 2016 10:57 AM by  anon
Remove All Pixels set to a No Data -1 value for finding min/max
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:29
New Member


--
14 Aug 2016 10:57 AM
    Hi all, I'm trying to take a raster, open it, and find the maximums and minimums of its pixel values. When I run http://www.harrisgeospati...iRasterIterator.html I get the maximum as the correct value, but the tools I use to create the raster set the value for no pixel to be "-1", and "-1", not my lowest true data value, comes up as the minimum. I've tried modifying it to ignore the -1 value by adding the keyword "data_ignore_value=1.0000" when opening the raster with e.openraster, and by creating a masked raster file with a mask built from "(raster.GetData(BAND=0) ge -1.0000)", neither of which affects the minimum that comes out. One last approach I tried was throwing the tile through the function "WHERE(tile GT -1)", although this resulted in my correct min and max values being seemingly random values. Any guidance would be greatly appreciated, Jared

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    15 Aug 2016 09:33 AM
    What values do you get when using Calculate statistics (or the task: http://www.harrisgeospati...tatisticstask.html)? I believe this tool should ignore what is set as the 'data ignore value' in the image header. It is my impression that when using the Tile iterator with the 'max' or 'min' functions from IDL, it is not aware of the metadata (data ignore value).

    Deleted User



    New Member


    Posts:29
    New Member


    --
    15 Aug 2016 03:55 PM
    Hi, I ended up using ENVI_STAT_DOIT, and it worked (so far). I thought about using ENVIRasterStatisticsTask, but need to maintain backwards compatibility with ENVI 5.1.
    You are not authorized to post a reply.