Skip to content
Snippets Groups Projects
Commit faa4516e authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Remove astropy.time

parent 595ac5f0
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3 #!/usr/bin/env python3
from astropy.time import Time from datetime import datetime
import sys import sys
import os import os
...@@ -119,7 +119,7 @@ class PowerPlotMainWindow(QMainWindow): ...@@ -119,7 +119,7 @@ class PowerPlotMainWindow(QMainWindow):
line = sys.stdin.readline() line = sys.stdin.readline()
values = line.split(",") values = line.split(",")
self.time_dt = np.array(Time(values[0], format="unix").to_datetime()) self.time_dt = np.array(date2num(datetime.utcfromtimestamp(float(values[0]))))
self.last_x_buffer = np.empty(last_seconds + 1) self.last_x_buffer = np.empty(last_seconds + 1)
self.last_x_buffer[:] = np.nan self.last_x_buffer[:] = np.nan
...@@ -128,11 +128,8 @@ class PowerPlotMainWindow(QMainWindow): ...@@ -128,11 +128,8 @@ class PowerPlotMainWindow(QMainWindow):
self.data = np.array([float(values[1])]) self.data = np.array([float(values[1])])
self.start_time = Time("2023-12-13T09:15:00").to_datetime() self.start_time = datetime(2023, 12, 13, 9, 15)
self.stop_time = Time("2023-12-13T11:30:00").to_datetime() self.stop_time = datetime(2023, 12, 13, 11, 30)
#self.start_time = Time(values[0], format="unix").to_datetime()
#self.stop_time = (Time(values[0], format="unix") + 2 * u.h).to_datetime()
plt.ion() plt.ion()
...@@ -172,7 +169,7 @@ class PowerPlotMainWindow(QMainWindow): ...@@ -172,7 +169,7 @@ class PowerPlotMainWindow(QMainWindow):
time_now = float(values[0]) time_now = float(values[0])
power_now = float(values[1]) power_now = float(values[1])
self.time_dt = np.append(self.time_dt, Time(values[0], format="unix").to_datetime()) self.time_dt = np.append(self.time_dt, date2num(datetime.utcfromtimestamp(time_now)))
self.data = np.append(self.data, power_now) self.data = np.append(self.data, power_now)
self.last_x_buffer = np.roll(self.last_x_buffer, -1) self.last_x_buffer = np.roll(self.last_x_buffer, -1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment