On Apr 24, 2:53 am, James Kuyper <jameskuy...@verizon.net> wrote:
> Bennett wrote:
>> On Apr 23, 1:00 pm, Bennett <juggernau...@gmail.com> wrote:
> ...
>>> In IDL you can do a
>>> newArray = CONVOL(imageArray, [[1,1,1],[1,0,1],[1,1,1]], /CENTER)
>>> This will compute theaveragevalue in a 3x3 box around each pixel
>>> (except
>>> the edge pixels which you can set to zero or truncate or handle
>>> separately...
>>> whatever you please really. Who needs edges anyway, right?)
>
>>> Bennett
>
>> I forgot to say also divide your resulting newArray by 8.
>
> Alternatively, you could divide the array of weighting factors by 8.
What do you think about this ENVI-approach to extract an average
window (profiled)
Once I open the stacked file (24 stacked layers) and get the id
lfile_id
...
arrayAvgYear = make_array(20,24, /float) ; ### ~ 24 periods per year
for 20 years.
noPixels = 9
countYear =0;
ENVI_FILE_QUERY, lfile_id, NS = ns, NL = nl, NB = nb, sname=sname,
interleave=interleave
pb= indgen(nb)
line1 = ENVI_GET_SLICE (fid = lfile_id, line=640,
pos=pb,xs=initSample, xe=lastSample )
line2 = ENVI_GET_SLICE (fid = lfile_id, line=641,
pos=pb,xs=initSample, xe=lastSample )
line3 = ENVI_GET_SLICE (fid = lfile_id, line=642,
pos=pb,xs=initSample, xe=lastSample )
For i=0, nb-1 Do Begin
arrayAvgYear[countYear,i] = (total(line1[*,i]) + total(line2[*,i])
+ total(line3[*,i])) / noPixels ;### Get the average for each image
of stacked layers
EndFor
countYear+=1 ;count for each year
fn+=1
IF (fn eq 2009) THEN BREAK
Endwhile
Then I just save the arrayAvgYear into a text file and I got a file
with one values for each year (every 14 days)
Date, Year1, Year2,... Year20
1, 0.3343, 0.233,
14, 0.3344, 0.334,
28, 0.3323, 0.344,
...
365
Any opinions...
Geo
|