%% load output file from the previous saved file list

%%  Kriging Software Package  version 1.0 beta,   October 29, 1998
%%  Copyright (c) 1998, property of Dezhang Chu and Woods Hole Oceanographic
%%  Institution.  All Rights Reserved.


%%%%%%%%%%%%%%% Load Data File %%%%%%%%%%%%%%%%%%%%%
chtopath=0;
if exist('krigfilepath')
   eval(['chdir ' '''' krigfilepath '''']);
   chtopath=1;
end
[filename, krigfilepath]=uigetfile('*.mat','Select an Input File');
eval(['chdir ' '''' HDIR '''']);
if isstr(filename)
   filename1=[krigfilepath filename ];
   eval(['load ' '''' filename1 ''''])
   if ~exist('Lat_long')			% set missing parameters for older files saved before 9/14/98
      Lat_long=1;
      markersize=6;
      S2=10;
   end
   x=xs;y=ys;
   [ny,nx]=size(Cg);
   if Lat_long == 1
      long=xs;
      lat=ys;
      long_min=min(min(Xg));long_max=max(max(Xg));
      lat_min=min(min(Yg));lat_max=max(max(Yg));
   else
      x=xs;y=ys;
      xg=linspace(min(min(Xg)),max(max(Xg)),nx);
      yg=linspace(min(min(Yg)),max(max(Yg)),ny);
   end
   var=var_obs;
   Is=var_est;
   Ig=reshape(Cg,nx*ny,1);
   ep_g=reshape(Eg,nx*ny,1);
   TransformInd=1;
   displaykrig
   
end
hinvhdl=findobj(gcf,'Tag','InvDataTrans');
if TransformStatus == 2
  set(hinvhdl(1),'string','Transformed Data');
else
  set(hinvhdl(1),'string','Inverse Transformed Data');
end
