European-XFEL / h5glance

Explore HDF5 files in terminal & HTML views
BSD 3-Clause "New" or "Revised" License
65 stars 7 forks source link

Quicker access to sample data #29

Open leguyader opened 2 years ago

leguyader commented 2 years ago

h5glance is a great tool to check for example the number of frame recorded by the DSSC in some old run. However, at the moment I have to type a lengthy command:

h5glance r0038/RAW-R0038-DSSC15-S00000.h5 INSTRUMENT/SCS_DET_DSSC1M-1/DET/15CH0:xtdf/header/pulseCount
r0038/RAW-R0038-DSSC15-S00000.h5/INSTRUMENT/SCS_DET_DSSC1M-1/DET/15CH0:xtdf/header/pulseCount
      dtype: uint64
      shape: 512
   maxshape: Unlimited
     layout: Chunked
      chunk: 32
compression: None (options: None)

sample data:
[36 36 36 36 36 36 36 36 36 36]

0 attributes:

One way to make this simpler is TAB completion (which has some issue too #19 ), but maybe even quicker would be to allow: h5glance r0038/RAW-R0038-DSSC15-S00000.h5 pulseCount

takluyver commented 2 years ago

Tab completion is implemented - you can use python -m h5glance.completer to install it for bash & zsh. If you're using h5glance with any frequency, I'd strongly recommend doing this - it's a vastly better experience being able to tab down the paths inside the file. If you can't install it for some reason, you can put the path as - and it will prompt you for a path within the program, with tab completion enabled.