diff options
author | Alexandra Tolstikova <alexandra.tolstikova@desy.de> | 2017-11-22 16:58:10 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2018-09-10 15:01:29 +0200 |
commit | 5a50a82a9ee0936d67901f43e68ca37455a7814b (patch) | |
tree | 81df87a96485d981257dc9161cd2010e7674f903 | |
parent | 17aec9c77e9b75510e43b0fb073df75f66849761 (diff) |
Change image.spectrum to image.spectrum0 to use a different structure for spectrum.
-rw-r--r-- | libcrystfel/src/hdf5-file.c | 4 | ||||
-rw-r--r-- | libcrystfel/src/image.h | 2 | ||||
-rw-r--r-- | src/diffraction-gpu.c | 10 | ||||
-rw-r--r-- | src/diffraction.c | 8 | ||||
-rw-r--r-- | src/partial_sim.c | 2 | ||||
-rw-r--r-- | src/pattern_sim.c | 10 | ||||
-rw-r--r-- | tests/gpu_sim_check.c | 8 |
7 files changed, 22 insertions, 22 deletions
diff --git a/libcrystfel/src/hdf5-file.c b/libcrystfel/src/hdf5-file.c index 7e3d6b11..f9c2aa97 100644 --- a/libcrystfel/src/hdf5-file.c +++ b/libcrystfel/src/hdf5-file.c @@ -1047,9 +1047,9 @@ int hdf5_write_image(const char *filename, const struct image *image, write_photon_energy(fh, ph_lambda_to_eV(image->lambda), ph_en_loc); - if ( image->spectrum != NULL && image->spectrum_size > 0 ) { + if ( image->spectrum0 != NULL && image->spectrum_size > 0 ) { - write_spectrum(fh, image->spectrum, image->spectrum_size, + write_spectrum(fh, image->spectrum0, image->spectrum_size, image->nsamples); } diff --git a/libcrystfel/src/image.h b/libcrystfel/src/image.h index 29ce8ae1..357a550a 100644 --- a/libcrystfel/src/image.h +++ b/libcrystfel/src/image.h @@ -213,7 +213,7 @@ struct image { int serial; /* Monotonically ascending serial * number for this image */ - struct sample *spectrum; + struct sample *spectrum0; int nsamples; /* Number of wavelengths */ int spectrum_size; /* Size of "spectrum" */ diff --git a/src/diffraction-gpu.c b/src/diffraction-gpu.c index b0ed52ea..79b5443d 100644 --- a/src/diffraction-gpu.c +++ b/src/diffraction-gpu.c @@ -342,16 +342,16 @@ int get_diffraction_gpu(struct gpu_context *gctx, struct image *image, for ( i=0; i<image->nsamples; i++ ) { printf("%.3f eV, weight = %.5f\n", - ph_lambda_to_eV(1.0/image->spectrum[i].k), - image->spectrum[i].weight); + ph_lambda_to_eV(1.0/image->spectrum0[i].k), + image->spectrum0[i].weight); - err = do_panels(gctx, image, image->spectrum[i].k, - image->spectrum[i].weight, + err = do_panels(gctx, image, image->spectrum0[i].k, + image->spectrum0[i].weight, &n_inf, &n_neg, &n_nan); if ( err ) return 1; - tot += image->spectrum[i].weight; + tot += image->spectrum0[i].weight; } printf("total weight = %f\n", tot); diff --git a/src/diffraction.c b/src/diffraction.c index 97750f58..4dc21c59 100644 --- a/src/diffraction.c +++ b/src/diffraction.c @@ -772,13 +772,13 @@ void get_diffraction(struct image *image, int na, int nb, int nc, for ( i=0; i<image->nsamples; i++ ) { printf("%.1f eV, weight = %.5f\n", - ph_lambda_to_eV(1.0/image->spectrum[i].k), - image->spectrum[i].weight); + ph_lambda_to_eV(1.0/image->spectrum0[i].k), + image->spectrum0[i].weight); diffraction_at_k(image, intensities, phases, - flags, cell, m, sym, image->spectrum[i].k, + flags, cell, m, sym, image->spectrum0[i].k, ax, ay, az, bx, by, bz, cx, cy, cz, - lut_a, lut_b, lut_c, image->spectrum[i].weight); + lut_a, lut_b, lut_c, image->spectrum0[i].weight); } diff --git a/src/partial_sim.c b/src/partial_sim.c index 218780fd..012b0a59 100644 --- a/src/partial_sim.c +++ b/src/partial_sim.c @@ -844,7 +844,7 @@ int main(int argc, char *argv[]) image.num_peaks = 0; image.num_saturated_peaks = 0; image.spectrum_size = 0; - image.spectrum = NULL; + image.spectrum0 = NULL; image.serial = 0; image.event = NULL; diff --git a/src/pattern_sim.c b/src/pattern_sim.c index d47c4b60..5b25100e 100644 --- a/src/pattern_sim.c +++ b/src/pattern_sim.c @@ -819,7 +819,7 @@ int main(int argc, char *argv[]) powder.det = image.det; powder.beam = NULL; powder.lambda = 0.0; - powder.spectrum = NULL; + powder.spectrum0 = NULL; powder.dp = malloc(image.det->n_panels*sizeof(float *)); if ( powder.dp == NULL ) { ERROR("Failed to allocate powder data\n"); @@ -978,19 +978,19 @@ int main(int argc, char *argv[]) switch ( spectrum_type ) { case SPECTRUM_TOPHAT : - image.spectrum = generate_tophat(&image); + image.spectrum0 = generate_tophat(&image); break; case SPECTRUM_SASE : - image.spectrum = generate_SASE(&image, rng); + image.spectrum0 = generate_SASE(&image, rng); break; case SPECTRUM_TWOCOLOUR : - image.spectrum = generate_twocolour(&image); + image.spectrum0 = generate_twocolour(&image); break; case SPECTRUM_FROMFILE : - image.spectrum = generate_spectrum_fromfile(&image, + image.spectrum0 = generate_spectrum_fromfile(&image, spectrum_fn); break; diff --git a/tests/gpu_sim_check.c b/tests/gpu_sim_check.c index 8c666775..aee7a068 100644 --- a/tests/gpu_sim_check.c +++ b/tests/gpu_sim_check.c @@ -157,8 +157,8 @@ int main(int argc, char *argv[]) gpu_image.det = det; cpu_image.beam = NULL; gpu_image.beam = NULL; - cpu_image.spectrum = NULL; - gpu_image.spectrum = NULL; + cpu_image.spectrum0 = NULL; + gpu_image.spectrum0 = NULL; cpu_image.lambda = ph_en_to_lambda(eV_to_J(6000)); gpu_image.lambda = ph_en_to_lambda(eV_to_J(6000)); @@ -167,8 +167,8 @@ int main(int argc, char *argv[]) cpu_image.nsamples = 10; gpu_image.nsamples = 10; - cpu_image.spectrum = generate_tophat(&cpu_image); - gpu_image.spectrum = generate_tophat(&gpu_image); + cpu_image.spectrum0 = generate_tophat(&cpu_image); + gpu_image.spectrum0 = generate_tophat(&gpu_image); start = get_hires_seconds(); if ( get_diffraction_gpu(gctx, &gpu_image, 8, 8, 8, cell, 0, 0) ) { |