add filter
This commit is contained in:
parent
3334d7896c
commit
bb92563de2
@ -7,7 +7,7 @@ from pylab import mpl
|
||||
mpl.rcParams["font.sans-serif"] = ["SimHei"]
|
||||
|
||||
# 初始化一个起始日期(这里假设是今天凌晨0点)
|
||||
start_date = datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)
|
||||
start_date = datetime.now().replace(hour=20, minute=21, second=0, microsecond=0)
|
||||
|
||||
with open('minicom.cap', 'r') as file:
|
||||
lines = file.readlines()
|
||||
@ -21,8 +21,9 @@ for line in lines:
|
||||
timedelta(minutes=int(time_str.split(':')[1])) + \
|
||||
timedelta(hours=int(time_str.split(':')[0]))
|
||||
temperature = float(temp_str)
|
||||
times.append(time)
|
||||
temperatures.append(temperature)
|
||||
if temperature >= 10 and temperature <= 40:
|
||||
times.append(time)
|
||||
temperatures.append(temperature)
|
||||
|
||||
# 确保时间序列是排序的
|
||||
times.sort()
|
||||
|
Loading…
x
Reference in New Issue
Block a user