function [finout,time,mstla,mstlo] = ...
         cal_amp4plot(amp_fname,jday1,jday2,ARRAY,BAND)

YEAR = '2000';
k=1;
for i=jday1:jday2
    if (i < 10)
    julday=sprintf('00%d',i);
    elseif (i < 100)
    julday=sprintf('0%d',i);
    end
    
% Reading FNET.
    tempname=sprintf('%s.%s.%s.%s.TEST.amp',YEAR,julday,ARRAY1,BAND);
    [dumm,dumm1,tmstla,tmstlo,stime,sdtime,sang,sdang,tempout] = ...
    readamp(tempname); 
    mstla(k)=tmstla;
    mstlo(k)=tmstlo;  
    mm = size(tempout);
    ttime = 0 : sdtime : sdtime*(mm(1)-1);
    ttime = ttime + stime;
    imin = ceil(-stime/sdtime)+1; 
    imax = ceil((24*3600-stime)/sdtime);
    [tmaxfinout,itmaxfinout]=max(tempout(imin:imax,:)'); 
    maxfinout(:,k)=tmaxfinout';
    time1(:,k) = ttime(1,imin:imax)';
k=k+1;
end

mm = size(maxfinout);
finout = zeros(mm(1)*mm(2),1);
time = zeros(mm(1)*mm(2),1);
jjday = jday1:jday2;

for i = 1:mm(2)
    finout(mm(1)*(i-1)+1:mm(1)*i,1)=maxfinout(:,i); 
    time(mm(1)*(i-1)+1:mm(1)*i,1)=time(:,i)./3600./24+jjday(i);
end


