pulsefilter.c File Reference

#include <stdio.h>
#include <math.h>
#include <ctype.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <string.h>
#include <assert.h>
#include <sys/types.h>
#include "common.h"

Include dependency graph for pulsefilter.c:

Go to the source code of this file.

Defines

#define MIN_REG_POINTS   10
#define FIRST_PASS_RATIO   10.
#define MIN_WINDOW_LEN   (12*3600)
#define ALLOC_BLOCK   128

Functions

int dtcmp (const void *p1, const void *p2)
int LinearRegression (struct xy *data, int n, double *a, double *b)
 compute the linear regression for the table x[] y[] time origin is supposed to be at the x[0]
void PulseFilter (char *dtfile, double dtmax)
 read a dt file, filter the time pulses The resulting file is named after the input file, replacing 'dt' by 'flt'


Define Documentation

#define ALLOC_BLOCK   128

Definition at line 93 of file pulsefilter.c.

Referenced by PulseFilter().

#define FIRST_PASS_RATIO   10.

Definition at line 34 of file pulsefilter.c.

Referenced by PulseFilter().

#define MIN_REG_POINTS   10

Definition at line 33 of file pulsefilter.c.

Referenced by PulseFilter().

#define MIN_WINDOW_LEN   (12*3600)

Definition at line 35 of file pulsefilter.c.

Referenced by PulseFilter().


Function Documentation

int dtcmp ( const void *  p1,
const void *  p2 
)

Definition at line 39 of file pulsefilter.c.

Referenced by PulseFilter().

int LinearRegression ( struct xy *  data,
int  n,
double *  a,
double *  b 
)

compute the linear regression for the table x[] y[] time origin is supposed to be at the x[0]

Parameters:
data the xy (time,dt) values
n the number of data (x,y)
a slope
b y at x=x[0]
Returns:
0 if the computation could be performed, -1 if not

Definition at line 60 of file pulsefilter.c.

Referenced by PulseFilter().

void PulseFilter ( char *  dtfile,
double  dtmax 
)

read a dt file, filter the time pulses The resulting file is named after the input file, replacing 'dt' by 'flt'

Parameters:
dtfile the file to be filtered
dtmax max acceptable dt difference

Definition at line 99 of file pulsefilter.c.

References ALLOC_BLOCK, dtcmp(), FIRST_PASS_RATIO, fout, LinearRegression(), MIN_REG_POINTS, MIN_WINDOW_LEN, ndata, PrintError, PrintWarning, str2time(), and time2str().

Referenced by CloseTimeFile(), and ParseOptions().

Here is the call graph for this function:


Generated on Tue Jul 22 23:11:57 2008 for Titan2Reader by  doxygen 1.5.6