aboutsummaryrefslogtreecommitdiff
path: root/src/stream.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stream.c')
-rw-r--r--src/stream.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/stream.c b/src/stream.c
index 0d315dcb..4d0a35bd 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -249,6 +249,9 @@ void write_chunk(FILE *ofh, struct image *i, int f)
fprintf(ofh, "photon_energy_eV = %f\n",
J_to_eV(ph_lambda_to_en(i->lambda)));
+
+ //FIXME:we're writing camera length from first panel only.
+ //this should actually write camera length for all panels.
fprintf(ofh, "camera_length = %f\n",i->det->panels[0].clen);
if ( (f & STREAM_PEAKS)
@@ -334,6 +337,20 @@ int read_chunk(FILE *fh, struct image *image)
have_filename = 1;
}
+ if ( strncmp(line, "camera_length = ",16) == 0 ) {
+ //FIXME: assuming here that we have loaded detector
+ //geometry into image prior to calling this routine.
+ //otherise, we don't know how many panels there are!
+ if ( !( image->det == NULL ) ) {
+ int k;
+ double clen;
+ clen = atof( line+16 );
+ for ( k=0; k< image->det->n_panels; k++ ) {
+ image->det->panels[k].clen = clen;
+ }
+ }
+ }
+
if ( strncmp(line, "I0 = ", 5) == 0 ) {
image->i0 = atof(line+5);
image->i0_available = 1;