THG Home 
hdiff

hdiff examples

This page describes some examples of use and the output of hdiff . The basic usage of the tool is described here. These examples use the files hdifftst1.hdf and hdifftst2.hdf

The following table shows the hdp output of the sds and vdata in the files.


Example: 0.0
Command: hdiff -b hdifftst1.hdf hdifftst2.hdf
Notes:  Compare files with verbose mode (-b)
Output: 

---------------------------------------
  Tag    Ref    Name
---------------------------------------
  720      2    dset1
  720      4    dset2
 1962     21    vdata1
 1962     22    vdata2
 1962     23    vdata3
---------------------------------------
  Tag    Ref    Name
---------------------------------------
  720      2    dset1
  720      4    dset2
 1962     21    vdata1
 1962     22    vdata2
 1962     23    vdata3
---------------------------------------
file1     file2
---------------------------------------
    x      x    dset1
    x      x    dset2
    x      x    vdata1
    x      x    vdata2
    x      x    vdata3
Comparing <dset1>
position        dset1           dset1           difference
------------------------------------------------------------
[ 0 1 ]          1               2               1
[ 1 0 ]          1               3               2
[ 1 1 ]          1               4               3
---------------------------
dset1:Valid_range =
<<<<
1.f, 1.f ;
>>>>
1.f, 2.f ;
Comparing <dset2>
position        dset2           dset2           difference
------------------------------------------------------------
[ 0 1 ]          1               2               1
[ 1 0 ]          1               3               2
[ 1 1 ]          1               4               3
Comparing <vdata1>
---------------------------
Vdata Name: vdata1 (Data record comparison)
> 0: V
< 0: X
Comparing <vdata2>
---------------------------
Vdata Name: vdata2 (Data record comparison)
> 0: 1 2 3 4
< 0: 1 1 1 1
Comparing <vdata3>
---------------------------
Vdata Name: vdata3 (Data record comparison)
> 0: 1.000000 2.000000 3.000000 4.000000 5.000000 6.000000
< 0: 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000
---------------------------
Attr Name: File_contents
< "Storm_track_data1"
> "Storm_track_data2"

Example: 1.0
Command: hdiff -g hdifftst1.hdf hdifftst2.hdf
Notes:  Compare global attributes only
Output: 

---------------------------
Attr Name: File_contents
< "Storm_track_data1"
> "Storm_track_data2"

Example: 1.1
Command: hdiff -s hdifftst1.hdf hdifftst2.hdf
Notes:  Compare SD local attributes only
Output: 

---------------------------
dset1:Valid_range =
<<<<
1.f, 1.f ;
>>>>
1.f, 2.f ;

Example: 1.2
Command: hdiff -d hdifftst1.hdf hdifftst2.hdf
Notes:  Compare SD data only
Output: 

position        dset1           dset1           difference
------------------------------------------------------------
[ 0 1 ]          1               2               1
[ 1 0 ]          1               3               2
[ 1 1 ]          1               4               3
position        dset2           dset2           difference
------------------------------------------------------------
[ 0 1 ]          1               2               1
[ 1 0 ]          1               3               2
[ 1 1 ]          1               4               3

Example: 1.3
Command: hdiff -D hdifftst1.hdf hdifftst2.hdf
Notes:  Compare Vdata data only
Output: 

---------------------------
Vdata Name: vdata1 (Data record comparison)
> 0: V
< 0: X
---------------------------
Vdata Name: vdata2 (Data record comparison)
> 0: 1 2 3 4
< 0: 1 1 1 1
---------------------------
Vdata Name: vdata3 (Data record comparison)
> 0: 1.000000 2.000000 3.000000 4.000000 5.000000 6.000000
< 0: 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000

Example: 1.4
Command: $hdiff -d -S hdifftst1.hdf hdifftst2.hdf
Notes:  Print statistics
Output: 

position        dset1           dset1           difference
------------------------------------------------------------
[ 0 1 ]          1               2               1
[ 1 0 ]          1               3               2
[ 1 1 ]          1               4               3
Type: Integer4  Npts: 6  Ndiff: 3 (50.000000%)
Avg Diff: 1.000000e+000   Max. Diff: 3
Range File1: 1/6  File2: 1/6
Regression  N: 6  Slope: 6.727273e-001  Intercept: 1.818182e+000  R: 8.433083e-0
01
position        dset2           dset2           difference
------------------------------------------------------------
[ 0 1 ]          1               2               1
[ 1 0 ]          1               3               2
[ 1 1 ]          1               4               3
Type: Integer4  Npts: 6  Ndiff: 3 (50.000000%)
Avg Diff: 1.000000e+000   Max. Diff: 3
Range File1: 1/6  File2: 1/6
Regression  N: 6  Slope: 6.727273e-001  Intercept: 1.818182e+000  R: 8.433083e-0
01

Example: 1.5
Command: hdiff -d -v dset1 hdifftst1.hdf hdifftst2.hdf
Notes:  Compare SD data on variable(s) <var1>,... only
Output: 

position        dset1           dset1           difference
------------------------------------------------------------
[ 0 1 ]          1               2               1
[ 1 0 ]          1               3               2
[ 1 1 ]          1               4               3


Example: 1.6
Command: hdiff -D -u vdata1 hdifftst1.hdf hdifftst2.hdf
Notes:  Compare vdata on variable(s) <var1>,... only
Output: 

---------------------------
Vdata Name: vdata1 (Data record comparison)
> 0: V
< 0: X


Example: 1.7
Command: hdiff -d -e 2 hdifftst1.hdf hdifftst2.hdf
Notes:  Print difference up to count number for each variable
Output: 

position        dset1           dset1           difference
------------------------------------------------------------
[ 0 1 ]          1               2               1
[ 1 0 ]          1               3               2
position        dset2           dset2           difference
------------------------------------------------------------
[ 0 1 ]          1               2               1
[ 1 0 ]          1               3               2

Example: 1.8
Command: hdiff -d -t 2 hdifftst1.hdf hdifftst2.hdf
Notes:  Print difference when it is greater than limit
Output: 

position        dset1           dset1           difference
------------------------------------------------------------
[ 1 1 ]          1               4               3
position        dset2           dset2           difference
------------------------------------------------------------
[ 1 1 ]          1               4               3


Last modified: March 19, 2007
Describes hdiff examples