annotate stat.h @ 155:b060780ade19

Raw data logging enabled by default
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Fri, 31 Jan 2014 21:39:58 +0100
parents e04123ab79ef
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
133
7540703b8473 Major code cleanup. Implement beatnote recentering.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
1 #ifndef __STAT_H__
7540703b8473 Major code cleanup. Implement beatnote recentering.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
2 #define __STAT_H__
7540703b8473 Major code cleanup. Implement beatnote recentering.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
3
7540703b8473 Major code cleanup. Implement beatnote recentering.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
4 struct stat {
7540703b8473 Major code cleanup. Implement beatnote recentering.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
5 int samples;
7540703b8473 Major code cleanup. Implement beatnote recentering.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
6 double mean;
7540703b8473 Major code cleanup. Implement beatnote recentering.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
7 double slope;
7540703b8473 Major code cleanup. Implement beatnote recentering.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
8 double previous;
7540703b8473 Major code cleanup. Implement beatnote recentering.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
9 };
7540703b8473 Major code cleanup. Implement beatnote recentering.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
10
7540703b8473 Major code cleanup. Implement beatnote recentering.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
11 void stat_zero(struct stat *s);
7540703b8473 Major code cleanup. Implement beatnote recentering.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
12 void stat_accumulate(struct stat *s, double value);
7540703b8473 Major code cleanup. Implement beatnote recentering.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
13
139
e04123ab79ef Fix recenter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents: 133
diff changeset
14 /* must be a power of two */
e04123ab79ef Fix recenter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents: 133
diff changeset
15 #define _ROLLMEAN_WLEN 16
133
7540703b8473 Major code cleanup. Implement beatnote recentering.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
16
7540703b8473 Major code cleanup. Implement beatnote recentering.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
17 struct rollmean {
139
e04123ab79ef Fix recenter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents: 133
diff changeset
18 unsigned int nobs;
133
7540703b8473 Major code cleanup. Implement beatnote recentering.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
19 double mean;
7540703b8473 Major code cleanup. Implement beatnote recentering.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
20 double acc;
139
e04123ab79ef Fix recenter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents: 133
diff changeset
21 double prev[_ROLLMEAN_WLEN];
133
7540703b8473 Major code cleanup. Implement beatnote recentering.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
22 };
7540703b8473 Major code cleanup. Implement beatnote recentering.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
23
139
e04123ab79ef Fix recenter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents: 133
diff changeset
24 void rollmean_zero(struct rollmean *s);
133
7540703b8473 Major code cleanup. Implement beatnote recentering.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
25 void rollmean_accumulate(struct rollmean *s, double value);
7540703b8473 Major code cleanup. Implement beatnote recentering.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
26
7540703b8473 Major code cleanup. Implement beatnote recentering.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
27 #endif