2.1.4. Viewing 2-D Data from LRMECS

The IPNS LRMECS instrument stored data in NeXus HDF4 data files. One such example is available from the repository of NeXus data file examples. For this example, we will start with a conversion of that original data file into HDF5 format.

This dataset contains two histograms with 2-D images (148x750 and 148x32) of 32-bit integers. First, we use the h5dump tool to investigate the header content of the file (not showing any of the data).

2.1.4.1. Visualize Using h5dump

Here, the output of the command:

h5dump -H lrcs3701.nx5

has been edited to only show the first NXdata group (/Histogram1/data):

LRMECS lrcs3701 data: h5dump output

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
HDF5 "C:\Users\Pete\Documents\eclipse\NeXus\definitions\exampledata\IPNS\LRMECS\lrcs3701.nx5" {
GROUP "/Histogram1/data" {
   DATASET "data" {
      DATATYPE  H5T_STD_I32LE
      DATASPACE  SIMPLE { ( 148, 750 ) / ( 148, 750 ) }
   }
   DATASET "polar_angle" {
      DATATYPE  H5T_IEEE_F32LE
      DATASPACE  SIMPLE { ( 148 ) / ( 148 ) }
   }
   DATASET "time_of_flight" {
      DATATYPE  H5T_IEEE_F32LE
      DATASPACE  SIMPLE { ( 751 ) / ( 751 ) }
   }
   DATASET "title" {
      DATATYPE  H5T_STRING {
            STRSIZE 44;
            STRPAD H5T_STR_NULLTERM;
            CSET H5T_CSET_ASCII;
            CTYPE H5T_C_S1;
         }
      DATASPACE  SIMPLE { ( 1 ) / ( 1 ) }
   }
}
}

2.1.4.2. Visualize Using HDFview

For many, the simplest way to view the data content of an HDF5 file is to use the HDFview program (http://www.hdfgroup.org/hdf-java-html/hdfview) from The HDF Group. After starting HDFview, the data file may be loaded by dragging it into the main HDF window. On opening up to the first NXdata group /Histogram1/data (as above), and then double-clicking the dataset called: data, we get our first view of the data.

fig.data-linking

LRMECS lrcs3701 data: HDFview

The data may be represented as an image by accessing the Open As menu from HDFview (on Windows, right click the dataset called data and select the Open As item, consult the HDFview documentation for different platform instructions). Be sure to select the Image radio button, and then (accepting everything else as a default) press the Ok button.

Note

In this image, dark represents low intensity while white represents high intensity.

../../_images/hdfview-open-as.jpg

LRMECS lrcs3701 data: HDFview Open As dialog

LRMECS lrcs3701 data: image

../../_images/hdfview-image.jpg

LRMECS lrcs3701 data: HDFview Image

2.1.4.3. Visualize Using IgorPro

Another way to visualize this data is to use a commercial package for scientific data visualization and analysis. One such package is IgorPro from http://www.wavemetrics.com

IgorPro provides a browser for HDF5 files that can open our NeXus HDF5 and display the image. Follow the instructions from WaveMetrics to install the HDF5 Browser package: http://www.wavemetrics.com/products/igorpro/dataaccess/hdf5.htm

You may not have to do this step if you have already installed the HDF5 Browser. IgorPro will tell you if it is not installed properly. To install the HDF5 Browser, first start IgorPro. Next, select from the menus and submenus: Data; Load Waves; Packages; Install HDF5 Package as shown in the next figure. IgorPro may direct you to perform more activities before you progress from this step.

../../_images/igor-install-hdf5-package.jpg

LRMECS lrcs3701 data: IgorPro install HDF5 Browser

Next, open the HDF5 Browser by selecting from the menus and submenus: Data; Load Waves; New HDF5 Browser as shown in the next figure.

../../_images/igor-menu-selection.jpg

LRMECS lrcs3701 data: IgorPro HDFBrowser dialog

Next, click the Open HDF5 File button and open the NeXus HDF5 file lrcs3701.nxs. In the lower left Groups panel, click the data dataset. Also, under the panel on the right called Load Dataset Options, choose No Table as shown. Finally, click the Load Dataset button (in the Datasets group) to display the image.

Note

In this image, dark represents low intensity while white represents high intensity. The image has been rotated for easier representation in this manual.

../../_images/Igor-HDFBrowser-demo.jpg

LRMECS lrcs3701 data: IgorPro HDFBrowser dialog

LRMECS lrcs3701 data: image

../../_images/igor-data.jpg

LRMECS lrcs3701 data: IgorPro Image