==================================================================
README for npoi_reader and npoi_align

==================================================================
npoi_reader

npoi_reader takes two arguments, as follows:

	npoi_reader -i INDIR -o OUTDIR

where INDIR and OUTDIR are two directories that already exist.
INDIR is searched for files ending in .fringeData and all
files matching will be processed using the packetdefs.h format.
New files are then written to the OUTDIR directory.

SEE THE NOTE ABOUT NPOI_READER AT THE BOTTOM

==================================================================
npoi_align

npoi_align also takes two arguments:

	npoi_align -i INDIR -o OUTDIR

although they're a bit trickier.  npoi_align MUST ONLY BE RUN
AFTER npoi_reader.

In this case, INDIR is searched for files ending in .alignData
and OUTDIR is searched for files engine in .gz.  The alignData
files are then processed and the data is appended into the
already-existing .gz files.  NO NEW FILES ARE CREATED!!!

More accurately, each .gz file is searched for timestamps
and the appropriate data is loaded from the alignData file.

==================================================================
USAGE

Here's an example.  We'd like to translate data from the night of
2002-05-31.  The following files exist in
/usr2/data/raw/2002-05-31

2002-0531-015835.sidData.3
2002-0531-015836.sidData.2
2002-0531-015836.sidData.6
2002-0531-015838.sidData.1
2002-0531-015841.sidData.5
2002-0531-015843.sidData.4
2002-0531-032403.starLog
2002-0531-032418.alignData
2002-0531-034317.wasaTrack.1
2002-0531-034317.wasaTrack.2
2002-0531-034317.wasaTrack.3
2002-0531-034317.wasaTrack.4
2002-0531-034317.wasaTrack.5
2002-0531-034317.wasaTrack.6
2002-0531-124917.fringeData
2002-0531-125728.fringeData
2002-0531-130323.fringeData
2002-0531.obslog

Running the command:

	npoi_reader -i /usr2/data/raw/2002-05-31 -o\
		 /usr2/data/processed/2002-05-31

will process the three .fringeData files into resultant gzip'd
output files in /usr2/data/processed/2002-05-31.

Running the command:

	npoi_align -i /usr2/data/raw/2002-05-31 -o\
		/usr2/data/processed/2002-05-31

will process the .alignData file and append the information
into the files already sitting in /usr2/data/processed/2002-05-31

Remember that both npoi_reader and npoi_align are smart enough
to ignore input files they're not interested in.

==================================================================
A NOTE ABOUT NPOI_READER

The transition from [record][frame] indexing to [frame] indexing
left the npoi_reader program a bit mangled.  It _does_ work,
but only when a debugging package is compiled into it.

It seems to fail due to some rather subtle memory leaks, none of
which I've actually been able to track down.

For whatever reason, the memory leaks don't become a problem
until you've created and deleted a ton of NPOI_CONTAINERs
into and out of memory.

So for now, use the npoi_reader (which is the only program
affected, AFAIK) with ccmalloc installed, and just ignore all the
garbage collection that takes place.
