/** @page ViewToolsJPSS Use Case: Examining a JPSS NPP File With HDF5 Tools
Navigate back: \ref index "Main" / \ref GettingStarted / \ref ViewToolsCommand
\section secViewToolsJPSSTOC Contents
\ref secViewToolsJPSSDeter
\ref secViewToolsJPSSView
\ref secViewToolsJPSSExam
This tutorial illustrates how to use the HDF5 tools to examine NPP files from the JPSS project. The following files are discussed:
\code
SVM09_npp_d20120229_t0849107_e0854511_b01759_c20120229145452682127_noaa_ops.h5 (gzipped file)
SVM01_npp_d20130524_t1255132_e1256374_b08146_c20130524192048864992_noaa_ops.h5 (gzipped file)
\endcode
\section secViewToolsJPSSDeter Determining File Contents
The first thing you may want to do is determine what is in your file. You can use the command-line tools or HDFView to do this:
\li @ref subsecViewToolsJPSSDeter_h5dump
\li @ref subsecViewToolsJPSSDeter_h5ls
\li @ref subsecViewToolsJPSSDeter_HDFView
JPSS NPP files all contain two root level groups:
Group
Description
/All_Data
Contains the raw data and optional geo-location information.
/Data_Products
Contains a dataset ending in Aggr with
references to objects in the /All_Data group.
Contains granules (datasets with a name ending in Gran_#)
with references to selected regions in datasets under /All_Data.
\subsection subsecViewToolsJPSSDeter_h5dump h5dump
With h5dump you can see a list of the objects
in the file using the -n option:
\code
h5dump -n
\endcode
For example:
\code
$ h5dump -n SVM09_npp_d20120229_t0849107_e0854511_b01759_c20120229145452682127_noaa_ops.h5
HDF5 "SVM09_npp_d20120229_t0849107_e0854511_b01759_c20120229145452682127_noaa_ops.h5" {
FILE_CONTENTS {
group /
group /All_Data
group /All_Data/VIIRS-M9-SDR_All
dataset /All_Data/VIIRS-M9-SDR_All/ModeGran
dataset /All_Data/VIIRS-M9-SDR_All/ModeScan
dataset /All_Data/VIIRS-M9-SDR_All/NumberOfBadChecksums
dataset /All_Data/VIIRS-M9-SDR_All/NumberOfDiscardedPkts
dataset /All_Data/VIIRS-M9-SDR_All/NumberOfMissingPkts
dataset /All_Data/VIIRS-M9-SDR_All/NumberOfScans
dataset /All_Data/VIIRS-M9-SDR_All/PadByte1
dataset /All_Data/VIIRS-M9-SDR_All/QF1_VIIRSMBANDSDR
dataset /All_Data/VIIRS-M9-SDR_All/QF2_SCAN_SDR
dataset /All_Data/VIIRS-M9-SDR_All/QF3_SCAN_RDR
dataset /All_Data/VIIRS-M9-SDR_All/QF4_SCAN_SDR
dataset /All_Data/VIIRS-M9-SDR_All/QF5_GRAN_BADDETECTOR
dataset /All_Data/VIIRS-M9-SDR_All/Radiance
dataset /All_Data/VIIRS-M9-SDR_All/RadianceFactors
dataset /All_Data/VIIRS-M9-SDR_All/Reflectance
dataset /All_Data/VIIRS-M9-SDR_All/ReflectanceFactors
group /Data_Products
group /Data_Products/VIIRS-M9-SDR
dataset /Data_Products/VIIRS-M9-SDR/VIIRS-M9-SDR_Aggr
dataset /Data_Products/VIIRS-M9-SDR/VIIRS-M9-SDR_Gran_0
dataset /Data_Products/VIIRS-M9-SDR/VIIRS-M9-SDR_Gran_1
dataset /Data_Products/VIIRS-M9-SDR/VIIRS-M9-SDR_Gran_2
dataset /Data_Products/VIIRS-M9-SDR/VIIRS-M9-SDR_Gran_3
}
}
\endcode
In the output above you can see that there are four granules (ending in
Gran_#) in the
/Data_Products/VIIRS-M9-SDR/ group.
\subsection subsecViewToolsJPSSDeter_h5ls h5ls
With h5ls you can see a list of the objects in the
file using the -lr
options. The h5ls utility also shows shape and size
(dataspace) information about datasets.
\code
h5ls -lr
\endcode
For example:
\code
$ h5ls -lr SVM09_npp_d20120229_t0849107_e0854511_b01759_c20120229145452682127_noaa_ops.h5
/ Group
/All_Data Group
/All_Data/VIIRS-M9-SDR_All Group
/All_Data/VIIRS-M9-SDR_All/ModeGran Dataset {4/Inf}
/All_Data/VIIRS-M9-SDR_All/ModeScan Dataset {192/Inf}
/All_Data/VIIRS-M9-SDR_All/NumberOfBadChecksums Dataset {192/Inf}
/All_Data/VIIRS-M9-SDR_All/NumberOfDiscardedPkts Dataset {192/Inf}
/All_Data/VIIRS-M9-SDR_All/NumberOfMissingPkts Dataset {192/Inf}
/All_Data/VIIRS-M9-SDR_All/NumberOfScans Dataset {4/Inf}
/All_Data/VIIRS-M9-SDR_All/PadByte1 Dataset {12/Inf}
/All_Data/VIIRS-M9-SDR_All/QF1_VIIRSMBANDSDR Dataset {3072/Inf, 3200/Inf}
/All_Data/VIIRS-M9-SDR_All/QF2_SCAN_SDR Dataset {192/Inf}
/All_Data/VIIRS-M9-SDR_All/QF3_SCAN_RDR Dataset {192/Inf}
/All_Data/VIIRS-M9-SDR_All/QF4_SCAN_SDR Dataset {3072/Inf}
/All_Data/VIIRS-M9-SDR_All/QF5_GRAN_BADDETECTOR Dataset {64/Inf}
/All_Data/VIIRS-M9-SDR_All/Radiance Dataset {3072/Inf, 3200/Inf}
/All_Data/VIIRS-M9-SDR_All/RadianceFactors Dataset {8/Inf}
/All_Data/VIIRS-M9-SDR_All/Reflectance Dataset {3072/Inf, 3200/Inf}
/All_Data/VIIRS-M9-SDR_All/ReflectanceFactors Dataset {8/Inf}
/Data_Products Group
/Data_Products/VIIRS-M9-SDR Group
/Data_Products/VIIRS-M9-SDR/VIIRS-M9-SDR_Aggr Dataset {16/Inf}
/Data_Products/VIIRS-M9-SDR/VIIRS-M9-SDR_Gran_0 Dataset {16/Inf}
/Data_Products/VIIRS-M9-SDR/VIIRS-M9-SDR_Gran_1 Dataset {16/Inf}
/Data_Products/VIIRS-M9-SDR/VIIRS-M9-SDR_Gran_2 Dataset {16/Inf}
/Data_Products/VIIRS-M9-SDR/VIIRS-M9-SDR_Gran_3 Dataset {16/Inf}
\endcode
Note that the Inf indicates that those datasets are appendable or unlimited in size.
\subsection subsecViewToolsJPSSDeter_HDFView HDFView
If you open the file in HDFView, it will display the file and the root level groups within
it in the TreeView on the left. An HDF5 file is a folder with a "5" in the middle, followed
by the file name. There are two folders (groups) within the JPSS file
(All_Data/ and Data Products/),
which you can select to see their contents:
\image html hdfview-tree.png
If you click twice with the left-mouse button on a folder or group in the TreeView, the contents
of the folder will be listed. If you click twice on an object such as a dataset, a window with
the object's values will be displayed.
Underneath the VIIRS-M1-SDR folder are what HDF5
calls datasets. The scarlet letter "A" attached
to the group and datasets under Data_Products/
indicates that there are attributes associated with them.
\section secViewToolsJPSSView Viewing the User Block
All JPSS files contain a user block in XML with information about the file. The user block is an
optional space allocated at the beginning of an HDF5 file that is not interpreted by the HDF5
library. Its size is a multiple of 512.
Since the user block in JPSS files is stored in ASCII and it is stored at the beginning of an
HDF5 file, you could use a text editor or viewer to examine it. However, there are HDF5 utilities
that can help with this:
Utility
Description
h5unjam
Extracts a user block from an HDF5 file
h5dump
The -B (--superblock) option displays the size of the user block in an HDF5 file
\subsection subsecViewToolsJPSSView_h5unjam h5unjam
The \ref secViewToolsEditAdd tutorial topic discusses the use of the
h5jam and h5unjam
utilities for adding or removing a user block from a file. An input HDF5 file
(-i), output HDF5 file
(-o), and user block text file
(-u) can be specified with these tools. You can use the
h5unjam tool to extract and view the user block in a JPSS file:
\code
h5unjam -i -o