Skip to content

Add lecroy oscilloscope processing#80

Merged
jwaiton merged 15 commits into
nu-ZOO:mainfrom
MattZur:add-lecroy-processing
May 11, 2026
Merged

Add lecroy oscilloscope processing#80
jwaiton merged 15 commits into
nu-ZOO:mainfrom
MattZur:add-lecroy-processing

Conversation

@MattZur
Copy link
Copy Markdown
Collaborator

@MattZur MattZur commented Apr 28, 2026

This extends processing functionality to the LeCroy oscilloscope range. This PR is specifically for the oscilloscope model LECROYWS4054HD.

The processing functions follow the structure of the wd1 processing but with different header reading. In the future all processing could be standardised with just individual header reading functions for each device. As it follows the same structure, the processing test is essentially the same as the wd1 decode test.

@MattZur MattZur requested review from a team and jwaiton April 28, 2026 14:27
@MattZur
Copy link
Copy Markdown
Collaborator Author

MattZur commented Apr 28, 2026

This PR replaces #45

Copy link
Copy Markdown
Member

@jwaiton jwaiton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Some relatively minor request + some questions.

Also, we need to remove that merge commit from the history, which shouldn't be too hard 🤞

Comment thread packs/proc/processing_utils.py Outdated
save_data(event_info, rwf, save_path, counter)
counter += (counts)

def read_header(file_obj : BinaryIO):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

csv's aren't BinaryIOs, they are TextIOWrapper type, as shown here:

>>> import csv
>>> with open('fake.csv', 'r') as f:
...     print(f)
...     print(type(f))
...
<_io.TextIOWrapper name='fake.csv' mode='r' encoding='UTF-8'>
<class '_io.TextIOWrapper'>

Saying that, the WD1 and WD2 readers when type-checked are _io.BufferedReader class. So this clearly needs to be fixed across the whole repo at some point.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swapped it as you pointed out. Should I open an issue?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure :)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #84

Comment thread packs/proc/processing_utils.py Outdated
Comment thread packs/proc/processing_utils.py Outdated
Comment on lines +602 to +603
def get_batch(reader : '_csv.reader',
batch_size : int):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

align the :s, add an output type (def func(x : int, y : float) -> float)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed like this:

def get_batch(reader        :   '_csv.reader',
              batch_size    :   int) -> list: 

Comment thread packs/proc/processing_utils.py Outdated
Comment thread packs/proc/processing_utils.py Outdated
Comment thread packs/configs/process_lecroy_csv.conf
Comment thread packs/proc/proc.py
Comment thread packs/tests/processing_test.py Outdated
Comment thread packs/tests/data/configs/process_lecroy_csv.conf
Comment thread packs/tests/processing_test.py Outdated
MattZur added a commit to MattZur/MULE that referenced this pull request May 11, 2026
Comment thread packs/proc/processing_utils.py Outdated
Comment thread packs/proc/processing_utils.py Outdated
@MattZur MattZur force-pushed the add-lecroy-processing branch from 56c7171 to e4f1383 Compare May 11, 2026 15:33
Copy link
Copy Markdown
Member

@jwaiton jwaiton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR introduces lecroy oscilloscope processing into MULE! Very exciting day, expanding beyond CAEN decoding.

Good work!

@jwaiton jwaiton merged commit d1acde0 into nu-ZOO:main May 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants