function [field,x,y,z]=hopsgui_getdata
%  USAGE [field,x,y,z]=hopsgui_getdata;
%  This function get the data is being plotted
%
%  field - is the actual data (temperature, Uvelocity, salinity,...)
%  x     - the x coordinate (Longitude)
%  y     - the y coordinate (Latitude)
%  z     - the z coordinate (Depth)
%
%  Pedro Velez (UIB-IEO), July 1999


global hopsgui_obj

sprintf('>>>>>This is data for - %s -',hopsgui_obj{1}.action);
switch ( hopsgui_obj{1}.action )

        
%Depth contouring
case 'depth_contour'

	    	[field,x,y]=hopsgui_depthslice(hopsgui_obj{1}.filein, ...
      	  hopsgui_obj{1}.depth, ....
	        hopsgui_obj{1}.time, ....
	        hopsgui_obj{1}.variable);
		  z=ones(size(x))*hopsgui_obj{1}.depth;

sprintf('>>>>>The data for variable - %s - have been saved in field, the coordinates in x,y,z',hopsgui_obj{1}.variable)
		  
%%%%Jindex contouring%%%%%
case 'jindex_contour'

	[field,x,y,z]=hopsgui_jslice(hopsgui_obj{1}.filein, ...
	hopsgui_obj{1}.jindex,....
      hopsgui_obj{1}.time, ....
	hopsgui_obj{1}.variable);
sprintf('>>>>>The data for variable - %s - have been saved in field, the coordinates in x,y,z',hopsgui_obj{1}.variable)	

%%%%Iindex contouring%%%%
case 'iindex_contour'

      [field,x,y,z]=hopsgui_islice(hopsgui_obj{1}.filein,...
	hopsgui_obj{1}.iindex,...
	hopsgui_obj{1}.time,...
	hopsgui_obj{1}.variable);
sprintf('>>>>>The data for variable - %s - have been saved in field, the coordinates in x,y,z',hopsgui_obj{1}.variable)  
	


%%%%kindex contouring%%%%
case 'kindex_contour'

  %Reading data
      [field,x,y,z]=hopsgui_kslice(hopsgui_obj{1}.filein,...
	hopsgui_obj{1}.kindex,...
	hopsgui_obj{1}.time,...
	hopsgui_obj{1}.variable);
sprintf('>>>>>The data for variable - %s - have been saved in field, the coordinates in x,y,z',hopsgui_obj{1}.variable)	
	
end  %Del switch
return;

