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

Home » Public Forums » archive » help with IF statement
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
help with IF statement [message #90059] Wed, 21 January 2015 09:26 Go to previous message
g.nacarts is currently offline  g.nacarts
Messages: 148
Registered: November 2013
Senior Member
Hi

I need some help with an IF statement because I suspect that it's not doing what I really wish to do.

I have a 3D array [120,200,200] which contains my data. Then I am using this matrix to create another matrix. My code looks like this

DataArray ; contains the 3D data
Mean = total(DataArray[0:4,*,*],1)/5.

for i = 0, 199 do begin
for j = 0, 199 do begin
Barray = DataArray[*,i,j] - Array[i,j]
IF (TOTAL(Barray LT 0)) GT 0 THEN NEW_DATA[*,j,k] = Mean[j,k] $
ELSE NEW_DATA[*,j,k] = Mean[j,k] + OTHER
endfor
endfor

What I wanted to achieve with the above is that if an entry in the Barray has a negative value then the New_Data it's equals the mean otherwise NEW_DATA= Mean+ OTHER.
My data are images and when I display the images after that I found out that in places that there are not negative numbers the new_data array equals the mean only not the whole expression (Mean[j,k] + OTHER). Why this happened? It supposed to use the mean only when there are negatives.
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Map method bug?
Next Topic: check for infinity

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

Current Time: Wed Oct 08 15:36:56 PDT 2025

Total time taken to generate the page: 0.00364 seconds