diff options
author | Thomas White <taw@physics.org> | 2021-01-22 15:52:37 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2021-01-22 15:57:33 +0100 |
commit | cfdbf3be72e936450d5cf09691fc0320c3752e66 (patch) | |
tree | 15be6140e3ed3a6e2bb283e6bf81418db663d4ef /libcrystfel/src | |
parent | a8911944b66861b692e5e36c8e9374439b9649b2 (diff) |
Improve names for FoM API
Diffstat (limited to 'libcrystfel/src')
-rw-r--r-- | libcrystfel/src/fom.c | 24 | ||||
-rw-r--r-- | libcrystfel/src/fom.h | 23 |
2 files changed, 25 insertions, 22 deletions
diff --git a/libcrystfel/src/fom.c b/libcrystfel/src/fom.c index 1296b53f..e10df5b8 100644 --- a/libcrystfel/src/fom.c +++ b/libcrystfel/src/fom.c @@ -43,7 +43,7 @@ #include "reflist.h" #include "reflist-utils.h" -enum fom get_fom(const char *s) +enum fom_type fom_type_from_string(const char *s) { if ( strcasecmp(s, "r1i") == 0 ) return FOM_R1I; if ( strcasecmp(s, "r1f") == 0 ) return FOM_R1F; @@ -63,7 +63,7 @@ enum fom get_fom(const char *s) } -static struct fom_context *init_fom(enum fom fom, int nmax, int nshells) +static struct fom_context *init_fom(enum fom_type fom, int nmax, int nshells) { struct fom_context *fctx; int i; @@ -427,9 +427,10 @@ double fom_shell(struct fom_context *fctx, int i) } -struct shells *make_intensity_shells(double min_I, double max_I, int nshells) +struct fom_shells *fom_make_intensity_shells(double min_I, double max_I, + int nshells) { - struct shells *s; + struct fom_shells *s; int i; if ( min_I >= max_I ) { @@ -441,7 +442,7 @@ struct shells *make_intensity_shells(double min_I, double max_I, int nshells) * populated part of the reflections */ max_I = min_I + (max_I-min_I)/5000.0; - s = malloc(sizeof(struct shells)); + s = malloc(sizeof(struct fom_shells)); if ( s == NULL ) return NULL; s->rmins = malloc(nshells*sizeof(double)); @@ -467,13 +468,14 @@ struct shells *make_intensity_shells(double min_I, double max_I, int nshells) } -struct shells *make_resolution_shells(double rmin, double rmax, int nshells) +struct fom_shells *fom_make_resolution_shells(double rmin, double rmax, + int nshells) { - struct shells *s; + struct fom_shells *s; double total_vol, vol_per_shell; int i; - s = malloc(sizeof(struct shells)); + s = malloc(sizeof(struct fom_shells)); if ( s == NULL ) return NULL; s->rmins = malloc(nshells*sizeof(double)); @@ -509,7 +511,7 @@ struct shells *make_resolution_shells(double rmin, double rmax, int nshells) } -double shell_label(struct shells *s, int i) +double fom_shell_label(struct fom_shells *s, int i) { if ( s->config_intshells ) { return (i+0.5) / s->nshells; @@ -519,7 +521,7 @@ double shell_label(struct shells *s, int i) } -static int get_bin(struct shells *s, Reflection *refl, UnitCell *cell) +static int get_bin(struct fom_shells *s, Reflection *refl, UnitCell *cell) { if ( s->config_intshells ) { @@ -674,7 +676,7 @@ static int wilson_scale(RefList *list1, RefList *list2, UnitCell *cell) struct fom_context *fom_calculate(RefList *list1, RefList *list2, UnitCell *cell, - struct shells *shells, enum fom fom, + struct fom_shells *shells, enum fom_type fom, int noscale, SymOpList *sym) { Reflection *refl1; diff --git a/libcrystfel/src/fom.h b/libcrystfel/src/fom.h index 968278b4..8af434e8 100644 --- a/libcrystfel/src/fom.h +++ b/libcrystfel/src/fom.h @@ -38,7 +38,7 @@ #include <reflist.h> #include <symmetry.h> -enum fom +enum fom_type { FOM_R1I, FOM_R1F, @@ -54,7 +54,7 @@ enum fom FOM_D2SIG }; -struct shells +struct fom_shells { int config_intshells; int nshells; @@ -64,7 +64,7 @@ struct shells struct fom_context { - enum fom fom; + enum fom_type fom; int nshells; int *cts; @@ -88,22 +88,23 @@ struct fom_context extern struct fom_context *fom_calculate(RefList *list1, RefList *list2, - UnitCell *cell, struct shells *shells, - enum fom fom, int noscale, + UnitCell *cell, + struct fom_shells *shells, + enum fom_type fom, int noscale, SymOpList *sym); -extern struct shells *make_resolution_shells(double rmin, double rmax, - int nshells); +extern struct fom_shells *fom_make_resolution_shells(double rmin, double rmax, + int nshells); -extern struct shells *make_intensity_shells(double min_I, double max_I, - int nshells); +extern struct fom_shells *fom_make_intensity_shells(double min_I, double max_I, + int nshells); -extern double shell_label(struct shells *s, int i); +extern double fom_shell_label(struct fom_shells *s, int i); extern double fom_shell(struct fom_context *fctx, int i); extern double fom_overall(struct fom_context *fctx); -extern enum fom get_fom(const char *s); +extern enum fom_type fom_type_from_string(const char *s); #endif /* FOM */ |