comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Removing and Replacing Nan values in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Removing and Replacing Nan values in IDL [message #80873 is a reply to message #80870] Thu, 19 July 2012 07:36 Go to previous messageGo to previous message
adhdunn is currently offline  adhdunn
Messages: 11
Registered: July 2012
Junior Member
It might help to also have the other part of the code as well. Everything below is before the section I posted previously:


openr, lun, 'F:\PhD\Data\MODIS\LST\h9v4_h10v4_LST_daynight', /get_lun

band = fltarr(2401, 1200)
image = assoc(lun, band)

openw, lun, 'F:\PhD\Data\MODIS\LST\h9v4_h10v4_LST_mnthavgTST_2010', /get_lun
filter = assoc(lun, band)

imageout = image[0]
imagetwo = image[1]


a= image[0]/image[1]

; evaluate division result to make sure it's a valid #
; then examine all indices that represent valid numbers to see if they're GT 1.2
; i.e., find places where image[0] values are 1.2x greater than corresponding
image[1] values

removefirst = where(a[where(FINITE(a) eq 1)] gt 1.2, count)

; if division result gt 1.2
; replace all values in imageout with values from image[1] that are 1.2x less
than image[0]

if count GT 0 then imageout[removefirst] = imagetwo[removefirst]

for i = 0,23,2 do begin

image1 = image[i]*0.02-273.15
image2 = image[i+1]*0.02-273.15

filter[i/2] = image1>image2
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Rescaling byte (0-200) ndvi to -1 to 1 values
Next Topic: IDL 8.0.1 crashes

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:18:58 PDT 2025

Total time taken to generate the page: 0.00384 seconds