/* * reflist-utils.c * * Utilities to complement the core reflist.c * * (c) 2006-2011 Thomas White * * Part of CrystFEL - crystallography with a FEL * */ #define _ISOC99_SOURCE #define _GNU_SOURCE #include #include #include #include "reflist.h" #include "cell.h" #include "utils.h" #include "reflist-utils.h" #include "symmetry.h" /** * SECTION:reflist-utils * @short_description: Reflection list utilities * @title: RefList utilities * @section_id: * @see_also: * @include: "reflist-utils.h" * @Image: * * There are some utility functions associated with the core %RefList. **/ int check_list_symmetry(RefList *list, const SymOpList *sym) { Reflection *refl; RefListIterator *iter; SymOpMask *mask; mask = new_symopmask(sym); if ( mask == NULL ) { ERROR("Couldn't create mask for list symmetry check.\n"); return 1; } for ( refl = first_refl(list, &iter); refl != NULL; refl = next_refl(refl, iter) ) { int j; int found = 0; signed int h, k, l; int n; get_indices(refl, &h, &k, &l); special_position(sym, mask, h, k, l); n = num_equivs(sym, mask); for ( j=0; j 1 ) { STATUS("Found %i %i %i: %i times:\n", h, k, l, found); for ( j=0; j *rmax ) *rmax = r; if ( r < *rmin ) *rmin = r; } } /** * max_intensity: * @list: A %RefList * * Returns: The maximum intensity in @list. **/ double max_intensity(RefList *list) { Reflection *refl; RefListIterator *iter; double max; max = -INFINITY; for ( refl = first_refl(list, &iter); refl != NULL; refl = next_refl(refl, iter) ) { double val = get_intensity(refl); if ( val > max ) max = val; } return max; }