def get_live_timeseries(): ts = TimeSeries() ts.set_live() ts.dt = 1 / sampling_rate ts.npts = ts_size # ts.put('net', 'IU') ts.put("npts", ts_size) ts.put("sampling_rate", sampling_rate) ts.tref = TimeReferenceType.UTC ts.t0 = datetime.utcnow().timestamp() ts["delta"] = 0.1 ts["calib"] = 0.1 ts["site_id"] = bson.objectid.ObjectId() ts["channel_id"] = bson.objectid.ObjectId() ts["source_id"] = bson.objectid.ObjectId() ts.set_as_origin("test", "0", "0", AtomicType.TIMESERIES) ts.data = DoubleVector(np.random.rand(ts_size)) return ts
def get_live_timeseries(): ts = TimeSeries() ts.set_live() ts.dt = 1 / sampling_rate ts.npts = ts_size # ts.put('net', 'IU') ts.put('npts', ts_size) ts.put('sampling_rate', sampling_rate) ts.tref = TimeReferenceType.UTC ts.t0 = datetime.utcnow().timestamp() ts['delta'] = 0.1 ts['calib'] = 0.1 ts['site_id'] = bson.objectid.ObjectId() ts['channel_id'] = bson.objectid.ObjectId() ts['source_id'] = bson.objectid.ObjectId() ts.set_as_origin('test', '0', '0', AtomicType.TIMESERIES) ts.data = DoubleVector(np.random.rand(ts_size)) return ts