The following is a typescript of a hdf editor session.

Some features not show in the script:

alias/unalias: These commands allow the user to set aliases
ex. alias il info -long
ex. alias	--- shows list of aliases

All options and commands has unique abbreviations, i.e. for alias: a,
al, ali, alia, are all abbreviations since the front of no other
commands matches any of these

Script started on Tue Apr 25 13:29:39 1989
zaphod|1% he -help
he [<file>] [-nobackup] [-batch]
Type <command> -help for usage of command
e.g. "open -help" give help on the open command
DO NOT just type the command and expect a help line
Some commands line delete do not need any argument
If you are just starting to learn, try this program on
a file that is expendable

List of commands:
----------------
open	Open hdf file
close	Close hdf file
revert	Revert to original file
next	Go to next element/group that satisfy predicate
prev	Go to previous...
help	This
info	Show information about data
dump	Do binary display of data
display	Display image using ICR
put	Put data element as binary into raw file
putr8	Put r8 group into raw files
getr8	Get r8 group from raw files
delete	Delete an element/group
write	Write data element/group to another hdf file
annotate Annotate an element
*Special Commands
if	Conditional statement
select	Loop for each element
alias	Set/show aliases
unalias
wait	Message and wait for return
zaphod|2% he
he> ! This is a script of a session on the HDF editor
he> ! It is meant as an example for any one learning to use the editor
he> 
he> ! the exclaimation mark in the FIRST column starts a comment
he> 
he> ! help command
he> help
Type <command> -help for usage of command
e.g. "open -help" give help on the open command
DO NOT just type the command and expect a help line
Some commands line delete do not need any argument
If you are just starting to learn, try this program on
a file that is expendable

List of commands:
----------------
open	Open hdf file
close	Close hdf file
revert	Revert to original file
next	Go to next element/group that satisfy predicate
prev	Go to previous...
help	This
info	Show information about data
dump	Do binary display of data
display	Display image using ICR
put	Put data element as binary into raw file
putr8	Put r8 group into raw files
getr8	Get r8 group from raw files
delete	Delete an element/group
write	Write data element/group to another hdf file
annotate Annotate an element
*Special Commands
if	Conditional statement
select	Loop for each element
alias	Set/show aliases
unalias
wait	Message and wait for return
he> 
he> ! opening a file
he> 
he> open -help
open <file> [-nobackup]
	-nobackup	Don't make a backup for this file.
he> 
he> open h1
he> 
he> ! look into the contents of this file
he> ! using info
he> 
he> info -help
info [-all] [-long] [-group] [-label]
	-all		Show info for all elements in file
	-long		Show more info
	-group		Organize info in group(s)
	-label		Show label if any
he> 
he> info -all -label -long
(1) Machine type        (Utility)   : (tag 107)
	Ref: 4369, Offset: 0, Length: 0 (bytes)
	Label: Sun Machine type??
(2) Scientific Data     (SciData)   : (tag 702)
	Ref: 1, Offset: 202, Length: 40000 (bytes)
(3) Number type         (Utility)   : (tag 106)
	Ref: 1, Offset: 40202, Length: 4 (bytes)
(4) SciData description (SciData)   : (tag 701)
	Ref: 1, Offset: 40206, Length: 22 (bytes)
(5) SciData scales      (SciData)   : (tag 703)
	Ref: 1, Offset: 40228, Length: 802 (bytes)
(6) SciData max/min     (SciData)   : (tag 707)
	Ref: 1, Offset: 41030, Length: 8 (bytes)
*(7) Scientific Data Group (SciData) : (tag 700)
	Ref: 1, Offset: 41038, Length: 16 (bytes)
	Label: testing 1 2 3 4 5 6 7 8 9 0....<additional stuff>
(8) Data Id Label       (Utility)   : (tag 104)
	Ref: 2, Offset: 41275, Length: 53 (bytes)
(9) Data Id Label       (Utility)   : (tag 104)
	Ref: 3, Offset: 41230, Length: 22 (bytes)
(10) Data Id Annotation  (Utility)   : (tag 105)
	Ref: 4, Offset: 41252, Length: 23 (bytes)
Empty (tag 1) : 6 slots.
he> info -group -all
**Group 1:
Scientific Data Group (SciData) : (tag 700), Ref: 1
Scientific Data     (SciData)   : (tag 702), Ref: 1
SciData description (SciData)   : (tag 701), Ref: 1
SciData scales      (SciData)   : (tag 703), Ref: 1
SciData max/min     (SciData)   : (tag 707), Ref: 1

**These do not belong to any group:
Machine type        (Utility)   : (tag 107), Ref: 4369
Number type         (Utility)   : (tag 106), Ref: 1
Data Id Label       (Utility)   : (tag 104), Ref: 2
Data Id Label       (Utility)   : (tag 104), Ref: 3
Data Id Annotation  (Utility)   : (tag 105), Ref: 4
Empty (tag 1) : 6 slots.
he> 
he> ! move in the file using next and prev
he> ! the move direction depend on the relative positions so it is often
he> ! necessary to do a info -all first
he> 
he> info -all
(1) Machine type        (Utility)   : (tag 107), Ref: 4369
(2) Scientific Data     (SciData)   : (tag 702), Ref: 1
(3) Number type         (Utility)   : (tag 106), Ref: 1
(4) SciData description (SciData)   : (tag 701), Ref: 1
(5) SciData scales      (SciData)   : (tag 703), Ref: 1
(6) SciData max/min     (SciData)   : (tag 707), Ref: 1
*(7) Scientific Data Group (SciData) : (tag 700), Ref: 1
(8) Data Id Label       (Utility)   : (tag 104), Ref: 2
(9) Data Id Label       (Utility)   : (tag 104), Ref: 3
(10) Data Id Annotation  (Utility)   : (tag 105), Ref: 4
Empty (tag 1) : 6 slots.
he> 
he> ! the star in the first column marks the current position
he> ! The next and prev commands work on prediactes
he> ! default prediacte is "group"
he> ! this means that each move will move to the next/prev group
he> ! if I now want to move to the max/min element, I can use the tag=
he> ! predicate
he> 
he> prev tag=707
he> info 
(6) SciData max/min     (SciData)   : (tag 707), Ref: 1
he> 
he> ! other predicates are ref", "any", with comparattors "=", "!=", ">", "<"
he> ! ">=", "<=" 
he> ! for example, "group ref >= 10" is legal and matches a group with ref>=10
he> 
he> ! this predicate for next and prev are persistent. That means that if I
he> ! now do another next, it will look for a tag=707
he> 
he> next
Reached end of file. Not moved.
he> info
(6) SciData max/min     (SciData)   : (tag 707), Ref: 1
he> 
he> ! to go back to groups 
he> next group
he> info
(7) Scientific Data Group (SciData) : (tag 700), Ref: 1
he> 
he> ! to see the binary representation of this elt
he> 
he> dump -help
dump [-offset <offset>] [-length <len>]
	[-decimal|-octal|-hexidecimal|-float|-ascii]
	Od the present element
	-offset		Start offset
	-length		Length to look at
	-decimal	Decimal format
	-octal		Octal format
	-hexidecimal	Hexidecimal format
	-float		Float format
	-ascii		Ascii format
he> 
he> dump 
0000000  001276 000001 001275 000001 001277 000001 001303 000001
0000020
he> 
he> dump -decimal
0000000  00702 00001 00701 00001 00703 00001 00707 00001
0000020
he> 
he> ! deleting groups
he> 
he> delete -help
delete
	Delete this element or group.
he> 
he> ! if an elt is required by other groups it is left alone
he> ! However, this is not perfect since the way the group membership 
he> ! is determined can be pretty ad hoc
he> 
he> info -all -group
**Group 1:
Scientific Data Group (SciData) : (tag 700), Ref: 1
Scientific Data     (SciData)   : (tag 702), Ref: 1
SciData description (SciData)   : (tag 701), Ref: 1
SciData scales      (SciData)   : (tag 703), Ref: 1
SciData max/min     (SciData)   : (tag 707), Ref: 1

**These do not belong to any group:
Machine type        (Utility)   : (tag 107), Ref: 4369
Number type         (Utility)   : (tag 106), Ref: 1
Data Id Label       (Utility)   : (tag 104), Ref: 2
Data Id Label       (Utility)   : (tag 104), Ref: 3
Data Id Annotation  (Utility)   : (tag 105), Ref: 4
Empty (tag 1) : 6 slots.
he> delete
he> info -all
(1) Machine type        (Utility)   : (tag 107), Ref: 4369
(3) Number type         (Utility)   : (tag 106), Ref: 1
(8) Data Id Label       (Utility)   : (tag 104), Ref: 2
(9) Data Id Label       (Utility)   : (tag 104), Ref: 3
(10) Data Id Annotation  (Utility)   : (tag 105), Ref: 4
Empty (tag 1) : 11 slots.
he> info -all -group

**These do not belong to any group:
Machine type        (Utility)   : (tag 107), Ref: 4369
Number type         (Utility)   : (tag 106), Ref: 1
Data Id Label       (Utility)   : (tag 104), Ref: 2
Data Id Label       (Utility)   : (tag 104), Ref: 3
Data Id Annotation  (Utility)   : (tag 105), Ref: 4
Empty (tag 1) : 11 slots.
he> 
he> ! lets delete an elt
he> 
he> next tag=104 ref=3
he> info -all
(1) Machine type        (Utility)   : (tag 107), Ref: 4369
(3) Number type         (Utility)   : (tag 106), Ref: 1
(8) Data Id Label       (Utility)   : (tag 104), Ref: 2
*(9) Data Id Label       (Utility)   : (tag 104), Ref: 3
(10) Data Id Annotation  (Utility)   : (tag 105), Ref: 4
Empty (tag 1) : 11 slots.
he> delete
he> info -all
(1) Machine type        (Utility)   : (tag 107), Ref: 4369
(3) Number type         (Utility)   : (tag 106), Ref: 1
(8) Data Id Label       (Utility)   : (tag 104), Ref: 2
(10) Data Id Annotation  (Utility)   : (tag 105), Ref: 4
Empty (tag 1) : 12 slots.
he> 
he> ! reverting to original file
he> ! this cannot work if nobackup is used when opening the file
he> 
he> revert
he> 
he> info -all
(1) Machine type        (Utility)   : (tag 107), Ref: 4369
(2) Scientific Data     (SciData)   : (tag 702), Ref: 1
(3) Number type         (Utility)   : (tag 106), Ref: 1
(4) SciData description (SciData)   : (tag 701), Ref: 1
(5) SciData scales      (SciData)   : (tag 703), Ref: 1
(6) SciData max/min     (SciData)   : (tag 707), Ref: 1
*(7) Scientific Data Group (SciData) : (tag 700), Ref: 1
(8) Data Id Label       (Utility)   : (tag 104), Ref: 2
(9) Data Id Label       (Utility)   : (tag 104), Ref: 3
(10) Data Id Annotation  (Utility)   : (tag 105), Ref: 4
Empty (tag 1) : 6 slots.
he> 
he> ! annotations
he> ! labels and descriptors
he> 
he> info -label -all
(1) Machine type        (Utility)   : (tag 107), Ref: 4369
	Label: Sun Machine type??
(2) Scientific Data     (SciData)   : (tag 702), Ref: 1
(3) Number type         (Utility)   : (tag 106), Ref: 1
(4) SciData description (SciData)   : (tag 701), Ref: 1
(5) SciData scales      (SciData)   : (tag 703), Ref: 1
(6) SciData max/min     (SciData)   : (tag 707), Ref: 1
*(7) Scientific Data Group (SciData) : (tag 700), Ref: 1
	Label: testing 1 2 3 4 5 6 7 8 9 0....<additional stuff>
(8) Data Id Label       (Utility)   : (tag 104), Ref: 2
(9) Data Id Label       (Utility)   : (tag 104), Ref: 3
(10) Data Id Annotation  (Utility)   : (tag 105), Ref: 4
Empty (tag 1) : 6 slots.
he> 
he> annotate -help
annotate [-label|-descriptor] [-editor <editor>]
	Edit an annotation
	-label		Edit label (default)
	-descriptor	Edit descriptor
	-editor		Use editor (default EDITOR env value)
he> 
he> annotate -editor /usr/ucb/ex
"/tmp/he965.0" 1 line, 32 characters
:p
testing 1 2 3 4 5 6 7 8 9 0....
:s/$/<some additional stuff>/
testing 1 2 3 4 5 6 7 8 9 0....<some additional stuff>
:wq
"/tmp/he965.0" 1 line, 55 characters
he> info -label
(7) Scientific Data Group (SciData) : (tag 700), Ref: 1
	Label: testing 1 2 3 4 5 6 7 8 9 0....<some additional stuff>
he> 
he> annotate -descriptor -editor /usr/ucb/ex
"/tmp/he965.1" 1 line, 48 characters
:p
gdshjfhjdf asdgy sdf sdgf sdfg sgdfh as dbf asl
:c
This is the descriptor, it can have non-graphic characters
.
:wq
"/tmp/he965.1" 1 line, 58 characters
he> 
he> info -all
(1) Machine type        (Utility)   : (tag 107), Ref: 4369
(2) Scientific Data     (SciData)   : (tag 702), Ref: 1
(3) Number type         (Utility)   : (tag 106), Ref: 1
(4) SciData description (SciData)   : (tag 701), Ref: 1
(5) SciData scales      (SciData)   : (tag 703), Ref: 1
(6) SciData max/min     (SciData)   : (tag 707), Ref: 1
*(7) Scientific Data Group (SciData) : (tag 700), Ref: 1
(8) Data Id Label       (Utility)   : (tag 104), Ref: 2
(9) Data Id Label       (Utility)   : (tag 104), Ref: 3
(10) Data Id Annotation  (Utility)   : (tag 105), Ref: 4
(11) Data Id Annotation  (Utility)   : (tag 105), Ref: 5
(12) Data Id Annotation  (Utility)   : (tag 105), Ref: 6
(13) Data Id Annotation  (Utility)   : (tag 105), Ref: 7
Empty (tag 1) : 3 slots.
he> 
he> ! write to another hdf file
he> 
he> write -help
write <file> [-attachto <atag> <aref>]
	Write an element or group into another HDF file
	-attchto	ONLY for writing annontations
			What element to attach annotation to
he> 
he> write test
he> 
he> ! lets look at test
he> close;open test;info -all
(1) Scientific Data     (SciData)   : (tag 702), Ref: 1
(2) Scientific Data     (SciData)   : (tag 702), Ref: 2
(3) Scientific Data     (SciData)   : (tag 702), Ref: 3
(4) Number type         (Utility)   : (tag 106), Ref: 3
(5) SciData description (SciData)   : (tag 701), Ref: 3
(6) SciData scales      (SciData)   : (tag 703), Ref: 3
(7) SciData max/min     (SciData)   : (tag 707), Ref: 3
*(8) Scientific Data Group (SciData) : (tag 700), Ref: 3
Empty (tag 1) : 8 slots.
he> 
he> close;
he> 
he> !look at some files with r8
he> 
he> open denm.hdf
he> info -all -label
(1) Raster Image        (Raster)    : (tag 302), Ref: 1
(2) Image Palette       (Raster)    : (tag 301), Ref: 1
(3) Image Palette-8     (Raster-8)  : (tag 201), Ref: 1
(4) Raster Image-8      (Raster-8)  : (tag 202), Ref: 1
(5) Image Dimensions    (Raster)    : (tag 300), Ref: 1
*(6) Raster Image Group  (Raster)    : (tag 306), Ref: 1
(7) Image Dimensions-8  (Raster-8)  : (tag 200), Ref: 1
(8) Compressed Image    (Raster)    : (tag 303), Ref: 2
(9) Image Palette       (Raster)    : (tag 301), Ref: 2
(10) Image Palette-8     (Raster-8)  : (tag 201), Ref: 2
(11) Compressed Image-8  (Raster-8)  : (tag 203), Ref: 2
(12) Image Dimensions    (Raster)    : (tag 300), Ref: 2
(13) Raster Image Group  (Raster)    : (tag 306), Ref: 2
(14) Image Dimensions-8  (Raster-8)  : (tag 200), Ref: 2
(15) Compressed Image    (Raster)    : (tag 303), Ref: 3
(16) Image Palette       (Raster)    : (tag 301), Ref: 3
(17) Image Palette-8     (Raster-8)  : (tag 201), Ref: 3
(18) Unknown Tag                     : (tag 304), Ref: 3
(19) Image Dimensions    (Raster)    : (tag 300), Ref: 3
(20) Raster Image Group  (Raster)    : (tag 306), Ref: 3
(21) Image Dimensions-8  (Raster-8)  : (tag 200), Ref: 3
Empty (tag 1) : 11 slots.
he> 
he> ! display displays the current r8 group image via ICR
he> ! i.e. if you are using NCSAtelnet on a MacII, this would work
he> ! not guaranteed to work otherwise
he> 
he> ! putr8 puts an r8 group into raw files
he> putr8 -help
putr8 [-image <img>] [-palette <pal>] [-verbose]
	Put an r8 group into raw image and palette files
	-image		Image file name template (default "img#.@.%")
	-palette	Palette file name template (default "pal#")
	-verbose	To give output of steps taken
he> 
he> putr8 -image my_image#.@.% -palette my_palette -verbose
Writing to file: my_image5.512.256
Writing to file: my_palette
he> 
he> ! getr8 works in the reverse fashion
he> getr8 -help
getr8 <image> <xdim> <ydim> [-palette <palette>] [-raster|-rle|-imcomp]
	Get a r8 group from raw files
	-palette	Raw palette file
	-raster		No compression (default)
	-rle		Run-length compression
	-imcomp		Imcomp compression
he> 
he> ! to step through a file and say, putr8 on all r8 groups
he> ! we can use the select command
he> 
he> select -help
select [<prediactes>]
  <commands>*
end
	Steps through all elements in the file that satisfies the
	prediactes and execute the commands on them.
he> 
he> select tag=306
  >> putr8 -image testImages# -palette testPalettes# -verbose
  >> end
Writing to file: testImages5
Writing to file: testPalettes5
Writing to file: testImages12
Writing to file: testPalettes12
Writing to file: testImages19
Writing to file: testPalettes19
he> 
he> ! select and if commands take the same prediactes as next and prev
he> ! there is also the predicates "succeed" and "fail" that test the
he> ! return status of the last command
he> 
he> 
he> ! put puts an elt into a binary file
he> ! this is a dumb routine and does not know about the formats
he> ! of the element
he> 
he> put -help
put [-file <file>] [-verbose]
	Put the raw binary of this element in a file
	-file		Out file name (default "elt#.@")
	-verbose	Output diagnostic info
he> 
he> put -file binary#
he> put -file myBinary -verbose
Writing to file: myBinary
he> 
he> ! thats it for now
he> revert;close;quit
zaphod|2% exit
zaphod|3% 
script done on Tue Apr 25 16:00:38 1989
