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

Home » Public Forums » archive » Re: Bad data in structure (NaN HowTo?)
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: Bad data in structure (NaN HowTo?) [message #22591 is a reply to message #22589] Wed, 22 November 2000 00:00 Go to previous messageGo to previous message
Pavel A. Romashkin is currently offline  Pavel A. Romashkin
Messages: 531
Registered: November 2000
Senior Member
Randall Skelton wrote:
>
> B = where(atrl eq -12345, count)
> % Struct expression not allowed in this context: ATRL.

I would try something like

;Loop for each field.
FOR I = 0, N_TAGS(atrl) - 1 DO BEGIN
type = size(atrl.(i), /type)
if (type lt 6) or (type gt 11) then begin
; Assume no undefined tags are present.
; If they are present, exclude type=0.
B = where(atrl.(i) eq -12345, count)
if count gt 0 then atrl.(i)[B] = !values.f_nan
endif
ENDFOR

For multiple numerical fields, I'd use a loop. Given relatively small
number of fields, this would not require vectorizing.

> Each structure has about 450 elements in it and is comprised itself of
> strings, ints, floats and doubles and arrays of each of the above.

In your case, I'd automate the search for numerical fields, because I
wouldn't be able to go through 450 fields myself. None of my business,
but are you sure this is the best way to organize the data?

Cheers,
Pavel
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Mixing ASCII and Binary in files
Next Topic: Re: FSC_surface and xsurface under LINUX/IDL5.3

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

Current Time: Tue Dec 02 14:21:16 PST 2025

Total time taken to generate the page: 1.68183 seconds