Extract data from jls V2

We are palnning to use the JS220 to investigate the current’s consumtion of our device. The signal should be capturing over a few days. Our python script should find pre-defind patterns and anomilies. Currently, we managed to capture the signal and save it in the file by using the capture_jls_v2.py script.
The question is how to extract the current’s data from the jls V2 file?
Thank you

Hi @airspan and welcome to the Joulescope forum!

You can use the pyjls package to open and get data into Python. See the documentation. You can use the export entry point as an example.

Here is a quick snippet that reads the first 1000 current samples:

from pyjls import Reader
import numpy as np
path = 'my_file.jls'
with Reader(path) as r:
    signal = r.signal_lookup('current')
    data = r.fsr(signal.signal_id, 0, 1000) 
    print(f'{type(data)} | {data.shape} | {np.mean(data)}')

Since you can easily capture more data than you can load into memory, you often must perform block-based processing as shown in the export entry point.