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
c13bd095
Commit
c13bd095
authored
Jun 05, 2023
by
Peter Jansweijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only consider fswp dat files (and skip others like already saved png files in the same directory)
parent
53bd2af7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
20 deletions
+23
-20
RohdeSchwarz_FSWP.py
sw/phase_noise_plot/RohdeSchwarz_FSWP.py
+23
-20
No files found.
sw/phase_noise_plot/RohdeSchwarz_FSWP.py
View file @
c13bd095
...
...
@@ -246,27 +246,30 @@ if __name__ == "__main__":
# add plot title if input with -t
if
plot_title
!=
""
:
ax
.
set_title
(
plot_title
)
# scan all files in the direcory
for
filename
in
os
.
listdir
(
data_dir
):
fswp_data
=
file_to_fswp_plot
(
os
.
path
.
join
(
data_dir
,
filename
))
if
only_trace1
:
x
=
fswp_data
[
"trace"
][
1
][
0
]
y
=
fswp_data
[
"trace"
][
1
][
1
]
if
fswp_data
[
"window"
]
==
"Noise Spectrum"
:
trace
=
ax
.
semilogx
(
x
,
y
,
label
=
filename
+
str
(
" [1]"
))
else
:
trace
=
ax
.
plot
(
x
,
y
,
label
=
filename
+
str
(
" [1]"
))
lns
=
lns
+
trace
else
:
for
trace_nr
in
fswp_data
[
"trace"
]
.
keys
():
x
=
fswp_data
[
"trace"
][
trace_nr
][
0
]
y
=
fswp_data
[
"trace"
][
trace_nr
][
1
]
if
fswp_data
[
"window"
]
==
"Noise Spectrum"
:
trace
=
ax
.
semilogx
(
x
,
y
,
label
=
filename
+
str
(
" ["
)
+
str
(
trace_nr
)
+
(
"]"
))
else
:
trace
=
ax
.
plot
(
x
,
y
,
label
=
filename
+
str
(
" ["
)
+
str
(
trace_nr
)
+
(
"]"
))
lns
=
lns
+
trace
# but only consider FSWP DAT files
if
(
".DAT"
in
filename
)
or
(
".dat"
in
filename
):
fswp_data
=
file_to_fswp_plot
(
os
.
path
.
join
(
data_dir
,
filename
))
if
only_trace1
:
x
=
fswp_data
[
"trace"
][
1
][
0
]
y
=
fswp_data
[
"trace"
][
1
][
1
]
if
fswp_data
[
"window"
]
==
"Noise Spectrum"
:
trace
=
ax
.
semilogx
(
x
,
y
,
label
=
filename
+
str
(
" [1]"
))
else
:
trace
=
ax
.
plot
(
x
,
y
,
label
=
filename
+
str
(
" [1]"
))
lns
=
lns
+
trace
else
:
for
trace_nr
in
fswp_data
[
"trace"
]
.
keys
():
x
=
fswp_data
[
"trace"
][
trace_nr
][
0
]
y
=
fswp_data
[
"trace"
][
trace_nr
][
1
]
if
fswp_data
[
"window"
]
==
"Noise Spectrum"
:
trace
=
ax
.
semilogx
(
x
,
y
,
label
=
filename
+
str
(
" ["
)
+
str
(
trace_nr
)
+
(
"]"
))
else
:
trace
=
ax
.
plot
(
x
,
y
,
label
=
filename
+
str
(
" ["
)
+
str
(
trace_nr
)
+
(
"]"
))
lns
=
lns
+
trace
if
fswp_data
[
"window"
]
==
"Spectrogram"
or
fswp_data
[
"window"
]
==
"Frequency Sweep"
:
if
plot_title
==
""
:
...
...
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