openpowerquality / opq

Master repository for all OPQ services
http://openpowerquality.org
18 stars 2 forks source link

Fix bug in Mauka's MakaiEventPlugin #257

Closed anthonyjchriste closed 5 years ago

anthonyjchriste commented 5 years ago

Please do work for this task in a branch called issue-257.

We are currently receiving the following error in Mauka:

Exception in thread Thread-8294:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.7/threading.py", line 1166, in run
    self.function(*self.args, **self.kwargs)
  File "/build/mauka/plugins/makai_event_plugin.py", line 282, in acquire_and_produce
    self.down_sample_factor)
  File "/build/mauka/plugins/makai_event_plugin.py", line 238, in acquire_data
    filter_down_sample_factor),
  File "/build/mauka/plugins/makai_event_plugin.py", line 139, in frequency_waveform
    downsample_factor=down_sample_factor)
  File "/build/mauka/plugins/makai_event_plugin.py", line 49, in smooth_waveform
    return signal.decimate(sample, downsample_factor, ftype=dtltis)
  File "/usr/local/lib/python3.7/site-packages/scipy/signal/signaltools.py", line 3485, in decimate
    y = filtfilt(b, a, x, axis=axis)
  File "/usr/local/lib/python3.7/site-packages/scipy/signal/signaltools.py", line 3126, in filtfilt
    ntaps=max(len(a), len(b)))
  File "/usr/local/lib/python3.7/site-packages/scipy/signal/signaltools.py", line 3176, in _validate_pad
    "padlen, which is %d." % edge)
ValueError: The length of the input vector x must be at least padlen, which is 15.

Investigate and fix the cause of the error.

anthonyjchriste commented 5 years ago

After some investigation, it appears that this might actually be caused by Makai. Looking at the DB reveals that the most recent events are storing events of length 0, meaning the files don't actually hold anything and is why the makai_event plugin is freaking out.

anthonyjchriste commented 5 years ago

The data was from a test box and is not an issue for other boxes.

anthonyjchriste commented 5 years ago

To further elaborate, development data from a test box accidentally made its way to emilia while Makai was being tested.