Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Vasudevan, Rama K
pycroscopy
Commits
c425fc98
Commit
c425fc98
authored
Aug 09, 2020
by
ssomnath
Browse files
Using sidpy instead of pyUSID wherever appropriate
parent
4fe06d7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
jupyter_notebooks/BE_Processing.ipynb
View file @
c425fc98
...
...
@@ -26,11 +26,11 @@
```
python
# Make sure needed packages are installed and up-to-date
import
sys
!
conda
install
--
yes
--
prefix
{
sys
.
prefix
}
numpy
scipy
matplotlib
scikit
-
learn
Ipython
ipywidgets
h5py
!
{
sys
.
executable
}
-
m
pip
install
-
U
--
no
-
deps
pycroscopy
# this will automatically install pyUSID as well
!
{
sys
.
executable
}
-
m
pip
install
-
U
--
no
-
deps
pycroscopy
# this will automatically install
sidpy and
pyUSID as well
```
%% Cell type:code id: tags:
```
python
...
...
@@ -104,11 +104,11 @@
You can select desired file type by choosing the second option in the pull down menu on the bottom right of the file window
%% Cell type:code id: tags:
```
python
input_file_path
=
u
sid
.
io_utils
.
file_dialog
(
caption
=
'Select translated .h5 file or raw experiment data'
,
input_file_path
=
sid
py
.
io
.
interface
_utils
.
file_dialog
(
caption
=
'Select translated .h5 file or raw experiment data'
,
file_filter
=
'Parameters for raw BE data (*.txt *.mat *xls *.xlsx);;
\
Translated file (*.h5)'
)
(
data_dir
,
filename
)
=
os
.
path
.
split
(
input_file_path
)
...
...
@@ -152,17 +152,17 @@
%% Cell type:code id: tags:
```
python
print
(
'Datasets and datagroups within the file:
\n
------------------------------------'
)
u
sid
.
hdf_utils
.
print_tree
(
h5_file
)
sid
py
.
hdf
.
hdf_utils
.
print_tree
(
h5_file
)
print
(
'
\n
The main dataset:
\n
------------------------------------'
)
print
(
h5_main
)
print
(
'
\n
Metadata or attributes in the measurement datagroup
\n
------------------------------------'
)
for
key
,
val
in
u
sid
.
hdf_utils
.
get_attributes
(
h5_main
.
parent
.
parent
).
items
():
for
key
,
val
in
sid
py
.
hdf
.
hdf_utils
.
get_attributes
(
h5_main
.
parent
.
parent
).
items
():
print
(
'{} : {}'
.
format
(
key
,
val
))
```
%% Cell type:markdown id: tags:
...
...
@@ -177,29 +177,29 @@
pos_labels
=
h5_main
.
pos_dim_labels
print
(
pos_labels
,
pos_dims
)
h5_meas_grp
=
h5_main
.
parent
.
parent
parm_dict
=
u
sid
.
hdf_utils
.
get_attributes
(
h5_meas_grp
)
parm_dict
=
sid
py
.
hdf
.
hdf_utils
.
get_attributes
(
h5_meas_grp
)
expt_type
=
u
sid
.
hdf_utils
.
get_attr
(
h5_file
,
'data_type'
)
expt_type
=
sid
py
.
hdf
.
hdf_utils
.
get_attr
(
h5_file
,
'data_type'
)
is_ckpfm
=
expt_type
==
'cKPFMData'
if
is_ckpfm
:
num_write_steps
=
parm_dict
[
'VS_num_DC_write_steps'
]
num_read_steps
=
parm_dict
[
'VS_num_read_steps'
]
num_fields
=
2
if
expt_type
!=
'BELineData'
:
vs_mode
=
u
sid
.
hdf_utils
.
get_attr
(
h5_meas_grp
,
'VS_mode'
)
vs_mode
=
sid
py
.
hdf
.
hdf_utils
.
get_attr
(
h5_meas_grp
,
'VS_mode'
)
try
:
field_mode
=
u
sid
.
hdf_utils
.
get_attr
(
h5_meas_grp
,
'VS_measure_in_field_loops'
)
field_mode
=
sid
py
.
hdf
.
hdf_utils
.
get_attr
(
h5_meas_grp
,
'VS_measure_in_field_loops'
)
except
KeyError
:
print
(
'field mode could not be found. Setting to default value'
)
field_mode
=
'out-of-field'
try
:
vs_cycle_frac
=
u
sid
.
hdf_utils
.
get_attr
(
h5_meas_grp
,
'VS_cycle_fraction'
)
vs_cycle_frac
=
sid
py
.
hdf
.
hdf_utils
.
get_attr
(
h5_meas_grp
,
'VS_cycle_fraction'
)
except
KeyError
:
print
(
'VS cycle fraction could not be found. Setting to default value'
)
vs_cycle_frac
=
'full'
```
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment