Skip to content
Snippets Groups Projects
Commit bf6ab8c2 authored by Christian's avatar Christian
Browse files

Cleanup, Refactoring, Comments (WIP; Tangoserver not working!)

- Created classes for storing the status and spectrum data
- Removed the status query functions in AmptekHardwareInterface
- updateStatus will return a reference to the status. Python code should
use this instead of the removed query functions. E.g. instead of
interface.FastCount(), interface.updateSpectrum(max_age).FastCount()
will result in the same behaviour
- Cleanup of the list mode/ sequential mode functions, which were
prototyped during hardware tests
- Added Doxygen comments to AmptekHardwareInterface and AmptekStatus
member functions
parent a12f6182
No related branches found
No related tags found
No related merge requests found
......@@ -4,10 +4,13 @@
#include <chrono>
#include <thread>
#include <fstream>
#include <utility>
#include "AmptekConnectionHandler.h"
#define STATUS_SIZE 64
#include "AmptekStatus.h"
#include "AmptekSpectrum.h"
#define SPECLEN 8192
enum AmptekState{
......@@ -29,9 +32,6 @@ public:
void connectSimulator();
void connectUDP(std::string hostname, int port, double timeout);
//bool readStatus(const byte*, int&, double max_age_ms = -1);
const byte* readSpectrum(double max_age_ms = -1);
const byte* readSpectrumAndStatus(const byte* statusbuffer, double max_age_ms = -1);
bool Enable();
bool Disable();
......@@ -41,7 +41,7 @@ public:
bool SetPresetRealTime(double t);
bool SetPresetCounts(int c);
bool SetTextConfiguration(std::vector<std::string> commands);
bool UpdateStatus() {return updateStatus(-1);};
AmptekStatus& updateStatus(double max_age_ms );
bool EnableListMode(std::string targetfile);
bool ResetListModeTimer();
......@@ -49,35 +49,14 @@ public:
bool startBuffering();
bool stopBuffering();
std::vector<unsigned int> GetBuffered(size_t id);
std::pair<AmptekSpectrum, AmptekStatus> GetBufferedSpectrum(size_t id);
bool StartCommtestStreaming(uint16_t min_channel,uint16_t max_channel,
uint16_t increment, uint32_t rate);
bool StopCommtestStreaming();
int FastCount(double max_age_ms = 100);
int SlowCount(double max_age_ms = 100);
double DeadTime(double max_age_ms = 100);
double AccTime(double max_age_ms = 100);
double RealTime(double max_age_ms = 100);
int FirmwareMajor(double max_age_ms = 1000000);
int FirmwareMinor(double max_age_ms = 1000000);
int FirmwareBuild(double max_age_ms = 1000000);
int FpgaMajor(double max_age_ms = 1000000);
int FpgaMinor(double max_age_ms = 1000000);
int SerialNb(double max_age_ms = 1000000);
double HighVoltage(double max_age_ms = 100);
double DetectorTemp(double max_age_ms = 100);
int BoardTemp(double max_age_ms = 100);
bool IsPresetTimeReached(double max_age_ms = 100);
bool IsEnabled(double max_age_ms = 100);
bool IsPresetCountReached(double max_age_ms = 100);
bool IsGated(double max_age_ms = 100);
int FpgaClock(double max_age_ms = 100);
int DeviceType(double max_age_ms = 1000000);
double TecVoltage(double max_age_ms = 100);
int GetSpectrum(unsigned int* spectrum, double max_age_ms = 100);
// int GetSpectrum(unsigned int* spectrum, double max_age_ms = 100);
std::vector<unsigned int> GetSpectrum(double max_age_ms = 100);
std::vector<std::string> GetTextConfiguration(std::vector<std::string> commands);
......@@ -87,15 +66,17 @@ private:
bool spectrumAgeOk( double max_age_ms ) const;
bool statusAgeOk( double max_age_ms ) const;
bool updateStatus(double max_age_ms );
bool updateSpectrum( double max_age_ms);
void expectAcknowledge(Packet);
byte last_status[STATUS_SIZE];
unsigned int last_spectrum[SPECLEN];
unsigned int spectrum_length = 0;
std::chrono::time_point<std::chrono::system_clock> last_status_update_time;
std::chrono::time_point<std::chrono::system_clock> last_spectrum_update_time;
//byte last_status[STATUS_SIZE];
AmptekStatus last_status;
AmptekSpectrum last_spectrum;
// unsigned int last_spectrum[SPECLEN];
// unsigned int spectrum_length = 0;
//std::chrono::time_point<std::chrono::system_clock> last_status_update_time;
// std::chrono::time_point<std::chrono::system_clock> last_spectrum_update_time;
bool listmode_flag;
......
#ifndef AmptekSpectrum_h
#define AmptekSpectrum_h
#include "types.h"
#include <chrono>
struct AmptekSpectrum{
std::vector<unsigned int> bins;
size_t nbins;
std::chrono::time_point<std::chrono::system_clock> timestamp;
AmptekSpectrum(const byte* raw_spec, size_t nbins, std::chrono::time_point<std::chrono::system_clock> timestamp)
: nbins(nbins), timestamp(timestamp)
{
for (size_t i = 0; i < nbins; ++i){
bins.push_back(mergeBytes( raw_spec[DATA + 3*i + 2],
raw_spec[DATA + 3*i + 1],
raw_spec[DATA + 3*i ]
)
);
}
}
AmptekSpectrum(const byte* raw_spec, size_t nbins)
: AmptekSpectrum(raw_spec, nbins,std::chrono::system_clock::now())
{
}
AmptekSpectrum()
: AmptekSpectrum(nullptr, 0, std::chrono::system_clock::from_time_t(0))
{
}
double AgeMillis() const{
auto now = std::chrono::system_clock::now();
return std::chrono::duration_cast<std::chrono::milliseconds>(now - timestamp).count();
}
};
#endif
\ No newline at end of file
#ifndef AmptekStatus_h
#define AmptekStatus_h
#include "types.h"
#include <chrono>
#define STATUS_SIZE 64
class AmptekStatus{
public:
AmptekStatus(const byte* raw);
AmptekStatus(const byte* raw, std::chrono::time_point<std::chrono::system_clock> timestamp);
AmptekStatus();
~AmptekStatus();
int FastCount();
int SlowCount();
double DeadTime();
double AccTime();
double RealTime();
int FirmwareMajor();
int FirmwareMinor();
int FirmwareBuild();
int FpgaMajor();
int FpgaMinor();
int SerialNb();
double HighVoltage();
double DetectorTemp();
int BoardTemp();
bool IsPresetTimeReached();
bool IsEnabled();
bool IsPresetCountReached();
bool IsGated();
int FpgaClock();
int DeviceType();
double TecVoltage();
bool ListModeLMMO();
int ListModeClock();
int ListModeSync();
bool SequentialBufferRunning();
int SequentialBufferIndex();
double AgeMillis() const;
private:
byte raw_status[STATUS_SIZE];
std::chrono::time_point<std::chrono::system_clock> timestamp;
};
#endif
\ No newline at end of file
......@@ -14,6 +14,8 @@
%include "stdint.i"
%include "std_vector.i"
%include "std_pair.i"
%include exception.i
namespace std {
%template(IntVector) vector<int>;
......@@ -38,3 +40,5 @@ namespace std {
}
%include "include/AmptekHardwareInterface.h"
%include "include/AmptekStatus.h"
%include "include/AmptekSpectrum.h"
\ No newline at end of file
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.8
# Version 3.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2, 6, 0):
from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (2, 7, 0):
def swig_import_helper():
import importlib
pkg = __name__.rpartition('.')[0]
mname = '.'.join((pkg, '_AmptekHardwareInterface')).lstrip('.')
try:
return importlib.import_module(mname)
except ImportError:
return importlib.import_module('_AmptekHardwareInterface')
_AmptekHardwareInterface = swig_import_helper()
del swig_import_helper
elif _swig_python_version_info >= (2, 6, 0):
def swig_import_helper():
from os.path import dirname
import imp
......@@ -19,22 +26,27 @@ if version_info >= (2, 6, 0):
except ImportError:
import _AmptekHardwareInterface
return _AmptekHardwareInterface
if fp is not None:
try:
_mod = imp.load_module('_AmptekHardwareInterface', fp, pathname, description)
finally:
if fp is not None:
fp.close()
return _mod
_AmptekHardwareInterface = swig_import_helper()
del swig_import_helper
else:
import _AmptekHardwareInterface
del version_info
del _swig_python_version_info
try:
_swig_property = property
except NameError:
pass # Python < 2.2 doesn't have 'property'.
try:
import builtins as __builtin__
except ImportError:
import __builtin__
def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
if (name == "thisown"):
......@@ -56,37 +68,22 @@ def _swig_setattr(self, class_type, name, value):
return _swig_setattr_nondynamic(self, class_type, name, value, 0)
def _swig_getattr_nondynamic(self, class_type, name, static=1):
def _swig_getattr(self, class_type, name):
if (name == "thisown"):
return self.this.own()
method = class_type.__swig_getmethods__.get(name, None)
if method:
return method(self)
if (not static):
return object.__getattr__(self, name)
else:
raise AttributeError(name)
def _swig_getattr(self, class_type, name):
return _swig_getattr_nondynamic(self, class_type, name, 0)
raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
def _swig_repr(self):
try:
strthis = "proxy of " + self.this.__repr__()
except Exception:
except __builtin__.Exception:
strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
try:
_object = object
_newclass = 1
except AttributeError:
class _object:
pass
_newclass = 0
def _swig_setattr_nondynamic_method(set):
def set_attr(self, name, value):
......@@ -239,7 +236,7 @@ class IntVector(object):
this = _AmptekHardwareInterface.new_IntVector(*args)
try:
self.this.append(this)
except Exception:
except __builtin__.Exception:
self.this = this
def push_back(self, x):
......@@ -349,7 +346,7 @@ class StringVector(object):
this = _AmptekHardwareInterface.new_StringVector(*args)
try:
self.this.append(this)
except Exception:
except __builtin__.Exception:
self.this = this
def push_back(self, x):
......@@ -459,7 +456,7 @@ class DoubleVector(object):
this = _AmptekHardwareInterface.new_DoubleVector(*args)
try:
self.this.append(this)
except Exception:
except __builtin__.Exception:
self.this = this
def push_back(self, x):
......@@ -569,7 +566,7 @@ class UIntVector(object):
this = _AmptekHardwareInterface.new_UIntVector(*args)
try:
self.this.append(this)
except Exception:
except __builtin__.Exception:
self.this = this
def push_back(self, x):
......@@ -600,23 +597,10 @@ class UIntVector(object):
UIntVector_swigregister = _AmptekHardwareInterface.UIntVector_swigregister
UIntVector_swigregister(UIntVector)
_AmptekHardwareInterface.STATUS_SIZE_swigconstant(_AmptekHardwareInterface)
STATUS_SIZE = _AmptekHardwareInterface.STATUS_SIZE
_AmptekHardwareInterface.SPECLEN_swigconstant(_AmptekHardwareInterface)
SPECLEN = _AmptekHardwareInterface.SPECLEN
_AmptekHardwareInterface.NOT_CONNECTED_swigconstant(_AmptekHardwareInterface)
NOT_CONNECTED = _AmptekHardwareInterface.NOT_CONNECTED
_AmptekHardwareInterface.ON_swigconstant(_AmptekHardwareInterface)
ON = _AmptekHardwareInterface.ON
_AmptekHardwareInterface.RECORDING_swigconstant(_AmptekHardwareInterface)
RECORDING = _AmptekHardwareInterface.RECORDING
_AmptekHardwareInterface.ERROR_swigconstant(_AmptekHardwareInterface)
ERROR = _AmptekHardwareInterface.ERROR
class AmptekHardwareInterface(object):
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
......@@ -626,7 +610,7 @@ class AmptekHardwareInterface(object):
this = _AmptekHardwareInterface.new_AmptekHardwareInterface()
try:
self.this.append(this)
except Exception:
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _AmptekHardwareInterface.delete_AmptekHardwareInterface
__del__ = lambda self: None
......@@ -640,12 +624,6 @@ class AmptekHardwareInterface(object):
def connectUDP(self, hostname, port, timeout):
return _AmptekHardwareInterface.AmptekHardwareInterface_connectUDP(self, hostname, port, timeout)
def readSpectrum(self, max_age_ms=-1):
return _AmptekHardwareInterface.AmptekHardwareInterface_readSpectrum(self, max_age_ms)
def readSpectrumAndStatus(self, statusbuffer, max_age_ms=-1):
return _AmptekHardwareInterface.AmptekHardwareInterface_readSpectrumAndStatus(self, statusbuffer, max_age_ms)
def Enable(self):
return _AmptekHardwareInterface.AmptekHardwareInterface_Enable(self)
......@@ -670,8 +648,8 @@ class AmptekHardwareInterface(object):
def SetTextConfiguration(self, commands):
return _AmptekHardwareInterface.AmptekHardwareInterface_SetTextConfiguration(self, commands)
def UpdateStatus(self):
return _AmptekHardwareInterface.AmptekHardwareInterface_UpdateStatus(self)
def updateStatus(self, max_age_ms):
return _AmptekHardwareInterface.AmptekHardwareInterface_updateStatus(self, max_age_ms)
def EnableListMode(self, targetfile):
return _AmptekHardwareInterface.AmptekHardwareInterface_EnableListMode(self, targetfile)
......@@ -688,8 +666,8 @@ class AmptekHardwareInterface(object):
def stopBuffering(self):
return _AmptekHardwareInterface.AmptekHardwareInterface_stopBuffering(self)
def GetBuffered(self, id):
return _AmptekHardwareInterface.AmptekHardwareInterface_GetBuffered(self, id)
def GetBufferedSpectrum(self, id):
return _AmptekHardwareInterface.AmptekHardwareInterface_GetBufferedSpectrum(self, id)
def StartCommtestStreaming(self, min_channel, max_channel, increment, rate):
return _AmptekHardwareInterface.AmptekHardwareInterface_StartCommtestStreaming(self, min_channel, max_channel, increment, rate)
......@@ -697,79 +675,134 @@ class AmptekHardwareInterface(object):
def StopCommtestStreaming(self):
return _AmptekHardwareInterface.AmptekHardwareInterface_StopCommtestStreaming(self)
def FastCount(self, max_age_ms=100):
return _AmptekHardwareInterface.AmptekHardwareInterface_FastCount(self, max_age_ms)
def GetSpectrum(self, max_age_ms=100):
return _AmptekHardwareInterface.AmptekHardwareInterface_GetSpectrum(self, max_age_ms)
def SlowCount(self, max_age_ms=100):
return _AmptekHardwareInterface.AmptekHardwareInterface_SlowCount(self, max_age_ms)
def GetTextConfiguration(self, commands):
return _AmptekHardwareInterface.AmptekHardwareInterface_GetTextConfiguration(self, commands)
def DeadTime(self, max_age_ms=100):
return _AmptekHardwareInterface.AmptekHardwareInterface_DeadTime(self, max_age_ms)
def GetState(self):
return _AmptekHardwareInterface.AmptekHardwareInterface_GetState(self)
AmptekHardwareInterface_swigregister = _AmptekHardwareInterface.AmptekHardwareInterface_swigregister
AmptekHardwareInterface_swigregister(AmptekHardwareInterface)
def AccTime(self, max_age_ms=100):
return _AmptekHardwareInterface.AmptekHardwareInterface_AccTime(self, max_age_ms)
STATUS_SIZE = _AmptekHardwareInterface.STATUS_SIZE
class AmptekStatus(object):
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def RealTime(self, max_age_ms=100):
return _AmptekHardwareInterface.AmptekHardwareInterface_RealTime(self, max_age_ms)
def __init__(self, *args):
this = _AmptekHardwareInterface.new_AmptekStatus(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _AmptekHardwareInterface.delete_AmptekStatus
__del__ = lambda self: None
def FirmwareMajor(self, max_age_ms=1000000):
return _AmptekHardwareInterface.AmptekHardwareInterface_FirmwareMajor(self, max_age_ms)
def FastCount(self):
return _AmptekHardwareInterface.AmptekStatus_FastCount(self)
def FirmwareMinor(self, max_age_ms=1000000):
return _AmptekHardwareInterface.AmptekHardwareInterface_FirmwareMinor(self, max_age_ms)
def SlowCount(self):
return _AmptekHardwareInterface.AmptekStatus_SlowCount(self)
def FirmwareBuild(self, max_age_ms=1000000):
return _AmptekHardwareInterface.AmptekHardwareInterface_FirmwareBuild(self, max_age_ms)
def DeadTime(self):
return _AmptekHardwareInterface.AmptekStatus_DeadTime(self)
def FpgaMajor(self, max_age_ms=1000000):
return _AmptekHardwareInterface.AmptekHardwareInterface_FpgaMajor(self, max_age_ms)
def AccTime(self):
return _AmptekHardwareInterface.AmptekStatus_AccTime(self)
def FpgaMinor(self, max_age_ms=1000000):
return _AmptekHardwareInterface.AmptekHardwareInterface_FpgaMinor(self, max_age_ms)
def RealTime(self):
return _AmptekHardwareInterface.AmptekStatus_RealTime(self)
def SerialNb(self, max_age_ms=1000000):
return _AmptekHardwareInterface.AmptekHardwareInterface_SerialNb(self, max_age_ms)
def FirmwareMajor(self):
return _AmptekHardwareInterface.AmptekStatus_FirmwareMajor(self)
def HighVoltage(self, max_age_ms=100):
return _AmptekHardwareInterface.AmptekHardwareInterface_HighVoltage(self, max_age_ms)
def FirmwareMinor(self):
return _AmptekHardwareInterface.AmptekStatus_FirmwareMinor(self)
def DetectorTemp(self, max_age_ms=100):
return _AmptekHardwareInterface.AmptekHardwareInterface_DetectorTemp(self, max_age_ms)
def FirmwareBuild(self):
return _AmptekHardwareInterface.AmptekStatus_FirmwareBuild(self)
def BoardTemp(self, max_age_ms=100):
return _AmptekHardwareInterface.AmptekHardwareInterface_BoardTemp(self, max_age_ms)
def FpgaMajor(self):
return _AmptekHardwareInterface.AmptekStatus_FpgaMajor(self)
def IsPresetTimeReached(self, max_age_ms=100):
return _AmptekHardwareInterface.AmptekHardwareInterface_IsPresetTimeReached(self, max_age_ms)
def FpgaMinor(self):
return _AmptekHardwareInterface.AmptekStatus_FpgaMinor(self)
def IsEnabled(self, max_age_ms=100):
return _AmptekHardwareInterface.AmptekHardwareInterface_IsEnabled(self, max_age_ms)
def SerialNb(self):
return _AmptekHardwareInterface.AmptekStatus_SerialNb(self)
def IsPresetCountReached(self, max_age_ms=100):
return _AmptekHardwareInterface.AmptekHardwareInterface_IsPresetCountReached(self, max_age_ms)
def HighVoltage(self):
return _AmptekHardwareInterface.AmptekStatus_HighVoltage(self)
def IsGated(self, max_age_ms=100):
return _AmptekHardwareInterface.AmptekHardwareInterface_IsGated(self, max_age_ms)
def DetectorTemp(self):
return _AmptekHardwareInterface.AmptekStatus_DetectorTemp(self)
def FpgaClock(self, max_age_ms=100):
return _AmptekHardwareInterface.AmptekHardwareInterface_FpgaClock(self, max_age_ms)
def BoardTemp(self):
return _AmptekHardwareInterface.AmptekStatus_BoardTemp(self)
def DeviceType(self, max_age_ms=1000000):
return _AmptekHardwareInterface.AmptekHardwareInterface_DeviceType(self, max_age_ms)
def IsPresetTimeReached(self):
return _AmptekHardwareInterface.AmptekStatus_IsPresetTimeReached(self)
def TecVoltage(self, max_age_ms=100):
return _AmptekHardwareInterface.AmptekHardwareInterface_TecVoltage(self, max_age_ms)
def IsEnabled(self):
return _AmptekHardwareInterface.AmptekStatus_IsEnabled(self)
def GetSpectrum(self, *args):
return _AmptekHardwareInterface.AmptekHardwareInterface_GetSpectrum(self, *args)
def IsPresetCountReached(self):
return _AmptekHardwareInterface.AmptekStatus_IsPresetCountReached(self)
def GetTextConfiguration(self, commands):
return _AmptekHardwareInterface.AmptekHardwareInterface_GetTextConfiguration(self, commands)
def IsGated(self):
return _AmptekHardwareInterface.AmptekStatus_IsGated(self)
def GetState(self):
return _AmptekHardwareInterface.AmptekHardwareInterface_GetState(self)
AmptekHardwareInterface_swigregister = _AmptekHardwareInterface.AmptekHardwareInterface_swigregister
AmptekHardwareInterface_swigregister(AmptekHardwareInterface)
def FpgaClock(self):
return _AmptekHardwareInterface.AmptekStatus_FpgaClock(self)
def DeviceType(self):
return _AmptekHardwareInterface.AmptekStatus_DeviceType(self)
def TecVoltage(self):
return _AmptekHardwareInterface.AmptekStatus_TecVoltage(self)
def ListModeLMMO(self):
return _AmptekHardwareInterface.AmptekStatus_ListModeLMMO(self)
def ListModeClock(self):
return _AmptekHardwareInterface.AmptekStatus_ListModeClock(self)
def ListModeSync(self):
return _AmptekHardwareInterface.AmptekStatus_ListModeSync(self)
def SequentialBufferRunning(self):
return _AmptekHardwareInterface.AmptekStatus_SequentialBufferRunning(self)
def SequentialBufferIndex(self):
return _AmptekHardwareInterface.AmptekStatus_SequentialBufferIndex(self)
def AgeMillis(self):
return _AmptekHardwareInterface.AmptekStatus_AgeMillis(self)
AmptekStatus_swigregister = _AmptekHardwareInterface.AmptekStatus_swigregister
AmptekStatus_swigregister(AmptekStatus)
class AmptekSpectrum(object):
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
bins = _swig_property(_AmptekHardwareInterface.AmptekSpectrum_bins_get, _AmptekHardwareInterface.AmptekSpectrum_bins_set)
nbins = _swig_property(_AmptekHardwareInterface.AmptekSpectrum_nbins_get, _AmptekHardwareInterface.AmptekSpectrum_nbins_set)
timestamp = _swig_property(_AmptekHardwareInterface.AmptekSpectrum_timestamp_get, _AmptekHardwareInterface.AmptekSpectrum_timestamp_set)
def __init__(self, *args):
this = _AmptekHardwareInterface.new_AmptekSpectrum(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
def AgeMillis(self):
return _AmptekHardwareInterface.AmptekSpectrum_AgeMillis(self)
__swig_destroy__ = _AmptekHardwareInterface.delete_AmptekSpectrum
__del__ = lambda self: None
AmptekSpectrum_swigregister = _AmptekHardwareInterface.AmptekSpectrum_swigregister
AmptekSpectrum_swigregister(AmptekSpectrum)
This diff is collapsed.
......@@ -2,7 +2,7 @@
import sys
import struct
import numpy as np
def read_records(f,datalength):
records = []
......@@ -113,12 +113,23 @@ t = [ r["full_ts"] for r in event_records if "full_ts" in r ]
a = [ r["amplitude"] for r in event_records if "full_ts" in r ]
ax2.plot(t,a)
figWF, axesWF = plt.subplots(2,1,sharex=True)
h2D, tedges, xedges = np.histogram2d( t,a,bins=(1000,1024), range=( (0,max(t)),(0,4096) ) )
print(h2D.shape)
axesWF[0].plot( h2D[-1] )
axesWF[1].imshow(h2D, extent = (0,1024,tedges[0],tedges[-1]), aspect = "auto", origin = "lower" )
fig3, ax3 = plt.subplots()
event_records = [r for r in records if r["type"] == "event"]
t = [ r["full_ts"] for r in event_records if "full_ts" in r ]
a = [ r["frame"] for r in event_records if "full_ts" in r ]
ax3.plot(t,a)
# for i in range(len(records)):
# if records[i]['type'] == 'frame':
# print( "{:03d}:{:06d}".format( records[i]["frame"],records[i]["ts_upper"] ) )
plt.show()
......
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment