function print_cal_figures(cruiseid, fh)
% PRINT_CAL_FIGURES - print output figures from FS_apply_calibration.m
%
% fh - figure handles (default=[1:9])
%

% 
% VERSION: 
%	$Revision: 1.8 $
%	$Date: 2008/02/18 19:41:42 $
%	$Id: print_cal_figures.m,v 1.8 2008/02/18 19:41:42 duncombe Exp duncombe $
%
% CHANGELOG: 
%  2007/12/17 - CMDR
%	* read cruise id from the file in the current directory
%  2008/01/01
%	* save the figures to the figure directory of the current folder
%	* there were 9 stanzas of nearly identical code. Turned it into a loop.
%


%%%%%%%%%%% CMDR read cruiseid if we can
if nargin==0, cruiseid=getcruiseid; end;
if isempty(cruiseid), cruiseid=getcruiseid; end;
%%%%%%%%%%%
% Where to save the figures?
%%%%%%%%%% CMDR
% c_path=['C:\CTD_calibration\',cruiseid,'\figures\'];
p=pwd; dir_del=p(1);
c_path=['figures' dir_del ];
if ~exist('fh'), fh=[]; end;
if isempty(fh),  fh=1:9; end;

for i = 1:length(fh),
	figure(fh(i));
	fn=sprintf('%02i',i-1);
	eval(['print -depsc ',c_path,'FS_' fn ]);
end;

% Close all the figures after saving the necessary ones
%  close all
close(fh);
  
clear all;
return;

