Commit 4bfc86cc authored by Patrick Godwin's avatar Patrick Godwin
Browse files

mock.py: add spacing between funcs, check if filters set in generate_timeseries()

parent 83abc6e4
......@@ -138,9 +138,10 @@ def generate_timeseries(start, end, measurement, fields, aggregate, dt, tags=Non
### format filters
### FIXME: doesn't do anything for now
columns = []
for filter_ in filters:
tag, val = filter_
columns.append(tag)
if filters:
for filter_ in filters:
tag, val = filter_
columns.append(tag)
### create column name list
column_names = ['time']
......@@ -194,6 +195,7 @@ def generate_timeseries(start, end, measurement, fields, aggregate, dt, tags=Non
'values': series,
}]
def generate_triggers(start, end, measurement, fields, far_threshold, epoch='ns', latest=0, num_triggers=100):
### format filters
### FIXME: doesn't do anything for now
......@@ -223,6 +225,7 @@ def generate_triggers(start, end, measurement, fields, far_threshold, epoch='ns'
'values': series,
}]
def random_trigger_value(field, size, far_threshold = 1e-2):
if(field == 'far'):
return far_threshold * numpy.random.uniform(size=size)
......@@ -233,12 +236,14 @@ def random_trigger_value(field, size, far_threshold = 1e-2):
else:
return numpy.random.uniform(size=size)
def _convert_gps_times(gps_times, epoch):
if epoch == 'ns':
return utils.gps_to_unix(gps_times)
else:
raise NotImplementedError
def _add_parser_args(parser):
parser.add_argument('-b', '--backend', default='wsgiref',
help="chooses server backend. options: [cgi|wsgiref]. wsgiref starts a local server for development, default = wsgiref.")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment