forked from demorest/psrfits_utils
-
Notifications
You must be signed in to change notification settings - Fork 7
/
fold.h
60 lines (44 loc) · 1.41 KB
/
fold.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef _FOLD_H
#define _FOLD_H
#include "polyco.h"
struct foldbuf {
int nbin;
int nchan;
int npol;
float *data;
unsigned *count;
};
void malloc_foldbuf(struct foldbuf *f);
void free_foldbuf(struct foldbuf *f);
void clear_foldbuf(struct foldbuf *f);
size_t foldbuf_data_size(const struct foldbuf *f);
size_t foldbuf_count_size(const struct foldbuf *f);
int normalize_transpose_folds(float *out, const struct foldbuf *f);
struct fold_args {
struct polyco *pc;
int imjd;
double fmjd;
char *data;
int nsamp;
double tsamp;
int raw_signed;
struct foldbuf *fb;
float *scale;
float *offset;
};
void *fold_8bit_power_thread(void *_args);
int fold_8bit_power(const struct polyco *pc, int imjd, double fmjd,
const char *data, int nsamp, double tsamp, int raw_signed,
struct foldbuf *f);
void *fold_16bit_power_thread(void *_args);
int fold_16bit_power(const struct polyco *pc, int imjd, double fmjd,
const int16_t *data, int nsamp, double tsamp, int raw_signed,
struct foldbuf *f);
void *fold_float_power_thread(void *_args);
int fold_float_power(const struct polyco *pc, int imjd, double fmjd,
const float *data, int nsamp, double tsamp,
struct foldbuf *f);
int scale_offset_folds(struct foldbuf *f,
const float *scale, const float *offset);
int accumulate_folds(struct foldbuf *ftot, const struct foldbuf *f);
#endif