aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/detector.h
diff options
context:
space:
mode:
authorValerio Mariani <valerio.mariani@desy.de>2015-01-26 16:34:46 +0100
committervalerio.mariani@desy.de <vmariani@cfeld-valerio2.desy.de>2015-01-27 14:11:32 +0100
commitf82046030009a17113c4f15d5f89cfee8c8f0ce5 (patch)
treee02a98a6684f3085efadcb0c3de8b472585d5852 /libcrystfel/src/detector.h
parent32aa9fdf2cd23cd2d7f9fc6574ffec59b629a7f3 (diff)
Introduce "rigid group collections"
Diffstat (limited to 'libcrystfel/src/detector.h')
-rw-r--r--libcrystfel/src/detector.h113
1 files changed, 67 insertions, 46 deletions
diff --git a/libcrystfel/src/detector.h b/libcrystfel/src/detector.h
index f43df2cc..87fcc890 100644
--- a/libcrystfel/src/detector.h
+++ b/libcrystfel/src/detector.h
@@ -71,52 +71,61 @@ struct rigid_group
};
-struct panel
+struct rg_collection
{
- char name[1024]; /* Name for this panel */
+ char *name;
+ struct rigid_group **rigid_groups;
+ int n_rigid_groups;
+};
- /* Position of panel in the data block in memory (see below) */
- int min_fs; /* Smallest FS value considered to be in the panel */
- int max_fs; /* Largest FS value considered to be in this panel */
- int min_ss; /* ... and so on */
- int max_ss;
- double cnx; /* Location of corner (min_fs,min_ss) in pixels */
- double cny;
- double coffset;
- double clen; /* Camera length in metres */
- char *clen_from;
- char *mask;
- double res; /* Resolution in pixels per metre */
- char badrow; /* 'x' or 'y' */
- int no_index; /* Don't index peaks in this panel if non-zero */
- struct rigid_group *rigid_group; /* Rigid group */
- double adu_per_eV; /* Number of ADU per eV */
- double max_adu; /* Treat pixel as unreliable if higher than this */
- char *data;
-
- struct dim_structure *dim_structure;
-
- double fsx;
- double fsy;
- double ssx;
- double ssy;
-
- double xfs;
- double yfs;
- double xss;
- double yss;
-
- /* Position of the panel in the data block in the file. The panels may
- * get moved around when the file is loaded (see hdf5_read2()),
- * especially if the panels come from different HDF5 elements. */
- int orig_min_fs;
- int orig_max_fs;
- int orig_min_ss;
- int orig_max_ss;
-
- int w; /* Width, calculated as max_fs-min_fs+1 */
- int h; /* Height, calculated as max_ss-min_ss+1 */
+struct panel
+{
+
+ char name[1024]; /* Name for this panel */
+
+ /* Position of panel in the data block in memory (see below) */
+ int min_fs; /* Smallest FS value considered to be in the panel */
+ int max_fs; /* Largest FS value considered to be in this panel */
+ int min_ss; /* ... and so on */
+ int max_ss;
+
+ double cnx; /* Location of corner (min_fs,min_ss) in pixels */
+ double cny;
+ double coffset;
+ double clen; /* Camera length in metres */
+ char *clen_from;
+ char *mask;
+ double res; /* Resolution in pixels per metre */
+ char badrow; /* 'x' or 'y' */
+ int no_index; /* Don't index peaks in this panel if non-zero */
+ struct rigid_group *rigid_group; /* Rigid group */
+ double adu_per_eV; /* Number of ADU per eV */
+ double max_adu; /* Treat pixel as unreliable if higher than this */
+ char *data;
+
+ struct dim_structure *dim_structure;
+
+ double fsx;
+ double fsy;
+ double ssx;
+ double ssy;
+
+ double xfs;
+ double yfs;
+ double xss;
+ double yss;
+
+ /* Position of the panel in the data block in the file. The panels may
+ * get moved around when the file is loaded (see hdf5_read2()),
+ * especially if the panels come from different HDF5 elements. */
+ int orig_min_fs;
+ int orig_max_fs;
+ int orig_min_ss;
+ int orig_max_ss;
+
+ int w; /* Width, calculated as max_fs-min_fs+1 */
+ int h; /* Height, calculated as max_ss-min_ss+1 */
};
@@ -156,6 +165,9 @@ struct detector
struct rigid_group **rigid_groups;
int n_rigid_groups;
+ struct rg_collection **rigid_group_collections;
+ int n_rg_collections;
+
/* Location of the pixel furthest away from the beam position, which
* will have the largest value of 2theta regardless of camera length
* and wavelength */
@@ -207,6 +219,12 @@ extern void get_pixel_extents(struct detector *det,
extern void fill_in_values(struct detector *det, struct hdfile *f,
struct event* ev);
+extern int panel_is_in_rigid_group(const struct rigid_group *rg,
+ struct panel *p);
+
+extern int rigid_group_is_in_collection(struct rg_collection *c,
+ struct rigid_group *rg);
+
extern struct detector *copy_geom(const struct detector *in);
extern int reverse_2d_mapping(double x, double y, double *pfs, double *pss,
@@ -218,10 +236,11 @@ extern double smallest_q(struct image *image);
extern struct panel *find_panel_by_name(struct detector *det, const char *name);
-extern int write_detector_geometry(const char* geometry_filename,
+extern int write_detector_geometry(const char *geometry_filename,
const char *output_filename,
- struct detector *det);
-
+ struct detector *det,
+ const char *additional_comment,
+ int write_panel_coffset);
extern void mark_resolution_range_as_bad(struct image *image,
double min, double max);
@@ -229,6 +248,8 @@ extern void mark_resolution_range_as_bad(struct image *image,
extern int single_panel_data_source (struct detector *det, const char *element);
+struct rg_collection *find_rigid_group_collection_by_name(struct detector *det,
+ const char *name);
#ifdef __cplusplus
}