function cdata=load_cruise(cruiseid)
% LOAD_CRUISE - load a cruise database, given the cruiseid.
% 
% CTD Calibration toolbox.
%
% INPUT cruiseid
%	
% OUTPUT cdata	variable with the cruise data 
%	
%USAGE -	cdata=load_cruise(cruiseid)
%
%EXPLANATION -	
% Need to load a cruise database into a variable even if we are not in 
% the directory structure. Possibly reinventing the wheel?
%
%SEE ALSO -	
%

%AUTHORS - 	MATLAB code by c.m.duncombe rae
%
%CREATED - 2008/02/22
% 
% VERSION:
%	$Revision: 1.1 $
%	$Date: 2008/02/22 18:58:36 $
%	$Id: load_cruise.m,v 1.1 2008/02/22 18:58:36 duncombe Exp duncombe $
%
%CHANGELOG -	
%  2008/02/22
%	* and at last I begin to see the point of the preferences!
%
%

if nargin==0, cruiseid=getcruiseid; end;
if isempty(cruiseid), cruiseid=getcruiseid; end;

% Retrieve the necessary preferences for this cruise
prefs=getpref;
group = group_name(cruiseid);

% There needs to be a lot of checking for whether these things all exist,
% in the meantime, go with what works!

cdata=load([prefs.(group).calibration_dir '/' cruiseid '_db']);

return;

