function sv_plots (data)
% sv_plots: calls plot routine for SV's
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

if (data.GPS.loaded==0)
   err_text=sprintf('Please load GPS data!\n');
   fault(err_text);
   return;
end;

% add wait bar
whan=waitbar(0.10,'Generating SV Plots, Please wait...',...
   'Name','Plotting',...
   'CloseRequestFcn','closereq',...
   'WindowStyle','Normal',...
   'Pointer','watch');
drawnow

% get the GPS file directory
j01=findstr(data.GPS.GPS_file,'\');
data.current_path=data.GPS.GPS_file(1:j01(end));
if (exist(data.current_path)~=7)
   err_text=sprintf('The directory for the GPS data does not exist!\n');
   fault(err_text);
   return;
end;

% file name string
j01=findstr(data.GPS.GPS_file,'.');
filename01=data.GPS.GPS_file(1:(j01(end)-1));
j02=findstr(filename01,'\');
filename02=filename01((j02(end)+1):end);

data.config.single_axes=1;
data.config.disp_position=0;
data.config.single_label='L1 SNR, L2 SNR, L1 Cycle Slips, L2 Cycle Slips, &  Elev';
for (i=1:size(data.GPS.observables.SV,2))
   if (isempty(data.GPS.observables.SV{i})==0)
      
      % get loaded fields
      column=[];
      for (j=1:size(data.config.field_names,1))
         if (strcmp(data.config.field_names{j},sprintf('SV %.0f L1 SNR',i))==1)
            data.config.field_ranges(j,8)=1;
            column(data.config.field_ranges(j,8))=j;
            j01=find((data.GPS.observables.SV{i}(:,data.config.field_location(j,2)))==0);
            if (isempty(j01)==0)
               data.GPS.observables.SV{i}(j01,data.config.field_location(j,2))=nan*ones(length(j01),1);
            end;
            clear j01;
         elseif (strcmp(data.config.field_names{j},sprintf('SV %.0f L2 SNR',i))==1)
            data.config.field_ranges(j,8)=2;
            column(data.config.field_ranges(j,8))=j;
            j01=find((data.GPS.observables.SV{i}(:,data.config.field_location(j,2)))==0);
            if (isempty(j01)==0)
               data.GPS.observables.SV{i}(j01,data.config.field_location(j,2))=nan*ones(length(j01),1);
            end;
            clear j01;
         elseif (strcmp(data.config.field_names{j},sprintf('SV %.0f L1 Slip',i))==1)
            data.config.field_ranges(j,8)=3;
            column(data.config.field_ranges(j,8))=j;
         elseif (strcmp(data.config.field_names{j},sprintf('SV %.0f L2 Slip',i))==1)
            data.config.field_ranges(j,8)=4;
            column(data.config.field_ranges(j,8))=j;
         elseif (strcmp(data.config.field_names{j},sprintf('SV %.0f Elev',i))==1)
            data.config.field_ranges(j,8)=5;
            column(data.config.field_ranges(j,8))=j;
            j01=find((data.GPS.observables.SV{i}(:,data.config.field_location(j,2)))==0);
            if (isempty(j01)==0)
               data.GPS.observables.SV{i}(j01,data.config.field_location(j,2))=nan*ones(length(j01),1);
            end;
            clear j01;
         else
            data.config.field_ranges(j,8)=0;
         end;
      end;
      if (isempty(column)==1)
         return;
      end;
      
      % file name string
      prn=sprintf('0%.0f',i);
      prn=prn(end-1:end);
      filename=sprintf('PRN %s Plot (GPS file - %s)',prn,filename02);
      titlename=sprintf('PRN %s Plot (GPS file - %s)',prn,dir_clip(data.GPS.GPS_file,50));
      
      %  generate analysis plot
      [data,fig]=analysis_plot(data,column,titlename,filename,0);
      data.temp=[];
      rmfield(data,'temp');
      
      % add additional function buttons
      if ((data.GPS.loaded==1)&(isempty(data.GPS.observables)==0)&(data.config.auto_close==0))
         bhandle=plot_buttons(fig);
         set(bhandle,'UserData',data.GPS.observables.cycle_slip.slips);
      end;
   end;
   % update waitbar
   waitbar(i/32,whan);
   drawnow;
end;

% remove wait bar
set(whan,'Pointer','arrow');
delete(whan);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
return;
