Commit 3397bab9 authored by Thomas White's avatar Thomas White
Browse files

indexamajig: Use HDF5's camera length when requested

parent b6c11993
......@@ -550,6 +550,35 @@ void free_detector_geometry(struct detector *det)
}
struct detector *copy_geom(const struct detector *in)
{
struct detector *out;
int i;
out = malloc(sizeof(struct detector));
memcpy(out, in, sizeof(struct detector));
out->panels = malloc(out->n_panels * sizeof(struct panel));
memcpy(out->panels, in->panels, out->n_panels * sizeof(struct panel));
for ( i=0; i<out->n_panels; i++ ) {
struct panel *p;
p = &out->panels[i];
if ( p->clen_from != NULL ) {
/* Make a copy of the clen_from fields unique to this
* copy of the structure. */
p->clen_from = strdup(p->clen_from);
}
}
return out;
}
struct detector *simple_geometry(const struct image *image)
{
struct detector *geom;
......
......@@ -78,6 +78,8 @@ extern void get_pixel_extents(struct detector *det,
extern void fill_in_values(struct detector *det, struct hdfile *f);
extern struct detector *copy_geom(const struct detector *in);
extern int reverse_2d_mapping(double x, double y, double *pfs, double *pss,
struct detector *det);
......
......@@ -208,7 +208,7 @@ static void process_image(void *pp, int cookie)
image.indexed_cell = NULL;
image.id = cookie;
image.filename = filename;
image.det = pargs->static_args.det;
image.det = copy_geom(pargs->static_args.det);
STATUS("Processing '%s'\n", image.filename);
......@@ -251,6 +251,7 @@ static void process_image(void *pp, int cookie)
return;
}
}
fill_in_values(image.det, hdfile);
if ( config_cmfilter ) {
filter_cm(&image);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment