%RunORE2002Oct22;

clear all

disp(' ')
disp(' ')
fileselect=1;
for fileselect=1:2,
%while fileselect~=0,
   %disp('Select File By Number From Following List:')
   %disp('  0)  Exit Program')
   %disp('  1)  LBL.csv')
   %disp('  2)  DVL.csv')
   %fileselect=input('Enter Selected File Number:  ');
   disp(' ')
   
   if min(computer=='PCWIN')==1,
      runparams.directoryname='DATA2002Oct22\ORE4336\USBL_SN2004_2002Oct22\';
      disp('Reading Data Using PC/Windows Directory Format From Directory:')
      disp(['  ' runparams.directoryname ])
   else,
      runparams.directoryname='DATA2002Oct22/ORE4336/USBL_SN2004_2002Oct22/';
      disp('Reading Data Using Unix Directory Format From Directory:')
      disp(['  ' runparams.directoryname ])
   end;
   
   switch fileselect,
   case 0,
      disp('Exiting Program')
      break;
   case 1,
      runparams.filename='setA.csv';
      runparams.numdatafiles=10;
      runparams.preampgain=32;
      runparams.hydrophoneID='TC4034SN2401312';
      %runparams.hydrophoneID='TC4034SN1101051';
		runparams.mintime=4.0e-3;
      runparams.maxtime=6.0e-3;
      runparams.minfreq=0e3;
      runparams.maxfreq=50e3;
   case 2,
      runparams.filename='setB.csv';
      runparams.numdatafiles=10;
      runparams.preampgain=32;
      runparams.hydrophoneID='TC4034SN2401312';
      %runparams.hydrophoneID='TC4034SN1101051';
      runparams.mintime=4.0e-3;
      runparams.maxtime=6.0e-3;
      runparams.minfreq=0e3;
      runparams.maxfreq=50e3;
  otherwise,
      disp('Could Not Match File Selection in Function RunInfinium')
      break;
   end;
   
   runparams.identifier=['EXP1USBL2004: Set ' num2str(fileselect)];
   
  [time,sig,freq,spec,cal]=InfiniumFFT(runparams);
 
   figure(1)
   orient 'tall'
   printname=runparams.filename(1:length(runparams.filename)-4);
   printname=['EXP1USBL2004_' printname];
	if min(computer=='PCWIN')==1,
		eval(['print -dpsc printresults2002Oct22\' printname]);
		eval(['save printresults2002Oct22\' printname ' time sig freq spec cal']);
      disp('Saving Printfile Using PC/Windows Directory Format To Directory:')
      disp(['  printresults2002Oct22\'  printname ])
   else,
		eval(['print -dpsc printresults2002Oct22/' printname]);
		eval(['save printresults2002Oct22\' printname ' time sig freq spec cal']);
      disp('Saving Printfile Using Unix Directory Format To Directory:')
      disp(['  printresults2002Oct22/'  printname ])
   end;
   
   disp(' ')
   disp(' ')
   
end;
