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

Home » Public Forums » archive » masking float/interger arrays in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
masking float/interger arrays in IDL [message #94427] Thu, 18 May 2017 21:39 Go to next message
priyamalik484 is currently offline  priyamalik484
Messages: 7
Registered: December 2016
Junior Member
Dear All,

I want to know what is the masked value for float or integer in IDL?

For eg. just to explain with very simple code:

A=[-0.9,0.0,1.0,2.0,3.0,-0.7]
B=[-0.6,2.1,2.3,3.4,0.0,4.1]
C=[0.0,0.0,-0.7,1.7,1.2,0.0]

I have three arrays with same dimension. I want to do addition of these arrays.
However I don't want to include those indices in addition where the value is 0.0 or
its negative.
With "where" command I can get indices but I can not remove them, as then array will become of different dimensions, then I will not be able to do addition.

Any help?? Actually this concept I will further use in Image processing!!!!

PS: It is very easy in python. If you assign a value 9999 to any integer code will consider it as a masked number and will not use it in addition and array dimension will remain intact.
Re: masking float/interger arrays in IDL [message #94428 is a reply to message #94427] Fri, 19 May 2017 02:48 Go to previous message
Markus Schmassmann is currently offline  Markus Schmassmann
Messages: 129
Registered: April 2016
Senior Member
On 05/19/2017 06:39 AM, priyamalik484@gmail.com wrote:
> I want to know what is the masked value for float or integer in IDL?
>
> For eg. just to explain with very simple code:
>
> A=[-0.9,0.0,1.0,2.0,3.0,-0.7]
> B=[-0.6,2.1,2.3,3.4,0.0,4.1]
> C=[0.0,0.0,-0.7,1.7,1.2,0.0]
>
> I have three arrays with same dimension. I want to do addition of these arrays.
> However I don't want to include those indices in addition where the value is 0.0 or
> its negative.
> With "where" command I can get indices but I can not remove them, as then array will become of different dimensions, then I will not be able to do addition.
>
> Any help?? Actually this concept I will further use in Image processing!!!!
>
> PS: It is very easy in python. If you assign a value 9999 to any integer code will consider it as a masked number and will not use it in addition and array dimension will remain intact.
a*(a gt 0)+b*(b gt 0)+c*(c gt 0)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Problem writing SCATTERPLOT() with more than 4096 points to PDF file
Next Topic: read_write Binary file. Bsq

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

Current Time: Wed Oct 08 11:31:57 PDT 2025

Total time taken to generate the page: 0.00490 seconds