function print_compare_cond(cruiseid,fh)
% PRINT_COMPARE_COND - print the output figures that come from compare_cond.m
% 
% CTD Calibration toolbox.
%
% USAGE:
% print_compare_cond(cruiseid,fh);
%	fh - figure handles
%	cruiseid - 

% 
% VERSION: 
%	$Revision: 1.11 $
%	$Date: 2008/03/11 20:31:09 $
%	$Id: print_compare_cond.m,v 1.11 2008/03/11 20:31:09 duncombe Exp duncombe $
%
% CHANGELOG: 
%  2007/12/17 - CMDR
%	* read cruise id from the file in the current directory
%  2008/01/02 CMDR
%	* print an vector of file handles 
%	* vectorize and loop the code
%  2008/01/09 CMDR
%	* give some hint as to what is happening when matlab apparently hangs
%  2008/02/05 CMDR
%	* ensure we are printing the right figure after editing it
%

%%%%%%%%%%% CMDR read cruiseid if we can
if nargin==0, cruiseid=getcruiseid; end;
if isempty(cruiseid), cruiseid=getcruiseid; end;
%%%%%%%%%%%

%%%%%%%%%% CMDR the figures processed here were somewhat obscure. go with them
%% anyway until we know what is going on
if ~exist('fh'), fh=[]; end;
if isempty(fh), fh=[27:30]; end;
%%%%%%%%%% 

%%%%%%%%%%% CMDR
% c_path=['C:\CTD_calibration\',cruiseid,'\figures\'];
p=pwd; dir_del=p(1);
c_path=['figures' dir_del ];

% figure(27)
for i = 1:length(fh),
	figure(fh(i));
%%%%%%%%% why skip looking at figure 2?
%	if i~=2, 
%%%%%%%%% CMDR Matlab hangs! Why, heavens, we are waiting for some input from 
%%%%%%%%% the user! Lets say something to that effect shall we? 
	disp(['Paused to edit figure(' num2str(fh(i)) ')' ]);
	disp('Press any key to continue');
	pause; % to edit the figure
%	end;
	figure(fh(i));
	eval(['print -depsc ',c_path,'cond_r_fig' num2str(i)]);
end;

% Close the figures after saving the necessary ones
%%%%%%% CMDR  No, I dont think so! 
% close(fh);
return;

