function hs2dat=get_hs2(file_loc,ButtonName)
%Where the java resides to parse the HS2
   
   switch ButtonName,
     case 'EP1'
      hs2cal='\\Hematite\oasisnt\oasis\cfg\hs2.h2010333.200207029';%what file
     case 'EP2'
      hs2cal='\\Hematite\oasisnt\oasis\cfg\hs2.h2010335.20020730';%what file 
   end % switch
copyfile(sprintf('%shs2',file_loc),'C:\Temp\hs2bad');
%the java program wont work with high timeres data (*T) so this will fix those readings
fid=fopen('C:\Temp\hs2bad');
f_out=fopen('C:\Temp\hs2fix','wt');
Dat_Loc=rm_oasis_header(fid);
fseek(fid,(Dat_Loc),'bof');
i=1;
while ~feof(fid) %read in the numbers
    X=fgetl(fid);
    if X(1:2)=='*T'
    Y=['*D' X(3:12) X(15:end)];
    else
    Y=X;    
    end;
    fprintf(f_out,'%s\n',Y);
    clear X;clear Y;
    i=i+1;
end;
fclose(fid);fclose(f_out);
javaloc='java -cp C:\Data\JavaJar\mbari.jar;C:\Data\JavaJar\oasis.jar org.mbari.oasis.OasisHS2Processer';
file_name='C:\Temp\hs2fix';%what file
comp_file='C:\Temp\hs2compile';
javacom=sprintf('%s %s %s %s',javaloc,file_name,hs2cal,comp_file);
cd C:;
dos(javacom);
fid=fopen(comp_file);%open file
Dat_Loc=rm_oasis_header(fid);%remove the header
fseek(fid,(Dat_Loc),'bof');%start of the data
i=1;
while ~feof(fid) %read in the numbers
    X=fgetl(fid);
    ts=findstr(X,',');
    if isempty(ts)
    hs2dat(:,i)=sscanf(X,'%f');
    end;
    i=i+1;
end;
fclose(fid);
hs2dat(1,:)=utc2sdn(hs2dat(1,:));

%for those accidental 1970 readings
[y,m,d,h,mi,s]=datevec(now);
yind=find(hs2dat(1,:)>=datenum(y,1,1)&hs2dat(1,:)<=datenum(y,12,31));
hs2dat=hs2dat(:,yind);
