|
#define | STREAM_GEOM_START_MARKER "----- Begin geometry file -----" |
|
#define | STREAM_GEOM_END_MARKER "----- End geometry file -----" |
|
#define | STREAM_CELL_START_MARKER "----- Begin unit cell -----" |
|
#define | STREAM_CELL_END_MARKER "----- End unit cell -----" |
|
#define | STREAM_CHUNK_START_MARKER "----- Begin chunk -----" |
|
#define | STREAM_CHUNK_END_MARKER "----- End chunk -----" |
|
#define | STREAM_PEAK_LIST_START_MARKER "Peaks from peak search" |
|
#define | STREAM_PEAK_LIST_END_MARKER "End of peak list" |
|
#define | STREAM_CRYSTAL_START_MARKER "--- Begin crystal" |
|
#define | STREAM_CRYSTAL_END_MARKER "--- End crystal" |
|
#define | STREAM_REFLECTION_START_MARKER "Reflections measured after indexing" |
|
#define | STREAM_REFLECTION_END_MARKER "End of reflections" |
|
|
typedef struct _stream | Stream |
|
typedef struct _streamindex | StreamIndex |
|
|
Stream * | stream_open_for_read (const char *filename) |
|
Stream * | stream_open_for_write (const char *filename, const DataTemplate *dtempl) |
|
Stream * | stream_open_fd_for_write (int fd, const DataTemplate *dtempl) |
|
void | stream_close (Stream *st) |
|
void | stream_write_data_template (Stream *st, const DataTemplate *dtempl) |
|
void | stream_write_geometry_file (Stream *st, const char *geom_filename) |
|
void | stream_write_target_cell (Stream *st, UnitCell *cell) |
|
void | stream_write_commandline_args (Stream *st, int argc, char *argv[]) |
|
void | stream_write_indexing_methods (Stream *st, const char *indm_str) |
|
int | stream_has_old_indexers (Stream *st) |
|
char * | stream_audit_info (Stream *st) |
|
char * | stream_geometry_file (Stream *st) |
|
FILE * | stream_get_fh (Stream *st) |
|
int | stream_rewind (Stream *st) |
|
StreamIndex * | stream_make_index (const char *filename) |
|
int | stream_select_chunk (Stream *st, StreamIndex *index, const char *filename, const char *ev) |
|
void | stream_index_free (StreamIndex *index) |
|
struct image * | stream_read_chunk (Stream *st, StreamFlags srf) |
|
int | stream_write_chunk (Stream *st, const struct image *image, StreamFlags srf) |
|
Stream functions (for indexing results)
◆ Stream
An opaque structure representing a stream being read or written
◆ StreamFlags
A bitfield of things that can be read from or written to a stream. Use this together with stream_{read,write}_chunk to read/write the stream faster if you don't need all the information.
General information about crystals (including unit cell parameters) is always read and written.
Enumerator |
---|
STREAM_REFLECTIONS | Read the integrated reflections
|
STREAM_PEAKS | Read the peak search results
|
STREAM_DATA_DETGEOM | Reconstruct the detgeom structure, and create (blank) data/mask arrays. (NB this is (currently) a slow operation)
|
◆ stream_close()
void stream_close |
( |
Stream * | st | ) |
|
|
extern |
- Parameters
-
Closes the stream
◆ stream_open_fd_for_write()
- Parameters
-
fd | File descriptor (e.g. from open()) to use for stream data. |
Creates a new Stream from fd
, so that stream data can be written to fd
using stream_write_chunk.
In contrast to stream_open_for_write, this function does not write any of the usual headers. This function is mostly for use when multiple substreams need to be multiplexed into a single master stream. The master would be opened using stream_open_for_write, and the substreams using this function.
- Returns
- A Stream, or NULL on failure.
◆ stream_open_for_write()
- Parameters
-
Creates a new stream with name filename
. If filename
already exists, it will be overwritten.
The CrystFEL version number will be written, but you should call stream_write_geometry_file, stream_write_target_cell, stream_write_commandline_args and stream_write_Indexing_methods to write extended audit information.
- Returns
- A Stream, or NULL on failure.
◆ stream_read_chunk()
Read the next chunk from a stream and return an image structure
◆ stream_rewind()
int stream_rewind |
( |
Stream * | st | ) |
|
|
extern |
- Parameters
-
Attempts to set the file pointer for st
to the start of the stream, so that later calls to stream_read_chunk will repeat the sequence of chunks from the start.
Programs must not assume that this operation always succeeds!
- Returns
- Non-zero if the stream could not be rewound.
◆ stream_write_chunk()
- Parameters
-
Writes a new chunk to st
.
- Returns
- non-zero on error.
◆ stream_write_commandline_args()
void stream_write_commandline_args |
( |
Stream * | st, |
|
|
int | argc, |
|
|
char * | argv[] ) |
|
extern |
- Parameters
-
st | A Stream |
argc | number of arguments |
argv | command-line arguments |
Writes the command line to st
. argc
and argv
should be exactly as were given to main(). This should usually be called immediately after stream_open_for_write.
◆ stream_write_data_template()
- Parameters
-
st | A Stream |
geom_filename | geomtry file name |
Writes the content of the geometry file to st
. This (or stream_write_geometry_file) should usually be called immediately after write_command.
◆ stream_write_geometry_file()
void stream_write_geometry_file |
( |
Stream * | st, |
|
|
const char * | geom_filename ) |
|
extern |
- Parameters
-
st | A Stream |
geom_filename | geomtry file name |
Writes the content of the geometry file to st
. This (or stream_write_data_template) should usually be called immediately after write_command.