Commit 765e6971 authored by Thomas White's avatar Thomas White
Browse files

Bring pattern_sim up to date

parent 31aa8ae2
......@@ -320,6 +320,8 @@ int main(int argc, char *argv[])
image.lambda = ph_en_to_lambda(eV_to_J(PHOTON_ENERGY)); /* Wavelength */
cell = load_cell_from_pdb(filename);
image.filename = NULL;
image.features = NULL;
image.flags = NULL;
#include "geometry-lcls.tmp"
......@@ -382,6 +384,7 @@ int main(int argc, char *argv[])
record_image(&image, !config_nonoise);
if ( config_nearbragg ) {
find_projected_peaks(&image, cell);
output_intensities(&image, cell, NULL, 1);
}
......
......@@ -167,6 +167,9 @@ static int integrate_peak(struct image *image, int xp, int yp,
}
p = find_panel(&image->det, x+xp, y+yp);
if ( p == NULL ) {
return 1;
}
/* Area of one pixel */
pix_area = pow(1.0/p->res, 2.0);
......@@ -396,7 +399,7 @@ void dump_peaks(struct image *image, pthread_mutex_t *mutex)
}
static int find_projected_peaks(struct image *image, UnitCell *cell)
int find_projected_peaks(struct image *image, UnitCell *cell)
{
int x, y;
double ax, ay, az;
......@@ -561,8 +564,13 @@ void output_intensities(struct image *image, UnitCell *cell,
struct imagefeature *f;
/* Wait.. is there a really close feature which was detected? */
f = image_feature_closest(image->features, hits[i].x, hits[i].y,
&d, &idx);
if ( image->features != NULL ) {
f = image_feature_closest(image->features,
hits[i].x, hits[i].y,
&d, &idx);
} else {
f = NULL;
}
if ( (f != NULL) && (d < PEAK_REALLY_CLOSE) ) {
int r;
......
......@@ -24,5 +24,6 @@ extern void dump_peaks(struct image *image, pthread_mutex_t *mutex);
extern void output_intensities(struct image *image, UnitCell *cell,
pthread_mutex_t *mutex, int unpolar);
extern int peak_sanity_check(struct image *image, UnitCell *cell);
extern int find_projected_peaks(struct image *image, UnitCell *cell);
#endif /* PEAKS_H */
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