Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Vasudevan, Rama K
pycroscopy
Commits
7a5d0588
Commit
7a5d0588
authored
Jul 02, 2020
by
ssomnath
Browse files
More informative value error when bin waveform type does not match
parent
7e6ac8de
Changes
1
Hide whitespace changes
Inline
Side-by-side
pycroscopy/io/translators/df_utils/be_utils.py
View file @
7a5d0588
...
...
@@ -1145,8 +1145,10 @@ def createSpecVals(udvs_mat, spec_inds, bin_freqs, bin_wfm_type, parm_dict,
"""
Get bins for current step based on waveform
"""
print
(
'bin_wfm_type: {}, waveform[step]: {}'
.
format
(
bin_wfm_type
,
wave_form
[
step
]))
this_wave
=
np
.
where
(
bin_wfm_type
==
wave_form
[
step
])[
0
]
if
len
(
this_wave
)
<
1
:
raise
ValueError
(
'Waveform type: {} not found in bin_wfm_type:'
' {}'
.
format
(
wave_form
[
step
],
bin_wfm_type
))
# print('\t' * 6 + '{}'.format(inSpecVals[step]))
suffix
=
[
inSpecVals
[
step
][
0
]]
if
field_type
==
'in and out-of-field'
:
...
...
@@ -1160,8 +1162,7 @@ def createSpecVals(udvs_mat, spec_inds, bin_freqs, bin_wfm_type, parm_dict,
''
.
format
(
step
,
numsteps
,
suffix
))
print
(
'
\t
'
*
5
+
'this_wave of shape: {}'
''
.
format
(
this_wave
.
shape
))
if
len
(
this_wave
)
<
1
:
raise
ValueError
(
'Too few bins in this wave. Something wrong!'
)
"""
Loop over bins
"""
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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