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 #88732 is a reply to message #88730] Tue, 10 June 2014 13:25 Go to previous messageGo to previous message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
> 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
[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 19:28:26 PDT 2025

Total time taken to generate the page: 0.00442 seconds