Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
python-spectrometer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
QuTech
python-spectrometer
Commits
3966fee1
Verified
Commit
3966fee1
authored
Aug 27, 2024
by
Tobias Hangleiter
Browse files
Options
Downloads
Patches
Plain Diff
Reduce plot updates
parent
75e6346c
Branches
Rpc
Branches containing commit
No related tags found
1 merge request
!36
Threaded acquisition
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/python_spectrometer/_plot_manager.py
+2
-1
2 additions, 1 deletion
src/python_spectrometer/_plot_manager.py
src/python_spectrometer/core.py
+7
-2
7 additions, 2 deletions
src/python_spectrometer/core.py
with
9 additions
and
3 deletions
src/python_spectrometer/_plot_manager.py
+
2
−
1
View file @
3966fee1
...
...
@@ -19,6 +19,7 @@ _styleT = Union[None, _styleT, List[_styleT]]
class
PlotManager
:
# TODO: blit?
PLOT_TYPES
=
(
'
main
'
,
'
cumulative
'
,
'
time
'
)
LINE_TYPES
=
(
'
processed
'
,
'
raw
'
)
...
...
@@ -27,7 +28,7 @@ class PlotManager:
plot_negative_frequencies
:
bool
=
True
,
plot_absolute_frequencies
:
bool
=
True
,
plot_amplitude
:
bool
=
True
,
plot_density
:
bool
=
True
,
plot_cumulative_normalized
:
bool
=
False
,
plot_style
:
_styleT
=
'
fast
'
,
plot_update_mode
:
str
=
'
fast
'
,
plot_dB_scale
:
bool
=
False
,
prop_cycle
=
None
,
plot_update_mode
:
str
=
'
never
'
,
plot_dB_scale
:
bool
=
False
,
prop_cycle
=
None
,
raw_unit
:
str
=
'
V
'
,
processed_unit
:
str
=
'
V
'
,
uses_windowed_estimator
:
bool
=
True
,
figure_kw
:
Optional
[
Mapping
]
=
None
,
subplot_kw
:
Optional
[
Mapping
]
=
None
,
gridspec_kw
:
Optional
[
Mapping
]
=
None
,
...
...
This diff is collapsed.
Click to expand it.
src/python_spectrometer/core.py
+
7
−
2
View file @
3966fee1
...
...
@@ -155,7 +155,7 @@ class Spectrometer:
are given by :attr:`matplotlib.style.available`. Set to None to
disable styling and use default parameters. Note that line
styles in ``prop_cycle`` override style settings.
plot_update_mode : {
'
fast
'
,
'
always
'
,
'
never
'
}
, default
'
fast
'
plot_update_mode : {
'
fast
'
,
'
always
'
,
'
never
'
}
Determines how often the event queue of the plot is flushed.
-
'
fast
'
: queue is only flushed after all plot calls are
...
...
@@ -166,6 +166,9 @@ class Spectrometer:
done, but slows down the entire plotting by a factor of
order unity.
-
'
never
'
: Queue is never flushed explicitly.
When `threaded_acquisition` is True, this should not need to be
changed and defaults to never. If not, defaults to
'
fast
'
.
plot_dB_scale : bool, default False
Plot data in dB relative to a reference spectrum instead of
in absolute units. The reference spectrum defaults to the first
...
...
@@ -257,7 +260,7 @@ class Spectrometer:
plot_absolute_frequencies
:
bool
=
True
,
plot_amplitude
:
bool
=
True
,
plot_density
:
bool
=
True
,
plot_cumulative_normalized
:
bool
=
False
,
plot_style
:
_styleT
=
'
fast
'
,
plot_update_mode
:
Literal
[
'
fast
'
,
'
always
'
,
'
never
'
]
=
'
fast
'
,
plot_update_mode
:
Literal
[
'
fast
'
,
'
always
'
,
'
never
'
]
|
None
=
None
,
plot_dB_scale
:
bool
=
False
,
threaded_acquisition
:
bool
=
True
,
purge_raw_data
:
bool
=
False
,
prop_cycle
=
None
,
savepath
:
_pathT
=
None
,
compress
:
bool
=
True
,
raw_unit
:
str
=
'
V
'
,
processed_unit
:
str
=
'
V
'
,
...
...
@@ -272,6 +275,8 @@ class Spectrometer:
self
.
savepath
=
savepath
or
'
~/python_spectrometer/
'
+
datetime
.
now
().
strftime
(
'
%Y-%m-%d
'
)
self
.
compress
=
compress
self
.
threaded_acquisition
=
threaded_acquisition
if
plot_update_mode
is
None
:
plot_update_mode
=
'
never
'
if
self
.
threaded_acquisition
else
'
fast
'
if
purge_raw_data
:
warnings
.
warn
(
'
Enabling purge raw data might break some plotting features!
'
,
UserWarning
,
stacklevel
=
2
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment