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

Home » Public Forums » archive » Re: loop for 365 days with 18 days interval
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
Re: loop for 365 days with 18 days interval [message #63784] Thu, 20 November 2008 00:56 Go to next message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Jeremy Bailin schrieb:
> On Nov 19, 10:50 pm, Elkunn <Wasit.Weat...@gmail.com> wrote:
>> On Nov 19, 9:49 pm, Elkunn <Wasit.Weat...@gmail.com> wrote:
>>
>>> Hello,
>>> I want to loop for 16 days as a group through the whole year. In other
>>> words, my first loop should stop when the number of the days reaches
>>> 16, do processing, then count from 17th day to the day when the number
>>> of days reaches 16, then do the processing again.
>>> How can loop for this, each time read 16 images?
>>> Thanks
>>> Elkunn
>> sorry, should be 16 days. not 18.
>
> I suppose it depends what you mean by "do processing". If it needs to
> be in a for loop, then something like this should work:
>
> for i=0l,364 do begin
> ... do whatever is required to read in image i ...
> if i mod 16 ne 0 then continue
> ... do processing on image i ...
> endfor

read about stride

some days ago there was a similiar request to this group. (array of
Julian Days)

cheers
Reimar
Re: loop for 365 days with 18 days interval [message #63790 is a reply to message #63784] Wed, 19 November 2008 21:33 Go to previous messageGo to next message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On Nov 19, 10:50 pm, Elkunn <Wasit.Weat...@gmail.com> wrote:
> On Nov 19, 9:49 pm, Elkunn <Wasit.Weat...@gmail.com> wrote:
>
>> Hello,
>> I want to loop for 16 days as a group through the whole year. In other
>> words, my first loop should stop when the number of the days reaches
>> 16, do processing, then count from 17th day to the day when the number
>> of days reaches 16, then do the processing again.
>> How can loop for this, each time read 16 images?
>
>> Thanks
>
>> Elkunn
>
> sorry, should be 16 days. not 18.

I suppose it depends what you mean by "do processing". If it needs to
be in a for loop, then something like this should work:

for i=0l,364 do begin
... do whatever is required to read in image i ...
if i mod 16 ne 0 then continue
... do processing on image i ...
endfor

But it could be that you can be much more clever... hard to say
without more details. Do you need to store the intermediate images?
Can you read in everything and then do vector processing afterwards?

-Jeremy.
Re: loop for 365 days with 18 days interval [message #63792 is a reply to message #63790] Wed, 19 November 2008 19:50 Go to previous messageGo to next message
Wasit.Weather is currently offline  Wasit.Weather
Messages: 62
Registered: February 2008
Member
On Nov 19, 9:49 pm, Elkunn <Wasit.Weat...@gmail.com> wrote:
> Hello,
> I want to loop for 16 days as a group through the whole year. In other
> words, my first loop should stop when the number of the days reaches
> 16, do processing, then count from 17th day to the day when the number
> of days reaches 16, then do the processing again.
> How can loop for this, each time read 16 images?
>
> Thanks
>
> Elkunn

sorry, should be 16 days. not 18.
Re: loop for 365 days with 18 days interval [message #63848 is a reply to message #63790] Thu, 20 November 2008 09:11 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On Nov 19, 10:33 pm, Jeremy Bailin <astroco...@gmail.com> wrote:
> On Nov 19, 10:50 pm, Elkunn <Wasit.Weat...@gmail.com> wrote:
>
>> On Nov 19, 9:49 pm, Elkunn <Wasit.Weat...@gmail.com> wrote:
>
>>> Hello,
>>> I want to loop for 16 days as a group through the whole year. In other
>>> words, my first loop should stop when the number of the days reaches
>>> 16, do processing, then count from 17th day to the day when the number
>>> of days reaches 16, then do the processing again.
>>> How can loop for this, each time read 16 images?
>
>>> Thanks
>
>>> Elkunn
>
>> sorry, should be 16 days. not 18.
>
> I suppose it depends what you mean by "do processing". If it needs to
> be in a for loop, then something like this should work:
>
> for i=0l,364 do begin
>   ... do whatever is required to read in image i ...
>   if i mod 16 ne 0 then continue
>   ... do processing on image i ...
> endfor

For the FOR loop type problems, how about:

for i = 0, 364, 16 do begin
; read images i to i + 15
; do processing on images i to i + 15
endfor

> But it could be that you can be much more clever... hard to say
> without more details. Do you need to store the intermediate images?
> Can you read in everything and then do vector processing afterwards?

Yes, vector processing is a generally better solution if you can do
it, but looping 365 / 16 = 23 times (or 365 times) is not worth
worrying about. It is more important to try to get the processing you
do for each image to be vectorized.

Mike
--
www.michaelgalloy.com
Tech-X Corporation
Associate Research Scientist
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: A Simple IDL Manifesto
Next Topic: dependency tree / call graph in idl (cscope for idl)?

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

Current Time: Wed Oct 08 20:06:13 PDT 2025

Total time taken to generate the page: 0.37960 seconds