function annotate(tifflist)

afid = fopen ( tifflist, 'r' );
count = 0;

%
% get time series from cdf file
[u,jduv] = getts('d31_uvlp.cdf', 'u_1205');
[v,jduv] = getts('d31_uvlp.cdf', 'v_1206');
w = u + i*v;

[psdev,jdpsdev] = getts ( 'sdp.cdf', 'SDP_850' );
%[tran,jdtran] = getts ( 'atten.cdf', 'tran' );
[atten,jdatten] = getts ( 'tran.cdf', 'ATTN_55' );
psdevlims = [0 nanmax(psdev(:))*1.1];
%attenlims = [0 nanmax(atten(:))*1.1];
attenlims = [0 4];

colors = hsv(3);
atten_color = [1 1 0];
psdev_color = colors(2,:);

months=['Jan';'Feb';'Mar';'Apr';'May';'Jun';'Jul';'Aug';'Sep';'Oct';'Nov';'Dec'];

%
% set the timer increment to 3 hrs 59 minutes 10 seconds
jd_inc = julian([1997 1 1 3 59 10]) - julian([1997 1 1 0 0 0]); 

jd_image_start = julian ( [1996 6 11 12 15 58] );
jd_current = jd_image_start;

%
% set up the julian axis
jd0 = julian ( [1996 6 11 0 0 0] );
jd_width = 10;
jd1 = jd0 + jd_width;

filename = fgetl ( afid );

image_figure = figure;
annotate_fig = figure ( 'Units', 'Pixels', 'Color', [0 0 0] );

%
% provide 40 degrees rotation factor
theta = -40*pi/180;
rot = exp(i*theta);

while (filename ~= -1)

   count = count+1;

   %
   % get the image
   figure(image_figure);
   original_tiff = imread ( filename, 'tiff' );
   
   
   
   %
   % crop it
   %cropped_tiff = imcrop( original_tiff, [115 50 600 372]); 
   cropped_tiff = imcrop( original_tiff, [115 50 591 369]); 
   figure(image_figure);
   imshow ( cropped_tiff );

   %
   % save the new file
   [dud,rest] = strtok(filename,'-');
   [number,dud] = strtok(rest,'.');
   [number,dud] = strtok(number,'-');
   newtiffname = sprintf ( 'cropped_%s.tif', number );
   imwrite ( cropped_tiff, newtiffname, 'tiff' );


   %
   % construct the image annotation
   info_struct = imfinfo ( newtiffname );

   figure(annotate_fig);

   %
   % set the width of the annotation figure to be the same as the
   % tiff file, and the height to be 1/4, approximately.  Remember
   % that an mpeg must have multiples of 16 for image dimensions.
   old_axes = findobj ( annotate_fig, 'type', 'axes' );
   eval ( 'delete(old_axes);', '' );
   pos = get ( annotate_fig, 'Position' );
   pos(3) = info_struct.Width;
%   pos(4) = info_struct.Height/3.5;
   pos(4) = 113;
   set ( annotate_fig, 'Position', pos );
   colordef black;

   %
   % make sure that the focus of interest in the plot is in the
   % middle 80% of the figure window.
   if ( jd_current > (jd0 + 0.9 * jd_width) )
      jd0 = jd0 + 0.8*jd_width;
      jd1 = jd0+jd_width;
   end

   %
   % set up the data for this particular "window" or view
   window_jd = linspace(jd0, jd1, 1000 );
   window_psdev = linterp(jdpsdev,psdev, window_jd );
   window_atten = linterp ( jdatten,atten, window_jd );

   %
   % if any attens happen before the first psdev, make them null
   ind = find ( window_jd < jdatten(1) );
   if ( ~isempty(ind) )
      window_atten(ind) = NaN * ones(size(ind));
   end

   psdev_axis = axes ( 'Position', [0.25 0.20 0.70 0.65], ...
                  'YLim', psdevlims, ...
                  'XColor', [1 1 1], 'YColor', psdev_color, ...
                  'YTick', [0 30] );
   psdev_line = line ( window_jd, window_psdev, 'Color', psdev_color );
   hold on
   psdev_i = linterp ( jdpsdev, psdev, jd_current );
   plot ( jd_current, psdev_i, 'marker', '*',  'Color', [1 1 1] );
   ylabel ( 'PSDEV');

   atten_axis = axes ( 'Position', get(psdev_axis, 'Position'), ...
                  'YAxisLocation', 'right', ...
                  'Color', 'none', ...
                  'YLim', attenlims, ...
                  'XColor', [1 1 1], 'YColor', atten_color, ...
                  'XTick', [] );

   atten_line = line ( window_jd, window_atten, 'Color', atten_color );
   hold on
   atten_i = linterp ( jdatten, atten, jd_current );
   if ( jd_current >= jdatten(1) )
      plot ( jd_current, atten_i, 'Marker', '*', 'Color', [1 1 1] );
   end
   ylabel ( 'attenuation' );


   axes ( psdev_axis );
   ylim = get(psdev_axis, 'ylim');
   time_line = line ( [jd_current jd_current], ylim );
   set ( time_line, 'color', 'w' );

   %
   % Use Rich's routine to get the ticks right, but I don't like
   % the labeling.
   jdaxis = get ( gca, 'xlim' );
   gregaxd ( jdaxis, 2 );
   bad_text = findobj(gca,'type','text');
   delete(bad_text);
   set ( gca, 'XTickLabel', [] );
   xt = get ( psdev_axis, 'XTick' );

   
   greg = gregorian(xt(1));
   monthname = months(greg(2),:);
   tickdate = sprintf ( '%s %.0f', monthname, greg(3) );
   montext = text ( xt(1), -6.15, 0, ...
		    tickdate, ...
		    'HorizontalAlignment', 'center' );
   for k = 2:length(xt)
      greg = gregorian(xt(k));
      tickdate = num2str(greg(3));
      montext = text ( xt(k), -6.15, 0, ...
		       tickdate, ...
		       'HorizontalAlignment', 'center' );
   end

      

   axes ( atten_axis );


   %
   % make room for the wind arrow
   arrow_axis = axes ( 'position', [0.04 0.15 0.12 0.70] );
   set ( arrow_axis, 'xlim', [-6 6], ...
         'ylim', [-6 6], ...
         'DataAspectRatio', [1 1 1], ...
         'Box', 'off', ...
         'XColor', [0 0 0], ...
         'YColor', [0 0 0] );


   u_current = linterp ( jduv, u, jd_current );
   v_current = linterp ( jduv, v, jd_current );
   w_current = u_current + i*v_current
   abs(w_current)
   axes(arrow_axis); cla;
   fatarrow(0,0,w_current*rot,[1 1 1]);
   
   set ( arrow_axis, 'XTick', [], 'YTick', [] );


   
   annotation_fname = sprintf ( 'annotated_%s.ppm', number );
   ppmwrite ( annotation_fname );

   filename = fgetl ( afid );

   jd_current = jd_current + jd_inc;

end


