[9e8dc22] | 1 | #if !defined(invertor_h) |
---|
| 2 | #define invertor_h |
---|
| 3 | |
---|
[896abb3] | 4 | /** |
---|
| 5 | * Internal data structure for P(r) inversion |
---|
| 6 | */ |
---|
[9e8dc22] | 7 | typedef struct { |
---|
[896abb3] | 8 | /// Maximum distance between any two points in the system |
---|
[9e8dc22] | 9 | double d_max; |
---|
[896abb3] | 10 | /// q data |
---|
[9e8dc22] | 11 | double *x; |
---|
[896abb3] | 12 | /// I(q) data |
---|
[9e8dc22] | 13 | double *y; |
---|
[896abb3] | 14 | /// dI(q) data |
---|
[9e8dc22] | 15 | double *err; |
---|
[896abb3] | 16 | /// Number of q points |
---|
[9a23253e] | 17 | int npoints; |
---|
[896abb3] | 18 | /// Number of I(q) points |
---|
[9a23253e] | 19 | int ny; |
---|
[896abb3] | 20 | /// Number of dI(q) points |
---|
[9a23253e] | 21 | int nerr; |
---|
[896abb3] | 22 | /// Alpha value |
---|
[eca05c8] | 23 | double alpha; |
---|
[896abb3] | 24 | /// Minimum q to include in inversion |
---|
[f71287f4] | 25 | double q_min; |
---|
[896abb3] | 26 | /// Maximum q to include in inversion |
---|
[f71287f4] | 27 | double q_max; |
---|
[9a23253e] | 28 | /// Flag for whether or not to evalute a constant background while inverting |
---|
| 29 | int has_bck; |
---|
| 30 | /// Slit height in units of q [A-1] |
---|
| 31 | double slit_height; |
---|
| 32 | /// Slit width in units of q [A-1] |
---|
| 33 | double slit_width; |
---|
| 34 | } Invertor_params; |
---|
[9e8dc22] | 35 | |
---|
| 36 | void invertor_dealloc(Invertor_params *pars); |
---|
| 37 | |
---|
| 38 | void invertor_init(Invertor_params *pars); |
---|
| 39 | |
---|
| 40 | double pr_sphere(double R, double r); |
---|
| 41 | double ortho(double d_max, int n, double r); |
---|
| 42 | double ortho_transformed(double d_max, int n, double q); |
---|
| 43 | double ortho_derived(double d_max, int n, double r); |
---|
| 44 | double iq(double *c, double d_max, int n_c, double q); |
---|
| 45 | double pr(double *c, double d_max, int n_c, double r); |
---|
[eca05c8] | 46 | double dprdr(double *pars, double d_max, int n_c, double r); |
---|
[abad620] | 47 | double reg_term(double *pars, double d_max, int n_c, int nslice); |
---|
| 48 | double int_p2(double *pars, double d_max, int n_c, int nslice); |
---|
[9a23253e] | 49 | void pr_err(double *pars, double *err, double d_max, int n_c, |
---|
[eca05c8] | 50 | double r, double *pr_value, double *pr_value_err); |
---|
[4f63160] | 51 | int npeaks(double *pars, double d_max, int n_c, int nslice); |
---|
[43c0a8e] | 52 | double positive_integral(double *pars, double d_max, int n_c, int nslice); |
---|
| 53 | double positive_errors(double *pars, double *err, double d_max, int n_c, int nslice); |
---|
[9a23253e] | 54 | double rg(double *pars, double d_max, int n_c, int nslice); |
---|
| 55 | double int_pr(double *pars, double d_max, int n_c, int nslice); |
---|
| 56 | double ortho_transformed_smeared(double d_max, int n, double heigth, double width, double q, int npts); |
---|
[f168d02] | 57 | double iq_smeared(double *pars, double d_max, int n_c, double height, double width, double q, int npts); |
---|
[4f63160] | 58 | |
---|
[9e8dc22] | 59 | #endif |
---|