Commit e854b764 authored by Unknown's avatar Unknown
Browse files

BE Loops update

Update to BE Processing notebook with loop results plotting.
Added needed function to plot_utils and be_viz_utils for new plots.
parent ee970788
......@@ -11,11 +11,11 @@
## Configure the notebook
%% Cell type:code id: tags:
``` python
# !pip install -U numpy matplotlib Ipython ipywidgets pycroscopy
!pip install -U numpy matplotlib Ipython ipywidgets pycroscopy
# Ensure python 3 compatibility
from __future__ import division, print_function, absolute_import
# Import necessary libraries:
......@@ -28,15 +28,14 @@
import h5py
# Visualization:
import matplotlib.pyplot as plt
import matplotlib.widgets as mpw
from IPython.display import display
from IPython.display import display, clear_output
import ipywidgets as widgets
# Finally, pycroscopy itself
sys.path.append('..')
import pycroscopy as px
# set up notebook to show plots within the notebook
% matplotlib inline
```
......@@ -251,11 +250,11 @@
px.be_viz_utils.jupyter_visualize_beps_sho(sho_dset, step_chan)
except:
raise
print('There was a problem with the interactive visualizer')
use_static_viz_func = True
if use_static_viz_func:
else:
# show plots of SHO results vs. applied bias
px.be_viz_utils.visualize_sho_results(sho_dset, show_plots=True,
save_plots=False)
```
......@@ -284,10 +283,11 @@
else:
loop_success = True
print('Taking previously computed loop fits')
h5_loop_guess = h5_loop_group[-1]['Guess']
h5_loop_fit = h5_loop_group[-1]['Fit']
h5_loop_group = h5_loop_fit.parent
```
%% Cell type:markdown id: tags:
## Prepare datasets for visualization
......@@ -345,12 +345,24 @@
We will now load the loop parameters caluculated from the fit and plot them.
%% Cell type:code id: tags:
``` python
loop_mets = h5_loop_group[-1]['Fit_Loop_Parameters']
px.viz.be_viz_utils.jupyter_visualize_parameter_maps(loop_mets)
h5_loop_parameters = h5_loop_group['Fit_Loop_Parameters']
px.viz.be_viz_utils.jupyter_visualize_parameter_maps(h5_loop_parameters)
```
%% Cell type:code id: tags:
``` python
map_parm = 'Work of Switching'
plot_cycle = 0
plot_position = (int(pos_dims[0]/2), int(pos_dims[1]/2))
plot_bias_step = 0
fig = px.viz.be_viz_utils.plot_loop_sho_raw_comparison(h5_loop_parameters, map_parm, plot_cycle, plot_position, plot_bias_step)
display(px.viz.plot_utils.save_fig_filebox_button(fig, 'plot.png'))
display(fig)
```
%% Cell type:markdown id: tags:
## Save and close
......
This diff is collapsed.
......@@ -1491,4 +1491,4 @@ def save_fig_filebox_button(fig, filename):
save_button.on_click(_save_fig)
# return widget_box
return widget_box
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment