diff options
Diffstat (limited to 'libcrystfel/src')
-rw-r--r-- | libcrystfel/src/beam-parameters.c | 14 | ||||
-rw-r--r-- | libcrystfel/src/beam-parameters.h | 6 | ||||
-rw-r--r-- | libcrystfel/src/detector.c | 2 |
3 files changed, 13 insertions, 9 deletions
diff --git a/libcrystfel/src/beam-parameters.c b/libcrystfel/src/beam-parameters.c index 2236fddb..617f9061 100644 --- a/libcrystfel/src/beam-parameters.c +++ b/libcrystfel/src/beam-parameters.c @@ -149,11 +149,17 @@ struct beam_params *get_beam_parameters(const char *filename) return b; } -void fill_in_beamParam(struct beam_params *beam, struct hdfile *f) + +void free_beam_parameters(struct beam_params *beam) +{ + free(beam->photon_energy_from); + free(beam); +} + + +void fill_in_beam_parameters(struct beam_params *beam, struct hdfile *f) { if ( beam->photon_energy_from != NULL ) { - beam->photon_energy = get_value(f, beam->photon_energy_from ); - free(beam->photon_energy_from); - beam->photon_energy_from = NULL; + beam->photon_energy = get_value(f, beam->photon_energy_from); } } diff --git a/libcrystfel/src/beam-parameters.h b/libcrystfel/src/beam-parameters.h index e0b16895..8212811b 100644 --- a/libcrystfel/src/beam-parameters.h +++ b/libcrystfel/src/beam-parameters.h @@ -41,6 +41,7 @@ struct beam_params double fluence; /* photons per pulse */ double beam_radius; /* metres */ double photon_energy; /* eV per photon */ + char *photon_energy_from; /* HDF5 dataset name */ double bandwidth; /* FWHM(wavelength) over wavelength. * Note: current simulation code just uses * a rectangular distribution with this as @@ -48,13 +49,12 @@ struct beam_params double divergence; /* divergence (radians) */ double profile_radius; /* Reciprocal space size of a reflection */ - - char *photon_energy_from; /* hdf5 group name */ }; extern struct beam_params *get_beam_parameters(const char *filename); +extern void free_beam_parameters(struct beam_params *beam); -extern void fill_in_beamParam(struct beam_params *beam, struct hdfile *f); +extern void fill_in_beam_parameters(struct beam_params *beam, struct hdfile *f); #endif /* BEAM_PARAMETERS_H */ diff --git a/libcrystfel/src/detector.c b/libcrystfel/src/detector.c index 4216838d..41ebcc9a 100644 --- a/libcrystfel/src/detector.c +++ b/libcrystfel/src/detector.c @@ -462,8 +462,6 @@ void fill_in_values(struct detector *det, struct hdfile *f) if ( p->clen_from != NULL ) { p->clen = get_value(f, p->clen_from) * 1.0e-3; - free(p->clen_from); - p->clen_from = NULL; } p->clen += p->coffset; |