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

Home » Public Forums » archive » Avoiding redefinition of variable within loop.
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: Avoiding redefinition of variable within loop. [message #88733 is a reply to message #88732] Tue, 10 June 2014 14:42 Go to previous message
kcwhite91 is currently offline  kcwhite91
Messages: 4
Registered: June 2014
Junior Member
On Tuesday, June 10, 2014 3:25:30 PM UTC-5, Matthew Argall wrote:
>> Sorry, had to reform zall into zall1 because of the first where statement.
>
>
>
> Then I think this should still work, unless I misunderstand what you are trying to do...
>
>
>
> keep_indices = where((zall[*,*,1,j] ne -32768.0) and (zall[*,*,1,j] gt 10), COMPLEMENT=lost_indices)
>
>
>
>
>
> Depending on what your purpose is, you might not even need to loop over j. You could just do
>
>
>
> keep_indices = where((zall ne -32768.0) and (zall gt 10), COMPLEMENT=lost_indices)
>
> zall[lost_indices] = !values.f_nan

Thanks for your help, I think what you are saying would have worked. In the meantime, however, I realized my methodology was inefficient for my purpose and rewrote it completely. I was able to reach a satisfactory end result.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Implied print and namespace
Next Topic: How to use SPAWN for creating multiple output files?

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

Current Time: Wed Oct 08 15:48:09 PDT 2025

Total time taken to generate the page: 0.00542 seconds