%
%   narrow_1130_movie.m
%
%   make a movie of the apogee pass for LAMP
%
%   Use data saved in
%   C:\Users\DF_Local\Documents\Venetie_2022\Matlab\5March2022_Lamp4m
%
%   McHarg  May 2022
%
close all
% Note:  Use load('narrow_1130.mat');  to load the data
counter=1;
fps=100;  % frames per second of the recording
delt=1/fps;   % the delta time between frames
% t1=datetime(2022,03,05,11,30,00,003);
% t2=datetime(2022,03,05,11,34,00,003);
% tvec=(t1:seconds(delt):t2);
%
%   Note: In below, set the path to where you want the movie written
%
v = VideoWriter('C:\Users\DF_Local\Documents\Venetie_2022\Matlab\movies\narrow_1130','MPEG-4');
v.FrameRate=100;
len_d=length(time_1130);
startimg=1;
stopimg=len_d;
i_count=1;
clims=[1,1100];   % this sets the limits on the "contrast" on the images in movie.  Make it smaller, more contrast
for q=startimg:stopimg    %this is simply the loop that runs over each image
   fooim2=figure;
   
            A=images_1130(:,:,q);
imagesc(A,clims)
colormap(gray)
axis image
title('Venete AK Narrow, 5 March 2022, 11:30-11:31')
            text(50,80,['Time ',string(time_1130(q))],'Color','w')
 F(i_count)=getframe(gcf);
            i_count=i_count+1;
            close(fooim2)
end
open(v)
writeVideo(v,F) 
close(v) 