diff options
author | Andrew Aquila <andrew.aquila@cfel.de> | 2011-03-28 16:09:43 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:27 +0100 |
commit | 9e74643aed68c2d221452a8912de48ce06135354 (patch) | |
tree | e7d3210a3f1c1b7d3368a4bb6df0940aceddae31 /src/stream.c | |
parent | fa2c2dcf80cc3510aab0e0b8f6ed9fb6c020687a (diff) |
Add many new features to powder_plot
Diffstat (limited to 'src/stream.c')
-rw-r--r-- | src/stream.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/stream.c b/src/stream.c index 99344404..e3bc3c87 100644 --- a/src/stream.c +++ b/src/stream.c @@ -168,7 +168,7 @@ static int read_peaks(FILE *fh, struct image *image) first = 0; if ( r == 4 ) { image_add_feature(image->features, x, y, - image, 1.0, NULL); + image, intensity, NULL); } } while ( rval != NULL ); @@ -450,3 +450,22 @@ int skip_some_files(FILE *fh, int n) return 1; } + +int is_stream(const char *filename) { + FILE *fh; + char line[1024]; + char *rval = NULL; + fh = fopen(filename, "r"); + rval = fgets(line, 1023, fh); + fclose(fh); + if ( rval == NULL ) { + return -1; + } + if ( strncmp(line, "CrystFEL stream format 2.0", 26) == 0 ) { + return 1; + } + else { + return 0; + } + return -1; +} |