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

Home » Public Forums » archive » Re: Removing unwanted data from a structure
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 unwanted data from a structure [message #84134 is a reply to message #84129] Fri, 26 April 2013 10:08 Go to previous messageGo to previous message
Phillip Bitzer is currently offline  Phillip Bitzer
Messages: 223
Registered: June 2006
Senior Member
A couple of things:

1) Do you have a structure of arrays? If so, then something like this should work:

FOR i=0, N_TAGS(str)-1 DO BEGIN
ind = WHERE(str.(i) LT -100, count)
IF count NE 0 THEN str.(i)[ind] = !VALUES.F_NAN
ENDFOR

2) A word of warning: if any of the fields are not floating point values, this won't work. Using the code as is will result in the "error" values assigned to zero, and a warning about Floating Illegal Operand will be issued. This is caused because the type of a field in a structure can not be changed.

3) I'm told that you can't use IF statements with structures

In what sense?
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: IDL Workbench & jumping back to STOP/breakpoints
Next Topic: TIFF Read/Write Bug?

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

Current Time: Thu Oct 09 22:39:24 PDT 2025

Total time taken to generate the page: 1.52079 seconds