Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
StdInPlot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
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
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
technasium
StdInPlot
Commits
b2f12b2d
Commit
b2f12b2d
authored
1 year ago
by
Tammo Jan Dijkema
Browse files
Options
Downloads
Patches
Plain Diff
Remove one plot
parent
368f2c1a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
power_plot.py
+17
-41
17 additions, 41 deletions
power_plot.py
with
17 additions
and
41 deletions
power_plot.py
+
17
−
41
View file @
b2f12b2d
...
@@ -46,56 +46,35 @@ class PowerPlot:
...
@@ -46,56 +46,35 @@ class PowerPlot:
def
__init__
(
self
,
fig
,
freq
):
def
__init__
(
self
,
fig
,
freq
):
self
.
fig
=
fig
self
.
fig
=
fig
self
.
ax1
=
fig
.
add_subplot
(
2
,
1
,
1
)
self
.
ax
=
fig
.
add_subplot
()
self
.
ax2
=
fig
.
add_subplot
(
2
,
1
,
2
)
self
.
ax
.
set_xlabel
(
"
time (s)
"
)
self
.
ax1
.
set_xlabel
(
"
time (s)
"
)
self
.
ax
.
set_ylabel
(
"
power (uncalibrated)
"
)
self
.
ax1
.
set_ylabel
(
"
power (uncalibrated)
"
)
self
.
ax
.
xaxis_date
()
self
.
ax2
.
set_xlabel
(
"
time (UTC)
"
)
self
.
min
,
self
.
max
=
None
,
None
self
.
ax2
.
set_ylabel
(
"
power (uncalibrated)
"
)
self
.
ax
.
xaxis
.
set_major_formatter
(
self
.
ax2
.
xaxis_date
()
self
.
min1
,
self
.
max1
=
None
,
None
self
.
min2
,
self
.
max2
=
None
,
None
self
.
ax2
.
xaxis
.
set_major_formatter
(
FuncFormatter
(
lambda
x
,
pos
:
f
"
{
num2date
(
x
)
:
%
H
:
%
M
}
"
)
FuncFormatter
(
lambda
x
,
pos
:
f
"
{
num2date
(
x
)
:
%
H
:
%
M
}
"
)
)
)
fig
.
suptitle
(
f
"
Sgr A Occultation (
{
freq
:
.
0
f
}
MHz)
"
,
fontsize
=
16
)
fig
.
suptitle
(
f
"
Sgr A Occultation (
{
freq
:
.
0
f
}
MHz)
"
,
fontsize
=
16
)
fig
.
tight_layout
()
fig
.
tight_layout
()
(
self
.
zoomplot
,)
=
self
.
ax1
.
plot
([],
[],
"
-
"
,
color
=
"
blue
"
)
(
self
.
totalplot
,)
=
self
.
ax
.
plot
([],
[],
"
-
"
,
color
=
"
blue
"
)
(
self
.
zoomplothighlight
,)
=
self
.
ax1
.
plot
(
(
self
.
totalplothighlight
,)
=
self
.
ax
.
plot
(
[],
[],
"
.
"
,
color
=
"
red
"
,
markersize
=
10
)
(
self
.
totalplot
,)
=
self
.
ax2
.
plot
([],
[],
"
-
"
,
color
=
"
blue
"
)
(
self
.
totalplothighlight
,)
=
self
.
ax2
.
plot
(
[],
[],
"
.
"
,
color
=
"
red
"
,
markersize
=
10
[],
[],
"
.
"
,
color
=
"
red
"
,
markersize
=
10
)
)
def
set_zoomplot_values
(
self
,
xdata
,
ydata
):
self
.
zoomplot
.
set_data
(
xdata
,
ydata
)
self
.
zoomplothighlight
.
set_data
(
xdata
[
-
1
],
ydata
[
-
1
])
self
.
min1
=
np
.
nanmin
(
ydata
)
self
.
max1
=
np
.
nanmax
(
ydata
)
if
np
.
isnan
(
self
.
min1
)
or
np
.
isnan
(
self
.
max1
):
self
.
min1
=
None
self
.
max1
=
None
self
.
ax1
.
autoscale_view
(
True
,
True
,
True
)
def
set_totalplot_values
(
self
,
xdata
,
ydata
):
def
set_totalplot_values
(
self
,
xdata
,
ydata
):
self
.
totalplot
.
set_data
(
xdata
,
ydata
)
self
.
totalplot
.
set_data
(
xdata
,
ydata
)
self
.
totalplothighlight
.
set_data
(
xdata
[
-
1
],
ydata
[
-
1
])
self
.
totalplothighlight
.
set_data
(
xdata
[
-
1
],
ydata
[
-
1
])
if
self
.
min
2
is
None
or
ydata
[
-
1
]
<
self
.
min
2
:
if
self
.
min
is
None
or
ydata
[
-
1
]
<
self
.
min
:
self
.
min
2
=
ydata
[
-
1
]
self
.
min
=
ydata
[
-
1
]
if
self
.
max
2
is
None
or
ydata
[
-
1
]
>
self
.
max
2
:
if
self
.
max
is
None
or
ydata
[
-
1
]
>
self
.
max
:
self
.
max
2
=
ydata
[
-
1
]
self
.
max
=
ydata
[
-
1
]
self
.
ax
2
.
autoscale_view
(
True
,
True
,
True
)
self
.
ax
.
autoscale_view
(
True
,
True
,
True
)
def
do_autoscale_y
(
self
):
def
do_autoscale_y
(
self
):
self
.
ax1
.
set_ylim
(
self
.
ax
.
set_ylim
(
self
.
min1
-
(
self
.
max1
-
self
.
min1
)
*
0.1
-
0.1
,
self
.
min
-
(
self
.
max
-
self
.
min
)
*
0.1
-
0.1
,
self
.
max1
+
(
self
.
max1
-
self
.
min1
)
*
0.1
+
0.1
,
self
.
max
+
(
self
.
max
-
self
.
min
)
*
0.1
+
0.1
,
)
self
.
ax2
.
set_ylim
(
self
.
min2
-
(
self
.
max2
-
self
.
min2
)
*
0.1
-
0.1
,
self
.
max2
+
(
self
.
max2
-
self
.
min2
)
*
0.1
+
0.1
,
)
)
...
@@ -191,7 +170,6 @@ class PowerPlotMainWindow(QMainWindow):
...
@@ -191,7 +170,6 @@ class PowerPlotMainWindow(QMainWindow):
# fig.canvas.manager.set_window_title("Dwingeloo Radio Telescope")
# fig.canvas.manager.set_window_title("Dwingeloo Radio Telescope")
self
.
powerplot
=
PowerPlot
(
fig
,
freq
)
self
.
powerplot
=
PowerPlot
(
fig
,
freq
)
self
.
powerplot
.
ax1
.
set_xlim
(
-
last_seconds
-
1
,
5
)
self
.
read_stdin
()
self
.
read_stdin
()
self
.
stdin_notifier
=
QSocketNotifier
(
self
.
stdin_notifier
=
QSocketNotifier
(
...
@@ -219,14 +197,12 @@ class PowerPlotMainWindow(QMainWindow):
...
@@ -219,14 +197,12 @@ class PowerPlotMainWindow(QMainWindow):
self
.
last_x_buffer
=
np
.
roll
(
self
.
last_x_buffer
,
-
1
)
self
.
last_x_buffer
=
np
.
roll
(
self
.
last_x_buffer
,
-
1
)
self
.
last_x_buffer
[
-
1
]
=
power_now
self
.
last_x_buffer
[
-
1
]
=
power_now
self
.
powerplot
.
set_zoomplot_values
(
self
.
min_range
,
self
.
last_x_buffer
)
self
.
powerplot
.
set_totalplot_values
(
self
.
time_dt
,
self
.
data
)
self
.
powerplot
.
set_totalplot_values
(
self
.
time_dt
,
self
.
data
)
now
=
time
.
time
()
now
=
time
.
time
()
if
self
.
autoscale_x
:
if
self
.
autoscale_x
:
self
.
powerplot
.
ax2
.
set_xlim
(
self
.
start_time
,
self
.
stop_time
)
self
.
powerplot
.
ax
.
set_xlim
(
self
.
start_time
,
self
.
stop_time
)
self
.
powerplot
.
ax1
.
set_xlim
(
-
last_seconds
,
5
)
if
self
.
autoscale_y
:
if
self
.
autoscale_y
:
self
.
powerplot
.
do_autoscale_y
()
self
.
powerplot
.
do_autoscale_y
()
...
...
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