Add lecroy oscilloscope processing#80
Conversation
|
This PR replaces #45 |
jwaiton
left a comment
There was a problem hiding this comment.
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 🤞
| save_data(event_info, rwf, save_path, counter) | ||
| counter += (counts) | ||
|
|
||
| def read_header(file_obj : BinaryIO): |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Swapped it as you pointed out. Should I open an issue?
| def get_batch(reader : '_csv.reader', | ||
| batch_size : int): |
There was a problem hiding this comment.
align the :s, add an output type (def func(x : int, y : float) -> float)
There was a problem hiding this comment.
Fixed like this:
def get_batch(reader : '_csv.reader',
batch_size : int) -> list:
56c7171 to
e4f1383
Compare
jwaiton
left a comment
There was a problem hiding this comment.
This PR introduces lecroy oscilloscope processing into MULE! Very exciting day, expanding beyond CAEN decoding.
Good work!
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.