Error converting .jls to .csv

Hi, I want to pre process the data in python or R, I was trying to convert the .jls to .csv. Followed the export command from But, I’m ending up with an error saying invalid file. How would I go about converting the .jls to a more data processing friendly format ?

Hi @neo_here, and welcome to the Joulescope forum! The pyjoulescope recording entry point only supports JLS v1. The Joulescope UI 1.0 now records to JLS v2 by default. If you are comfortable using Python, why not just load the data from the JLS file directly? If your JLS file is small enough, you can just load into RAM.

First, install pyjls:

pip install -U pyjls

While you can use the included export subcommand:

python -m pyjls export in_filename.jls out_filename.bin

You can just load the JLS data directly. Here is a code snippet:

from pyjls import Reader, SignalType

def load(filename, signal_names):
    """Load the recorded data
    :param filename: The relative or absolute path to the JLS v2 file.
    :param signal_names: The list of signals to load.  The supported
        signals include 'current', 'voltage', 'power'.
    data = {}
    with Reader(filename) as r:
        signals = []
        # time align signals (necessary for JS220.  JS110 already aligned, so does nothing)
        for signal_name in signal_names:
            s = r.signal_lookup(signal_name)
            print(f'signal {}: offset={s.sample_id_offset}, length={s.length}, sample_rate={s.sample_rate}')
        sample_id_offset = max([s.sample_id_offset for s in signals])
        length = min([s.sample_id_offset + s.length - sample_id_offset for s in signals])
        frequencies = [s.sample_rate for s in signals]
        if min(frequencies) != max(frequencies):
            raise RuntimeError(f'frequency mismatch: {frequencies}')
        frequency = min(frequencies)
        # extract the data for each signal
        x = np.arange(length, dtype=float) * (1.0 / frequency)
        for s in signals:
            data[] = {
                'x': x,
                'y': r.fsr(s.signal_id, sample_id_offset - s.sample_id_offset, length),
                'units': s.units,
    return data

Does this work for you?

Hey, yes. This should work. I’ll give it a shot. Thank you!

1 Like