[Dart-dev] [5699] DART/trunk: Reset the focus on the oned_ensemble.m script ?\226?\128 ?\166 crosshairs now visible.

nancy at ucar.edu nancy at ucar.edu
Sun Apr 15 17:16:34 MDT 2012


Revision: 5699
Author:   thoar
Date:     2012-04-15 17:16:34 -0600 (Sun, 15 Apr 2012)
Log Message:
-----------
Reset the focus on the oned_ensemble.m script ?\226?\128?\166 crosshairs now visible.
The crosshairs in the twod_ensemble.m worked, so I just compared the differences
between the two files and took a lucky stab at it. I don't understand the code,
but the crosshairs work in both files. There is no functional change in the
twod_ensemble code.

I also aligned things to improve readability.

Modified Paths:
--------------
    DART/trunk/DART_LAB/matlab/oned_ensemble.m
    DART/trunk/DART_LAB/matlab/twod_ensemble.m

Property Changed:
----------------
    DART/trunk/models/bgrid_solo/work/
    DART/trunk/models/lorenz_63/work/
    DART/trunk/models/wrf/work/

-------------- next part --------------
Modified: DART/trunk/DART_LAB/matlab/oned_ensemble.m
===================================================================
--- DART/trunk/DART_LAB/matlab/oned_ensemble.m	2012-04-13 22:46:02 UTC (rev 5698)
+++ DART/trunk/DART_LAB/matlab/oned_ensemble.m	2012-04-15 23:16:34 UTC (rev 5699)
@@ -78,29 +78,29 @@
 handles.output = hObject;
 
 % Insert the ensemble structure into this
-handles.ens_size       = 0;
-handles.ens_members    = 0;
-handles.h_obs_plot     = 0;
-handles.h_update_ens   = 0;
-handles.h_ens_member   = 0;
-handles.h_obs_ast      = 0;
-handles.h_update_lines = 0;
-handles.observation    = 0;
-handles.obs_error_sd   = 0;
-handles.inflation      = 1.5;
-handles.plot_inflation = false;
-handles.h_inf_ens_member      = 0;
-handles.h_inf_up_ens   = 0;
-handles.h_inf_lines    = 0;
-handles.h_inf_axis     = 0;
+handles.ens_size         = 0;
+handles.ens_members      = 0;
+handles.h_obs_plot       = 0;
+handles.h_update_ens     = 0;
+handles.h_ens_member     = 0;
+handles.h_obs_ast        = 0;
+handles.h_update_lines   = 0;
+handles.observation      = 0;
+handles.obs_error_sd     = 0;
+handles.inflation        = 1.5;
+handles.plot_inflation   = false;
+handles.h_inf_ens_member = 0;
+handles.h_inf_up_ens     = 0;
+handles.h_inf_lines      = 0;
+handles.h_inf_axis       = 0;
 
 % Update handles structure
 guidata(hObject, handles);
 
 % Get the initial observation, obs_error_sd and inflation from the gui
-handles.observation = str2double(get(handles.edit_observation, 'String'));
+handles.observation  = str2double(get(handles.edit_observation,  'String'));
 handles.obs_error_sd = str2double(get(handles.edit_obs_error_sd, 'String'));
-handles.inflation = str2double(get(handles.edit_inflation, 'String'));
+handles.inflation    = str2double(get(handles.edit_inflation,    'String'));
 
 % Go ahead and plot the initial observational error distribution
 handles.h_obs_plot = plot_gaussian(handles.observation, handles.obs_error_sd, 1);
@@ -124,6 +124,11 @@
 % Update handles structure
 guidata(hObject, handles);
 
+% Reset focus to the menu gui window
+% Setting the axes clears the legend, gcbo restores focus
+axes(handles.axes1);
+
+
 % UIWAIT makes oned_ensemble wait for user response (see UIRESUME)
 % uiwait(handles.figure1);
 
@@ -153,22 +158,22 @@
 
 % Disable the update ensemble button and all other active buttons
 set(handles.pushbutton_update_ens, 'Enable', 'Off');
-set(handles.edit_observation, 'Enable', 'Off');
-set(handles.edit_obs_error_sd, 'Enable', 'Off');
-set(handles.edit_inflation, 'Enable', 'Off');
+set(handles.edit_observation,      'Enable', 'Off');
+set(handles.edit_obs_error_sd,     'Enable', 'Off');
+set(handles.edit_inflation,        'Enable', 'Off');
 
 % Clear out any old ensemble members if they exist
-set(handles.h_ens_member, 'Visible', 'off');
-set(handles.h_inf_ens_member, 'Visible', 'off');
+set(handles.h_ens_member,          'Visible', 'off');
+set(handles.h_inf_ens_member,      'Visible', 'off');
 
-set(handles.h_update_lines, 'Visible', 'off');
-set(handles.h_inf_lines, 'Visible', 'off');
-set(handles.h_inf_axis, 'Visible', 'off');
+set(handles.h_update_lines,        'Visible', 'off');
+set(handles.h_inf_lines,           'Visible', 'off');
+set(handles.h_inf_axis,            'Visible', 'off');
 
 % Turn off any old update points
-set(handles.h_update_ens, 'Visible', 'off');
-set(handles.h_inf_up_ens, 'Visible', 'off');
-set(handles.h_inf_ens_member, 'Visible', 'off');
+set(handles.h_update_ens,          'Visible', 'off');
+set(handles.h_inf_up_ens,          'Visible', 'off');
+set(handles.h_inf_ens_member,      'Visible', 'off');
 
 clear_labels(handles);
 
@@ -179,7 +184,7 @@
 upper = max(handles.observation + 3*handles.obs_error_sd, max(handles.ens_members));
 axis([lower upper -0.4 1]);
 
-set(gca, 'YTick', [0 0.2 0.4 0.6 0.8]);
+set(gca, 'YTick',      [0 0.2 0.4 0.6 0.8]);
 set(gca, 'YTickLabel', [0 0.2 0.4 0.6 0.8]);
 
 % Messages should start 1/10 of the way across the screen
@@ -239,21 +244,21 @@
 
 % Ensemble created, comupte mean and sd, clean up and return
 % Set the global gui storage
-handles.ens_size = ens_size;
+handles.ens_size    = ens_size;
 handles.ens_members = x;
 
 % Update handles structure
 guidata(hObject, handles);
 
 % Turn off the data entry messages
-set(h_click, 'Visible', 'off');
+set(h_click,  'Visible', 'off');
 set(h_finish, 'Visible', 'off');
 
 % Enable the update ensemble button
 set(handles.pushbutton_update_ens, 'Enable', 'On');
-set(handles.edit_observation, 'Enable', 'On');
-set(handles.edit_obs_error_sd, 'Enable', 'On');
-set(handles.edit_inflation, 'Enable', 'On');
+set(handles.edit_observation,      'Enable', 'On');
+set(handles.edit_obs_error_sd,     'Enable', 'On');
+set(handles.edit_inflation,        'Enable', 'On');
 
 
 %----------------------------------------------------------------------
@@ -269,21 +274,21 @@
 %        str2double(get(hObject,'String')) returns contents of edit_observation as a double
 
 % Turn off any old updated points
-set(handles.h_update_ens, 'Visible', 'off');
-set(handles.h_inf_up_ens, 'Visible', 'off');
+set(handles.h_update_ens,     'Visible', 'off');
+set(handles.h_inf_up_ens,     'Visible', 'off');
 set(handles.h_inf_ens_member, 'Visible', 'off');
 
 % Remove mean and sd of old posterior
 clear_labels(handles);
 
 % And the lines in between
-set(handles.h_update_lines, 'Visible', 'off');
-set(handles.h_inf_lines, 'Visible', 'off');
-set(handles.h_inf_axis, 'Visible', 'off');
+set(handles.h_update_lines,        'Visible', 'off');
+set(handles.h_inf_lines,           'Visible', 'off');
+set(handles.h_inf_axis,            'Visible', 'off');
 
 % Enable things that an error might have turned off
-set(handles.edit_obs_error_sd, 'Enable', 'on')
-set(handles.edit_inflation, 'Enable', 'on')
+set(handles.edit_obs_error_sd,     'Enable', 'on')
+set(handles.edit_inflation,        'Enable', 'on')
 set(handles.pushbutton_create_new, 'Enable', 'on')
 
 % Only enable the update ensemble pushbutton if an ensemble has been created
@@ -292,14 +297,14 @@
 end
 
 % Get the value of the observation
-if(isfinite(str2double(get(hObject, 'String'))))
+if(isfinite(     str2double(get(hObject, 'String'))))
    observation = str2double(get(hObject, 'String'));
 else
    set(handles.edit_observation, 'String', '???');
 
    % Disable other input to guarantee only one error at a time!
-   set(handles.edit_obs_error_sd, 'Enable', 'off')
-   set(handles.edit_inflation, 'Enable', 'off')
+   set(handles.edit_obs_error_sd,     'Enable', 'off')
+   set(handles.edit_inflation,        'Enable', 'off')
    set(handles.pushbutton_create_new, 'Enable', 'off')
    set(handles.pushbutton_update_ens, 'Enable', 'off')
    return
@@ -322,7 +327,7 @@
 upper = max(handles.observation + 3*handles.obs_error_sd, max(handles.ens_members));
 axis([lower upper -0.4 1]);
 
-set(gca, 'YTick', [0 0.2 0.4 0.6 0.8]);
+set(gca, 'YTick',      [0 0.2 0.4 0.6 0.8]);
 set(gca, 'YTickLabel', [0 0.2 0.4 0.6 0.8]);
 
 hold on
@@ -360,21 +365,21 @@
 %        str2double(get(hObject,'String')) returns contents of edit_obs_error_sd as a double
 
 % Turn off any old updated points
-set(handles.h_update_ens, 'Visible', 'off');
-set(handles.h_inf_up_ens, 'Visible', 'off');
-set(handles.h_inf_ens_member, 'Visible', 'off');
+set(handles.h_update_ens,          'Visible', 'off');
+set(handles.h_inf_up_ens,          'Visible', 'off');
+set(handles.h_inf_ens_member,      'Visible', 'off');
 
 % Remove mean and sd of old posterior
 clear_labels(handles);
 
 % And the lines in between
-set(handles.h_update_lines, 'Visible', 'off');
-set(handles.h_inf_lines, 'Visible', 'off');
-set(handles.h_inf_axis, 'Visible', 'off');
+set(handles.h_update_lines,        'Visible', 'off');
+set(handles.h_inf_lines,           'Visible', 'off');
+set(handles.h_inf_axis,            'Visible', 'off');
 
 % Enable things that an error might have turned off
-set(handles.edit_observation, 'Enable', 'on')
-set(handles.edit_inflation, 'Enable', 'on')
+set(handles.edit_observation,      'Enable', 'on')
+set(handles.edit_inflation,        'Enable', 'on')
 set(handles.pushbutton_create_new, 'Enable', 'on')
 
 % Only enable the update ensemble pushbutton if an ensemble has been created
@@ -383,15 +388,15 @@
 end
 
 % Get the value of the observation
-if(isfinite(str2double(get(hObject, 'String'))) && ...
-   str2double(get(hObject, 'String')) > 0)
+if(isfinite(      str2double(get(hObject, 'String'))) && ...
+                  str2double(get(hObject, 'String')) > 0)
    obs_error_sd = str2double(get(hObject, 'String'));
 else
    set(handles.edit_obs_error_sd, 'String', '???');
 
    % Disable other input to guarantee only one error at a time!
-   set(handles.edit_observation, 'Enable', 'off')
-   set(handles.edit_inflation, 'Enable', 'off')
+   set(handles.edit_observation,      'Enable', 'off')
+   set(handles.edit_inflation,        'Enable', 'off')
    set(handles.pushbutton_create_new, 'Enable', 'off')
    set(handles.pushbutton_update_ens, 'Enable', 'off')
    return
@@ -412,7 +417,7 @@
 
 set(handles.h_obs_plot, 'Color', 'r', 'Linestyle', '--', 'Linewidth', 2);
 
-set(gca, 'YTick', [0 0.2 0.4 0.6 0.8]);
+set(gca, 'YTick',      [0 0.2 0.4 0.6 0.8]);
 set(gca, 'YTickLabel', [0 0.2 0.4 0.6 0.8]);
 
 hold on
@@ -477,8 +482,8 @@
 % handles    structure with handles and user data (see GUIDATA)
 
 % Turn off any old points
-set(handles.h_update_ens, 'Visible', 'off');
-set(handles.h_inf_up_ens, 'Visible', 'off');
+set(handles.h_update_ens,     'Visible', 'off');
+set(handles.h_inf_up_ens,     'Visible', 'off');
 set(handles.h_inf_ens_member, 'Visible', 'off');
 
 % Remove mean and sd of old posterior
@@ -486,8 +491,8 @@
 
 % And the lines in between
 set(handles.h_update_lines, 'Visible', 'off');
-set(handles.h_inf_lines, 'Visible', 'off');
-set(handles.h_inf_axis, 'Visible', 'off');
+set(handles.h_inf_lines,    'Visible', 'off');
+set(handles.h_inf_axis,     'Visible', 'off');
 
 ensemble = handles.ens_members;
 
@@ -549,8 +554,8 @@
 
 % Update mean and sd of old posterior
 inf_prior_sd = std(inf_ens(1:handles.ens_size));
-set(handles.text9, 'String', ['Inflated = ', num2str(prior_mean)]);
-set(handles.text9, 'Visible', 'on');
+set(handles.text9,  'String', ['Inflated = ', num2str(prior_mean)]);
+set(handles.text9,  'Visible', 'on');
 set(handles.text10, 'String', ['Inflated = ', num2str(inf_prior_sd)]);
 set(handles.text10, 'Visible', 'on');
 
@@ -619,17 +624,16 @@
 function clear_labels(handles)
 
 % Turns off all labels except for the prior mean and SD
-set(handles.text9, 'Visible', 'off');
+set(handles.text7,  'Visible', 'off');
+set(handles.text8,  'Visible', 'off');
+set(handles.text9,  'Visible', 'off');
 set(handles.text10, 'Visible', 'off');
-set(handles.text8, 'Visible', 'off');
-set(handles.text7, 'Visible', 'off');
+set(handles.text11, 'Visible', 'off');
 set(handles.text12, 'Visible', 'off');
-set(handles.text11, 'Visible', 'off');
 
 
 
 
-
 function edit_inflation_Callback(hObject, eventdata, handles)
 % hObject    handle to edit_inflation (see GCBO)
 % eventdata  reserved - to be defined in a future version of MATLAB
@@ -639,21 +643,21 @@
 %        str2double(get(hObject,'String')) returns contents of edit_inflation as a double
 
 % Turn off any old updated points
-set(handles.h_update_ens, 'Visible', 'off');
-set(handles.h_inf_up_ens, 'Visible', 'off');
-set(handles.h_inf_ens_member, 'Visible', 'off');
+set(handles.h_update_ens,          'Visible', 'off');
+set(handles.h_inf_up_ens,          'Visible', 'off');
+set(handles.h_inf_ens_member,      'Visible', 'off');
 
 % Remove mean and sd of old posterior
 clear_labels(handles);
 
 % And the lines in between
-set(handles.h_update_lines, 'Visible', 'off');
-set(handles.h_inf_lines, 'Visible', 'off');
-set(handles.h_inf_axis, 'Visible', 'off');
+set(handles.h_update_lines,        'Visible', 'off');
+set(handles.h_inf_lines,           'Visible', 'off');
+set(handles.h_inf_axis,            'Visible', 'off');
 
 % Enable things that an error might have turned off
-set(handles.edit_observation, 'Enable', 'on')
-set(handles.edit_obs_error_sd, 'Enable', 'on')
+set(handles.edit_observation,      'Enable', 'on')
+set(handles.edit_obs_error_sd,     'Enable', 'on')
 set(handles.pushbutton_create_new, 'Enable', 'on')
 
 % Only enable the update ensemble pushbutton if an ensemble has been created
@@ -662,15 +666,15 @@
 end
 
 % Get the value of the observation
-if(isfinite(str2double(get(hObject, 'String'))) && ...
-   str2double(get(hObject, 'String')) > 0)
+if(isfinite(   str2double(get(hObject, 'String'))) && ...
+               str2double(get(hObject, 'String')) > 0)
    inflation = str2double(get(hObject, 'String'));
 else
    set(handles.edit_inflation, 'String', '???');
 
    % Disable other input to guarantee only one error at a time!
-   set(handles.edit_observation, 'Enable', 'off')
-   set(handles.edit_obs_error_sd, 'Enable', 'off')
+   set(handles.edit_observation,      'Enable', 'off')
+   set(handles.edit_obs_error_sd,     'Enable', 'off')
    set(handles.pushbutton_create_new, 'Enable', 'off')
    set(handles.pushbutton_update_ens, 'Enable', 'off')
    return
@@ -691,7 +695,7 @@
 
 set(handles.h_obs_plot, 'Color', 'r', 'Linestyle', '--', 'Linewidth', 2);
 
-set(gca, 'YTick', [0 0.2 0.4 0.6 0.8]);
+set(gca, 'YTick',      [0 0.2 0.4 0.6 0.8]);
 set(gca, 'YTickLabel', [0 0.2 0.4 0.6 0.8]);
 
 hold on

Modified: DART/trunk/DART_LAB/matlab/twod_ensemble.m
===================================================================
--- DART/trunk/DART_LAB/matlab/twod_ensemble.m	2012-04-13 22:46:02 UTC (rev 5698)
+++ DART/trunk/DART_LAB/matlab/twod_ensemble.m	2012-04-15 23:16:34 UTC (rev 5699)
@@ -66,25 +66,26 @@
 handles.output = hObject;
 
 % Insert the ensemble structure into this
-handles.ens_size = 0;
-handles.ens_members = 0;
-handles.h_update_ens = 0;
-handles.h_ens_member = 0;
-handles.h_best_fit = 0;
+handles.ens_size        = 0;
+handles.ens_members     = 0;
+handles.h_update_ens    = 0;
+handles.h_ens_member    = 0;
+handles.h_best_fit      = 0;
 handles.h_marg_obs_plot = 0;
-handles.h_obs_ast = 0;
-handles.h_obs_marg = 0;
-handles.h_gui_marg = 0;
-handles.h_unobs = 0;
-handles.h_marg = 0;
-handles.h_marg_update = 0;
-handles.h_marg_inc = 0;
-handles.h_marg_state = 0;
-handles.h_state_inc = 0;
-handles.h_joint_update = 0;
-handles.h_joint_inc = 0;
-handles.h_correl = 0;
-handles.first_correl = true;
+handles.h_obs_ast       = 0;
+handles.h_obs_marg      = 0;
+handles.h_gui_marg      = 0;
+handles.h_unobs         = 0;
+handles.h_marg          = 0;
+handles.h_marg_update   = 0;
+handles.h_marg_inc      = 0;
+handles.h_marg_state    = 0;
+handles.h_state_inc     = 0;
+handles.h_joint_update  = 0;
+handles.h_joint_inc     = 0;
+handles.h_correl        = 0;
+handles.first_correl    = true;
+
 % Also include the subplot handles r1, r2, r3
 handles.r1 = 0;
 handles.r2 = 0;
@@ -94,10 +95,10 @@
 guidata(hObject, handles);
 
 % Go ahead and plot the initial observational error distribution
-h_observation = get(handles.edit1);
+h_observation  = get(handles.edit1);
 h_obs_error_sd = get(handles.edit2);
-observation = str2double(h_observation.String);
-obs_error_sd = str2double(h_obs_error_sd.String);
+observation    = str2double(h_observation.String);
+obs_error_sd   = str2double(h_obs_error_sd.String);
 
 % Plot this on the marginal plot on the gui figure
 handles.h_marg_obs_plot = plot_gaussian(observation, obs_error_sd, 1);
@@ -118,7 +119,6 @@
 % Plot an axis; display is fixed from x = 0 to 10
 plot([0 10], [0 0], 'k', 'LineWidth', 2);
 
-
 % Setup the joint distribution plot plus the two marginals
 figure(1)
 


Property changes on: DART/trunk/models/bgrid_solo/work
___________________________________________________________________
Added: svn:ignore
   + .cppdefs
Makefile



Property changes on: DART/trunk/models/lorenz_63/work
___________________________________________________________________
Added: svn:ignore
   + .cppdefs
Makefile



Property changes on: DART/trunk/models/wrf/work
___________________________________________________________________
Added: svn:ignore
   + .cppdefs



More information about the Dart-dev mailing list