group_name: Get the preference group name for a given cruiseid. AOML/PhOD CTDCalibration toolbox. USAGE: groupName = group_name(cruiseid) INPUT: cruiseid (string): valid cruiseid. OUTPUT: groupName (string): the corresponding group name. DESCRIPTION: This function creates the group name to be used with the preference management functions in the CTDCalibration toolbox. It does not check to see if the given cruiseid is registered in the preferences database, it only returns a valid groupname for future or current use. The cruiseid is altered if it contains spaces. Leading and trailing spaces are deleted, multiple spaces are deleted and the remaining single spaces are replaced by underscores. AUTHOR: Derrick Snowden NOAA/AOML/PhOD Tue May 11 11:23:37 EDT 2004 SEE ALSO: register_cruise, ctdgetpref, ctdsetpref, ctdshowpref DEPENDENCIES: EXAMPLES: theGroupName = group_name('stc02') REFERENCES:
0001 function groupName = group_name(cruiseid) 0002 % group_name: Get the preference group name for a given cruiseid. 0003 % 0004 % AOML/PhOD CTDCalibration toolbox. 0005 % 0006 % USAGE: groupName = group_name(cruiseid) 0007 % 0008 % INPUT: cruiseid (string): valid cruiseid. 0009 % 0010 % OUTPUT: groupName (string): the corresponding group name. 0011 % 0012 % DESCRIPTION: This function creates the group name to be used with 0013 % the preference management functions in the CTDCalibration toolbox. 0014 % It does not check to see if the given cruiseid is registered in the preferences 0015 % database, it only returns a valid groupname for future or current use. 0016 % The cruiseid is altered if it contains spaces. Leading and trailing spaces are deleted, 0017 % multiple spaces are deleted and the remaining single spaces are replaced by 0018 % underscores. 0019 % 0020 % AUTHOR: Derrick Snowden 0021 % NOAA/AOML/PhOD 0022 % Tue May 11 11:23:37 EDT 2004 0023 % 0024 % SEE ALSO: register_cruise, ctdgetpref, ctdsetpref, ctdshowpref 0025 % 0026 % DEPENDENCIES: 0027 % 0028 % EXAMPLES: 0029 % theGroupName = group_name('stc02') 0030 % 0031 % REFERENCES: 0032 0033 error(nargchk(1,1,nargin)); 0034 0035 % if cruiseid is empty, we cannot recover...punt. 0036 if isempty(cruiseid) 0037 error('cruiseid must be nonempty.'); 0038 end 0039 0040 % NOTE % This may give unpredictable results and may be removed. 0041 if ~ischar(cruiseid) 0042 cruiseid = char(cruiseid); 0043 end 0044 0045 % pretty things up. 0046 cruiseid = ddewhite(cruiseid); 0047 cruiseid = strrep(cruiseid,' ','_'); 0048 0049 groupName = [cruiseid,'_ctd_calibration']; 0050 0051 return 0052