diff options
author | Thomas White <taw@physics.org> | 2010-10-25 16:25:57 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:03 +0100 |
commit | 0309dfadf55b72023bb9d9131b80a701c211f684 (patch) | |
tree | 161cd1d45ba67aaeebacb15de88cac0344b293ad /src/beam-parameters.c | |
parent | 380ec553c04576fc3dc4c816127078d3c2cf9e32 (diff) |
Add "bandwidth" to beam parameters file
Also, fix previous commit.
Diffstat (limited to 'src/beam-parameters.c')
-rw-r--r-- | src/beam-parameters.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/beam-parameters.c b/src/beam-parameters.c index 73dc2897..9f5a0dde 100644 --- a/src/beam-parameters.c +++ b/src/beam-parameters.c @@ -37,6 +37,7 @@ struct beam_params *get_beam_parameters(const char *filename) b->fluence = -1.0; b->beam_radius = -1.0; b->photon_energy = -1.0; + b->bandwidth = -1.0; b->dqe = -1.0; b->adu_per_photon = -1.0; b->water_radius = -1.0; @@ -66,17 +67,19 @@ struct beam_params *get_beam_parameters(const char *filename) } if ( strcmp(bits[0], "beam/fluence") == 0 ) { - b->fluence = atof(bits[0]); + b->fluence = atof(bits[2]); } else if ( strcmp(bits[0], "beam/radius") == 0 ) { - b->beam_radius = atof(bits[0]); + b->beam_radius = atof(bits[2]); } else if ( strcmp(bits[0], "beam/photon_energy") == 0 ) { - b->photon_energy = atof(bits[0]); + b->photon_energy = atof(bits[2]); + } else if ( strcmp(bits[0], "beam/bandwidth") == 0 ) { + b->bandwidth = atof(bits[2]); } else if ( strcmp(bits[0], "detector/dqe") == 0 ) { - b->dqe = atof(bits[0]); + b->dqe = atof(bits[2]); } else if ( strcmp(bits[0], "detector/adu_per_photon") == 0 ) { - b->adu_per_photon = atof(bits[0]); + b->adu_per_photon = atof(bits[2]); } else if ( strcmp(bits[0], "jet/radius") == 0 ) { - b->water_radius = atof(bits[0]); + b->water_radius = atof(bits[2]); } else { ERROR("Unrecognised field '%s'\n", bits[0]); } @@ -102,6 +105,10 @@ struct beam_params *get_beam_parameters(const char *filename) " 'beam/photon_energy'.\n"); reject = 1; } + if ( b->bandwidth < 0.0 ) { + ERROR("Invalid or unspecified value for 'beam/bandwidth'.\n"); + reject = 1; + } if ( b->dqe < 0.0 ) { ERROR("Invalid or unspecified value for 'detector/dqe'.\n"); reject = 1; |