Newer
Older

jacques.grelet_ird.fr
committed
mean_psal(i) = tsg.levitus.data.WOA01_MEAN_PSAL(ilat,ilon,1);
std_temp(i) = tsg.levitus.data.WOA01_STD_TEMP(ilat,ilon,1);
std_psal(i) = tsg.levitus.data.WOA01_STD_PSAL(ilat,ilon,1);

jacques.grelet_ird.fr
committed
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
% Plot mean salinity climatology
hLine1.meanClim = line( ...
time, mean_psal,'Linestyle', '-', 'Color','k');
% Plot 2 standard deviation
hLine1.stdClimPlus = line( ...
time, mean_psal + 3 * std_psal ,'Linestyle', '-', 'Color','r');
hLine1.stdClimMinus = line( ...
time, mean_psal - 3 * std_psal ,'Linestyle', '-', 'Color','r');
% Plot mean temperature climatology
axes( hPlotAxes(2));
hLine2.meanClim = line( ...
time, mean_temp,'Linestyle', '-', 'Color','k');
hLine2.stdClimPlus = line( ...
time, mean_temp + 3 * std_temp ,'Linestyle', '-', 'Color','r');
hLine2.stdClimMinus = line( ...
time, mean_temp - 3 * std_temp ,'Linestyle', '-', 'Color','r');
% Store the handle of the bucketline
% ----------------------------------
set( hPlotAxes(1), 'UserData', hLine1 );
set( hPlotAxes(2), 'UserData', hLine2 );
end
else
set( hClimPushtool, 'UserData', 'off' );
% The bucket pushbutton has been pressed again :
% Delete the bucket on figure
% ----------------------------------------------
hLine1 = get( hPlotAxes(1), 'UserData');
hLine2 = get( hPlotAxes(2), 'UserData');
% bug......
try
delete(hLine1.stdClimMinus);
delete(hLine1.stdClimPlus);
delete(hLine1.meanClim);
delete(hLine2.stdClimMinus);
delete(hLine2.stdClimPlus);
delete(hLine2.meanClim);
catch
end

jacques.grelet_ird.fr
committed
end

jacques.grelet_ird.fr
committed
% -------------------------------------------------------------------
function HeaderMenuCallback(hObject, eventdata)
% Callback function run when the headerForm tool bar item is selected

jacques.grelet_ird.fr
committed
% call header form function
% -------------------------
headerForm(hMainFig);
end
% -------------------------------------------------------------------
function SaveMenuCallback(hObject, eventdata)
% Callback function run when the Save menu item is selected

jacques.grelet_ird.fr
committed
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
% fill or append header form
% -------------------------
error = headerForm(hMainFig);
% if user press continue button, ask for netcdf file
% ------------------------------------------------
if error ~= -1
[fileName, pathName, filterIndex] = uiputfile('*.nc', ...
'Save file name');
% if user press cancel button, all var set to zero
% ------------------------------------------------
if fileName == 0
return;
end
% Pointer set to watch during reading and plotting
% ------------------------------------------------
set( hMainFig, 'Pointer', 'watch' );
% flushes the event queue and updates the closed uiputfile window
% ---------------------------------------------------------------
drawnow;
% write netcdf file
% -----------------
fileName = [pathName fileName];
error = writeTSGDataNetCDF( hMainFig, fileName );
% Pointer reset to arrow
% ----------------------
set( hMainFig, 'Pointer', 'arrow' );
% Check for a writing pb to NetCDF
% must to be rewriting
% --------------------------------
if error == -1
warning(['NetCDF writing error:' fileName]);

jacques.grelet_ird.fr
committed
end

jacques.grelet_ird.fr
committed
% -----------------------------------------------------------------
function QuitMenuCallback(hObject, eventdata)
% Callback function run when the Quit menu item is selected

jacques.grelet_ird.fr
committed
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
% If the data have been modified and not save, the program
% propose to save the data
% --------------------------------------------------------
if strcmp( get( hSaveMenu, 'UserData' ), 'on')
selection = ...
questdlg('The file has been modified. Do you want to save it ?',...
'Save before Quit?',...
'Yes', 'No', 'Yes');
if strcmp(selection, 'Yes')
return;
else
QuitProgram;
end
else
selection = ...
questdlg(['Quit ' get(hMainFig, 'Name') '?'],...
['Quit ' get(hMainFig, 'Name') '?'],...
'Yes', 'No', 'Yes');
if strcmp(selection, 'No')
return;
else
QuitProgram;
end

jacques.grelet_ird.fr
committed
end

jacques.grelet_ird.fr
committed
end
% ----------------------------------------------------------------

jacques.grelet_ird.fr
committed
function QuitProgram(hObject, eventdata)
delete(hMainFig);

jacques.grelet_ird.fr
committed

jacques.grelet_ird.fr
committed
% reset Matlab search path to default
rmpath( [DEFAULT_PATH_FILE filesep 'tsg_util'] );
rmpath( [DEFAULT_PATH_FILE filesep 'tsg_data'] );
rmpath( [DEFAULT_PATH_FILE filesep 'tsg_io'] );

jacques.grelet_ird.fr
committed
rehash;
end

jacques.grelet_ird.fr
committed