diff options
author | Thomas White <taw@physics.org> | 2014-12-09 15:51:20 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2014-12-09 16:19:18 +0100 |
commit | 2935b543d8fef89c37c67e04fb17f5e398e9a7f3 (patch) | |
tree | b7c47907ab33d539ad4a3ca8f41cfb8bcfd0ca89 /libcrystfel | |
parent | 22f8072bb728e73be66700c1a5e242cb1d74576b (diff) |
Avoid bottoming out precision for beam parameters in stream
Diffstat (limited to 'libcrystfel')
-rw-r--r-- | libcrystfel/src/stream.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c index 3cc1c0e8..c118e83b 100644 --- a/libcrystfel/src/stream.c +++ b/libcrystfel/src/stream.c @@ -782,8 +782,8 @@ int write_chunk(Stream *st, struct image *i, struct hdfile *hdfile, fprintf(st->fh, "photon_energy_eV = %f\n", J_to_eV(ph_lambda_to_en(i->lambda))); - fprintf(st->fh, "beam_divergence = %.5f mrad\n", i->div*1e3); - fprintf(st->fh, "beam_bandwidth = %.5f %%\n", i->bw*100.0); + fprintf(st->fh, "beam_divergence = %.2e rad\n", i->div); + fprintf(st->fh, "beam_bandwidth = %.2e (fraction)\n", i->bw); copy_hdf5_fields(hdfile, i->copyme, st->fh, ev); @@ -967,8 +967,8 @@ static void read_crystal(Stream *st, struct image *image, StreamReadFlags srf) crystal_set_resolution_limit(cr, lim*1e9); } - if ( sscanf(line, "profile_radius = %f nm^-1", &rad) == 1 ) { - crystal_set_profile_radius(cr, rad*1e9); + if ( sscanf(line, "profile_radius = %e m^-1", &rad) == 1 ) { + crystal_set_profile_radius(cr, rad); } if ( (strcmp(line, REFLECTION_START_MARKER) == 0) @@ -1098,8 +1098,8 @@ int read_chunk_2(Stream *st, struct image *image, StreamReadFlags srf) have_ev = 1; } - if ( sscanf(line, "beam_divergence = %f mrad", &div) == 1 ) { - image->div = div/1e3; + if ( sscanf(line, "beam_divergence = %e rad", &div) == 1 ) { + image->div = div; } if ( sscanf(line, "beam_bandwidth = %f %%", &bw) == 1 ) { |