Source: gdms/cepDataset.h


Annotated List
Files
Globals
Hierarchy
Index

/******************************************************************************
   Imp for the CEP dataset
   Copyright (C) Michael Still                    2002
   Copyright (C) Daniel Fernandez                 2002
   
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.
   
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

******************************************************************************/

#ifndef CEP_DATASET_HEADER
#define CEP_DATASET_HEADER

#include 
#include 

class cepError;

/******************************************************************************
DOCBOOK START

FUNCTION cepDatasetProgressCB
PURPOSE report progress on dataset parsing to the calling method

SYNOPSIS START
typedef void (*cepDatasetProgressCB) (int plane, long lineno);
SYNOPSIS END

DESCRIPTION START
This type is used to define a callback function which will be called whenever a line has been read from the dataset files. plane will the plane that the line belongs to (for example: x, y, and z) and lineno is the line number for the current dataset file.
DESCRIPTION END

SEEALSO cepDataset
DOCBOOK END
******************************************************************************/

typedef void (*cepDatasetProgressCB) (int plane, long lineno);

typedef struct cep_internal_datarow
{
  float date;
  float sample;
  float error;
}
cep_datarow;

// This is used for the 'columns' in the windowing algorithm
typedef vector < cep_datarow > cep_datacol;

class cepDataset
{
public:
  enum direction
  {
    dirX = 0,
    dirY,
    dirZ
  };

  // Filename is the "root filename" e.g. mb_ANKR_GPS
  // I append the .dat1, .dat2 and .dat3 myself...
    cepDataset (const string & filename);
    cepDataset (const string & filename, const cepDatasetProgressCB callback);
    cepDataset (vector < cep_datacol > windowVector, int numWindows);
    cepDataset (double value, double weight);

  // Manipulations 
  cepDataset doWindow (cepDataset::direction dir, double winSize,
                       double overlap);
  cepDataset doHam (double datRow[3], double startWindow, double winSize);

  // Actually process the file
  cepError munch ();

  // Accessor methods
  // Blake - returns null if the get fails
    vector < cep_datarow > &getDataPtr (direction);

private:
    string m_filename;
  cepDatasetProgressCB m_progress;
    vector < cep_datarow > m_datax, m_datay, m_dataz;
    vector < cep_datacol > m_windowVector;      // vector of windowed data
  int m_numWindows;             // number of windows in the windowed data
  double m_hamValue;            // single haming value
  double m_hamWeight;           // hamming weight
};

#endif

Generated by: pob on trillian on Sat Aug 10 17:26:42 2002, using kdoc 2.0a53.