3.5.3. H5Browser

3.5.3.1. Exploring data

The h5 browser is an object that helps browsing of data and metadata. It asks you to select a h5 file and then display a window such as Fig. 3.44. Depending the element of the file you are selecting in the h5 file tree, various metadata can be displayed, such as scan settings or module settings at the time of saving. When double clicking on data type entries in the tree, the data viewer (type Plotting all other data that can display data dimensionality up to 4) will display the selected data node .

h5 browser

Fig. 3.44 h5 browser to explore saved datas

Some options are available when right clicking on a node, see Fig. 3.45.

h5 browser

Fig. 3.45 h5 browser options

  • Export as: allow exporting of the data in the selected node to another known file format

  • Add Comment: add a comment into the metadata of the node

  • Plot Node: plot data (equivalent as double clicking)

  • Plot Nodes: plot data hanging from the same channel

  • Plot Node with Bkg: plot data with subtracted background (if present)

  • Plot Nodes with Bkg: plot data hanging from the same channel with subtracted background (if present)

3.5.3.2. Associating H5Browser with .h5 files

By default, the H5Browser always asks the user to select a file. One can instead open a specified .h5 file directly, using the –input optional command line argument as follows:

h5browser --input my_h5_file.h5.

One can also associate H5Browser to all .h5 file so that it directly opens a file when double clicking on it. Here is how to do it on Windows. Let us assume that you have a conda environment named my_env, in which PyMoDAQ is installed.

In Windows, the path to your conda executable will be something like:

C:\Miniconda3\condabin\conda.bat

Now that you have written down this path, open your favorite text editing tool (e.g. notepad) and create a file called H5Opener.bat (for instance) with the following contents:

@ECHO OFF
call C:\Miniconda3\condabin\conda.bat activate my_env
h5browser --input %1

Note

The precise path of your environment may be different from the one we wrote just above. Check your conda installation to verify this: conda info and conda env list

After creating the file, simply right click on any .h5 file, choose Open with, Try an app on this PC, you should see a list of programs, at the bottom you have to tick Always use this app to open .h5 files and then click Look for another app on this PC. You can browse to the location of H5Opener.bat and you are done. Double clicking any .h5 file will now open the H5Browser directly loading the selected file.