org.mbari.oasis
Class HRDataCleaner

java.lang.Object
  extended byorg.mbari.oasis.HRDataCleaner

public class HRDataCleaner
extends java.lang.Object

Converts OASIS hydrorad data files to binary. The binary can then be used by hobilabs or other processing programs. Useful class for taking the hex dump of Hydorad data that the Oasis can transmits and converting it back to binary. This class also splits out different instruments into different files and removes extraneous information. It currently works only with Oasis files...it chops off the first token of each line. Typically this is the Oasis time. However, it should be easy enough to modify this class if it needs to be applied to non-oasis files. This class will loop through ALL files if a directory is specified. It also accepts individual files as arguments.

Version:
26 Mar 2001
Author:
Brian Schlining
See Also:
AsciiHexReader

Constructor Summary
HRDataCleaner(java.io.File infile, java.io.File dest)
          This form of constructor will not append a prefix on to the output files
HRDataCleaner(java.io.File infile, java.io.File dest, java.lang.String prefix)
          The constructor doesn't check for read write access to any files.
HRDataCleaner(java.lang.String infile, java.lang.String dest)
          This form of constructor will not append a prefix on to the output files
HRDataCleaner(java.lang.String infile, java.lang.String dest, java.lang.String prefix)
           
 
Method Summary
static void main(java.lang.String[] args)
          HRDataCleaner can be run from the command line as well as integrated into other programs.
 void seperate()
          This method will start the processing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HRDataCleaner

public HRDataCleaner(java.io.File infile,
                     java.io.File dest,
                     java.lang.String prefix)
              throws java.io.IOException
The constructor doesn't check for read write access to any files. Thats done in the seperate method. It reads the file specified or ALL the files in a directory if a directory is specified (SO make sure they're all HR data files)

The output file(s) are dumped to the destination directory specifed. The output file(s) will be named _.bin. So, if you specify prefix=HR1 the resulting files could be name HR1_HR2.bin or HR1_HR4.bin

Parameters:
infile - A file object referering to the fiel or directory of files containing data to seperate
dest - The directory to write the resulting files to.
prefix - The prefix to prepend to the output files name
Throws:
java.io.IOException - Thrown is errors reading either infile or dest occurs

HRDataCleaner

public HRDataCleaner(java.lang.String infile,
                     java.lang.String dest,
                     java.lang.String prefix)
              throws java.io.IOException
Parameters:
infile - A file object referering to the file or directory of files containing data to seperate
dest - The directory to write the resulting files to.
prefix - The prefix to prepend to the output files name

HRDataCleaner

public HRDataCleaner(java.lang.String infile,
                     java.lang.String dest)
              throws java.io.IOException
This form of constructor will not append a prefix on to the output files

Parameters:
infile - A file object referering to the fiel or directory of files containing data to seperate
dest - The directory to write the resulting files to.

HRDataCleaner

public HRDataCleaner(java.io.File infile,
                     java.io.File dest)
              throws java.io.IOException
This form of constructor will not append a prefix on to the output files

Parameters:
infile - A file object referering to the fiel or directory of files containing data to seperate
dest - The directory to write the resulting files to.
Method Detail

seperate

public void seperate()
              throws java.io.IOException
This method will start the processing. A typical use would be:

HRDataCleaner hdc = new HRDataCleaner(....);
hdc.seperate();

Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
HRDataCleaner can be run from the command line as well as integrated into other programs. The command line systax is:
org.mbari.oasis.HRDataCleaner
where filename specifies the name of the file to process. Alternatively, you may specify a data directory that contains only OASIS formatted hydrorad files. In this case all files in the directory will be converted to binary files. Note:The directory should only contain data from one of the channels. (Oasis normally splits the data to directories name hr1, hr2, hr3, hr4 which each contain channesl 1, 2, 3, or 4 respectively). One file for each instrument will be created from data in a directory.

Parameters:
args - Command line arguments