aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-07-02 15:12:22 +0200
committerThomas White <taw@physics.org>2012-02-22 15:26:52 +0100
commit81ce39f9d6e6df5ec2bfd54ca1c1a57edd1f22dc (patch)
treef18e2472e1d7402e409950b67c3734cfe4e4bf05
parentc9d6dd115a6a1cd89eafb6cf8e588844017221eb (diff)
pattern_sim: Don't go looking for phases if they're not needed
This allows old reflection lists (without phases) to be used as long as you don't want phased gradients.
-rw-r--r--src/pattern_sim.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/src/pattern_sim.c b/src/pattern_sim.c
index 91c5247e..5d59d71b 100644
--- a/src/pattern_sim.c
+++ b/src/pattern_sim.c
@@ -290,21 +290,6 @@ int main(int argc, char *argv[])
return 1;
}
- if ( intfile == NULL ) {
- /* Gentle reminder */
- STATUS("You didn't specify the file containing the ");
- STATUS("reflection intensities (with --intensities).\n");
- STATUS("I'll simulate a flat intensity distribution.\n");
- intensities = NULL;
- counts = NULL;
- phases = NULL;
- } else {
- counts = new_list_count();
- phases = new_list_phase();
- intensities = read_reflections(intfile, counts, phases);
- free(intfile);
- }
-
if ( grad_str == NULL ) {
STATUS("You didn't specify a gradient calculation method, so"
" I'm using the 'mosaic' method, which is fastest.\n");
@@ -332,6 +317,25 @@ int main(int argc, char *argv[])
return 1;
}
+ if ( intfile == NULL ) {
+ /* Gentle reminder */
+ STATUS("You didn't specify the file containing the ");
+ STATUS("reflection intensities (with --intensities).\n");
+ STATUS("I'll simulate a flat intensity distribution.\n");
+ intensities = NULL;
+ counts = NULL;
+ phases = NULL;
+ } else {
+ counts = new_list_count();
+ if ( grad == GRADIENT_PHASED ) {
+ phases = new_list_phase();
+ } else {
+ phases = NULL;
+ }
+ intensities = read_reflections(intfile, counts, phases);
+ free(intfile);
+ }
+
/* Define image parameters */
image.width = 1024;
image.height = 1024;