loop for 365 days with 18 days interval [message #63793] |
Wed, 19 November 2008 19:49  |
Wasit.Weather
Messages: 62 Registered: February 2008
|
Member |
|
|
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
|
|
|
Re: loop for 365 days with 18 days interval [message #63843 is a reply to message #63793] |
Thu, 20 November 2008 10:16  |
Wasit.Weather
Messages: 62 Registered: February 2008
|
Member |
|
|
On Nov 20, 11:11 am, "mgal...@gmail.com" <mgal...@gmail.com> wrote:
> 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- Hide quoted text -
>
> - Show quoted text -
I nead to read 16 images each time (one image one day), make a
composite, save it into disk, then read next 16 images, do the same
processings, save out to disk until all of the image is done in a year
cycle.
Thanks
|
|
|