larpix / larpix-control

Control the LArPix chip
Other
4 stars 12 forks source link

Add hdf5 utility scripts #240

Closed peter-madigan closed 3 years ago

peter-madigan commented 3 years ago

Adds two scripts to help manage larpix hdf5 files:

which are intended to be used with the corresponding file types.

Currently, I've implemented the ability to merge or split raw hdf5 files, as well as the ability to merge packet hdf5 files.

@soleti can you test packet_hdf5_tool.py --merge for the simulation?

soleti commented 3 years ago

I tried to merge two datalog simulated files: /global/homes/s/soleti/larnd-sim/cli/edepsim_1M_datalog.h5 /global/homes/s/soleti/larnd-sim/cli/edepsim_1M_datalog_2.h5 The merging looked successful, but when I tried to convert the datalog files in the evd format I got this error:

Traceback (most recent call last):ents found: 1421      time remaining 0.01min...
  File "to_evd_file.py", line 255, in <module>
    main(**vars(args))
  File "to_evd_file.py", line 148, in main
    unix_ts = np.concatenate([[ts_grp[0]]*len(ts_grp[1:]) for ts_grp in ts_grps if len(ts_grp) > 1], axis=0)
  File "<__array_function__ internals>", line 6, in concatenate
ValueError: need at least one array to concatenate

The error is not raised when converting the two files separately.

peter-madigan commented 3 years ago

Can you point me to the merged file? I'll do some debugging.

On Fri, Apr 16, 2021 at 12:21 PM Stefano Roberto Soleti < @.***> wrote:

I tried to merge two datalog simulated files: /global/homes/s/soleti/larnd-sim/cli/edepsim_1M_datalog.h5 /global/homes/s/soleti/larnd-sim/cli/edepsim_1M_datalog_2.h5 The merging looked successful, but when I tried to convert the datalog files in the evd format I got this error:

Traceback (most recent call last):ents found: 1421 time remaining 0.01min... File "to_evd_file.py", line 255, in main(*vars(args)) File "to_evd_file.py", line 148, in main unix_ts = np.concatenate([[ts_grp[0]]len(ts_grp[1:]) for ts_grp in ts_grps if len(ts_grp) > 1], axis=0) File "<__array_function__ internals>", line 6, in concatenate ValueError: need at least one array to concatenate

The error is not raised when converting the two files separately.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/larpix/larpix-control/pull/240#issuecomment-821512068, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEKVRQGHZ5IE6UMTNQOUCZTTJCE45ANCNFSM43AJPSXA .

soleti commented 3 years ago

I copied the files here /project/projectdirs/dune/www/data/Module0/simulation/edepsim. Curiously, the merged file is smaller than the sum of the original two...