Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Calibration
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Calibration
Commits
aeca0ace
Commit
aeca0ace
authored
Aug 01, 2018
by
Peter Jansweijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
repaired various simple typos
parent
5e3f3f2b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
LeCroy8254.py
sw/lib/LeCroy8254.py
+10
-12
No files found.
sw/lib/LeCroy8254.py
View file @
aeca0ace
...
...
@@ -31,7 +31,7 @@ Options:
-c 1234 channel number [default 1234]
-n <number> number of averages [default: 1]
-o <dir> optional directory for output file storage [default: "data/"]
-m <number> number of measurments
-m <number> number of measur
e
ments
-h --help Show help
"""
...
...
@@ -53,14 +53,12 @@ import matplotlib.pyplot as plt
def
get_waveforms
(
scope
,
channels
=
[
1
,
2
,
3
,
4
],
num_avg
=
1
,
output_dir
=
"data"
):
"""
!!! For python 3.x !!!
Measure and save LeCroy WaveRunner 8254M-MS waveforms
scope -- instance of python-vxi connected to LeCroy8254 oscilloscope
channels -- channels that are going to be measured for example '1,2'
num_avg -- the number of aver
i
ges taken by the oscilloscope before
output_dir -- name of the directory where measured waveform files wil be stored
num_avg -- the number of aver
a
ges taken by the oscilloscope before
output_dir -- name of the directory where measured waveform files wil
l
be stored
the file output format is as described below:
...
...
@@ -87,7 +85,7 @@ def get_waveforms(scope, channels=[1,2,3,4],num_avg=1,output_dir="data"):
:
----------------------------------
"preamble" data is readable ASCII
"waveform_desc" is coded according to the LeCroy template that can be quer
r
ied by
"waveform_desc" is coded according to the LeCroy template that can be queried by
print(scope.ask("TEMPLATE?"))
"waveform_data" is binary data
"""
...
...
@@ -102,7 +100,7 @@ def get_waveforms(scope, channels=[1,2,3,4],num_avg=1,output_dir="data"):
scope
.
write
(
"COMM_ORDER LO"
)
# i.e. LSB first
#scope.write("WAVEFORM_SETUP SP,0,NP,"+str(data_record_len)+",FP,0,SN,0")
scope
.
write
(
"WAVEFORM_SETUP SP,0,NP,0,FP,0,SN,0"
)
# Always use the ma
s
imum record length
scope
.
write
(
"WAVEFORM_SETUP SP,0,NP,0,FP,0,SN,0"
)
# Always use the ma
x
imum record length
# Sparing (SP=0: send all data points)
# Number of points (NP=0: send all data points)
# First point (FP=0)
...
...
@@ -237,7 +235,7 @@ def get_preamble_from_file(data_file, date_in_file, time_in_file):
"""
This function takes a file pointer to the data file and reads a "LeCroy"
preamble portion of the file. While the data is being read, it is interpre
d
ed
preamble portion of the file. While the data is being read, it is interpre
t
ed
and put into a format that is used in Tjeerd Pinkerts correlation classes.
The latter format is inspired on Agilent DSO type oscilloscopes.
...
...
@@ -531,7 +529,7 @@ def check_waveforms(waveform_data):
"""
This function checks for the consistency of the captured waveform.
waveform_data -- <type 'dict'> waveform_data (as returned by funtion "file_to_waveform")
waveform_data -- <type 'dict'> waveform_data (as returned by fun
c
tion "file_to_waveform")
returns: number of points (of the first waveform found)
"""
...
...
@@ -543,7 +541,7 @@ def check_waveforms(waveform_data):
first
=
False
channel
=
ch
points
=
waveform_data
[
ch
][
"preamble"
][
"points"
]
print
(
"Info: Record Length is"
,
points
,
"samp
el
s"
)
print
(
"Info: Record Length is"
,
points
,
"samp
le
s"
)
count
=
waveform_data
[
ch
][
"preamble"
][
"count"
]
x_inc
=
waveform_data
[
ch
][
"preamble"
][
"x_increment"
]
print
(
"Info: Sample Period is"
,
x_inc
)
...
...
@@ -561,7 +559,7 @@ def check_waveforms(waveform_data):
print
(
"### WARNING! Different time base sample interval!"
)
print
(
" Channel:"
,
channel
,
x_inc
)
print
(
" Channel:"
,
ch
,
waveform_data
[
ch
][
"preamble"
][
"x_increment"
])
print
(
" You may want to check the 'Interp
lo
ation' setting in the 'pre-Processing' tab of the oscilloscopes channel setup"
)
print
(
" You may want to check the 'Interp
ol
ation' setting in the 'pre-Processing' tab of the oscilloscopes channel setup"
)
if
waveform_data
[
ch
][
"preamble"
][
"x_display_range"
]
!=
timebase
:
print
(
"### WARNING! Different time base!"
)
print
(
" Channel:"
,
channel
,
timebase
)
...
...
@@ -768,7 +766,7 @@ Options:
-c 1234 channel number [default 1234]
-n <number> number of averages [default: 1]
-o <dir> optional directory for output file storage [default: "data/"]
-m <number> number of measurments
-m <number> number of measur
e
ments
-h --help Show help
"""
...
...
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