Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Vasudevan, Rama K
pycroscopy
Commits
2d6c5c36
Commit
2d6c5c36
authored
Aug 16, 2018
by
Unknown
Browse files
GLineTranslator update
Fixed error that could occur if the bigtime_00 file was not first in the dictionary.
parent
c55dd976
Changes
1
Hide whitespace changes
Inline
Side-by-side
pycroscopy/io/translators/gmode_line.py
View file @
2d6c5c36
...
...
@@ -123,7 +123,8 @@ class GLineTranslator(Translator):
pos_desc
=
Dimension
(
'Y'
,
'm'
,
np
.
arange
(
self
.
num_rows
))
spec_desc
=
Dimension
(
'Excitation'
,
'V'
,
np
.
tile
(
VALUES_DTYPE
(
be_wave
),
num_cols
))
for
f_index
in
data_paths
.
keys
():
first_dat
=
True
for
key
in
data_paths
.
keys
():
# Now that the file has been created, go over each raw data file:
# 1. write all ancillary data. Link data. 2. Write main data sequentially
...
...
@@ -133,13 +134,16 @@ class GLineTranslator(Translator):
only one excitation waveform is used"""
chan_grp
=
create_indexed_group
(
meas_grp
,
'Channel'
)
if
len
(
data_paths
)
>
1
and
f_index
==
0
:
# All positions and spectra are shared between channels
h5_pos_inds
,
h5_pos_vals
=
write_ind_val_dsets
(
meas_grp
,
pos_desc
,
is_spectral
=
False
)
h5_spec_inds
,
h5_spec_vals
=
write_ind_val_dsets
(
meas_grp
,
spec_desc
,
is_spectral
=
True
)
elif
len
(
data_paths
)
==
1
:
h5_pos_inds
,
h5_pos_vals
=
write_ind_val_dsets
(
chan_grp
,
pos_desc
,
is_spectral
=
False
)
h5_spec_inds
,
h5_spec_vals
=
write_ind_val_dsets
(
chan_grp
,
spec_desc
,
is_spectral
=
True
)
if
first_dat
:
if
len
(
data_paths
)
>
1
:
# All positions and spectra are shared between channels
h5_pos_inds
,
h5_pos_vals
=
write_ind_val_dsets
(
meas_grp
,
pos_desc
,
is_spectral
=
False
)
h5_spec_inds
,
h5_spec_vals
=
write_ind_val_dsets
(
meas_grp
,
spec_desc
,
is_spectral
=
True
)
elif
len
(
data_paths
)
==
1
:
h5_pos_inds
,
h5_pos_vals
=
write_ind_val_dsets
(
chan_grp
,
pos_desc
,
is_spectral
=
False
)
h5_spec_inds
,
h5_spec_vals
=
write_ind_val_dsets
(
chan_grp
,
spec_desc
,
is_spectral
=
True
)
first_dat
=
False
else
:
pass
...
...
@@ -151,7 +155,7 @@ class GLineTranslator(Translator):
chunks
=
(
1
,
self
.
points_per_pixel
),
dtype
=
np
.
float16
)
# Now transfer scan data in the dat file to the h5 file:
self
.
_read_data
(
data_paths
[
f_index
],
h5_main
)
self
.
_read_data
(
data_paths
[
key
],
h5_main
)
h5_f
.
close
()
print
(
'G-Line translation complete!'
)
...
...
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