#include <math.h>
#include "library.h"
Go to the source code of this file.
Data Structures | |
| struct | umtz_bat_ |
| struct | umtz_hdr_ |
| struct | umtz_list_ |
| struct | umtzfile_ |
Defines | |
| #define | MTZRECLEN 80 |
| #define | MTZBATCHR (3*MTZRECLEN) |
| #define | MTZBATINT 29 |
| #define | MTZBATFLT 156 |
| #define | MTZBATLEN ( MTZBATCHR + 4*(MTZBATINT+MTZBATFLT) ) |
| #define | MTZDATAOFF 20 |
Typedefs | |
| typedef struct umtz_hdr_ | umtz_hdr |
| typedef struct umtz_bat_ | umtz_bat |
| typedef struct umtz_list_ | umtz_list |
| typedef struct umtzfile_ | umtzfile |
Functions | |
| umtzfile* | umtz_open (const char *filename, const char *mode) |
| void | umtz_close (umtzfile *file) |
| int | umtz_num_cols (const umtzfile *file) |
| int | umtz_num_rows (const umtzfile *file) |
| int | umtz_num_head (const umtzfile *file) |
| int | umtz_num_hist (const umtzfile *file) |
| float | umtz_mnf (const umtzfile *file) |
| int | umtz_ismnf (const umtzfile *file, float f) |
| umtz_hdr* | umtz_first_head (const umtzfile *file) |
| umtz_hdr* | umtz_first_hist (const umtzfile *file) |
| umtz_bat* | umtz_first_bats (const umtzfile *file) |
| umtz_hdr* | umtz_last_head (const umtzfile *file) |
| umtz_hdr* | umtz_last_hist (const umtzfile *file) |
| umtz_bat* | umtz_last_bats (const umtzfile *file) |
| int | umtz_keymatch (const char *hdr, const char *key) |
| void | umtz_add_head (umtzfile *file, const char *hdr) |
| void | umtz_add_hist (umtzfile *file, const char *hdr) |
| void | umtz_add_bats (umtzfile *file, const char *cdata, const int *idata, const float *fdata) |
| void | umtz_seek_row (const umtzfile *file, const int n) |
| void | umtz_get_row (const umtzfile *file, float *fdata) |
| void | umtz_add_row (umtzfile *file, const float *fdata) |
| void | umtz_get_cell (const umtzfile *file, const int ixtl, float *cell) |
| void | umtz_cell_metric (const float *cell, float *metric) |
| int | umtz_num_head_type (const umtzfile *file, char *head) |
| void | umtz_make_rec (umtz_list *l, const int rec_len) |
| void | umtz_copy_pad (char *d, const char *s, const int rec_len) |
| void | umtz_rewrite_headers_ranges (umtzfile *file) |
| void | umtz_rewrite_headers_legacy (umtzfile *file) |
This is a low-level library for accessing the MTZ file format. It is not generally called by applications, but rather provides a basis for higher level libraries such as mmtzlib.
|
|
chars in MTZ batch record. |
|
|
floats in MTZ batch record. |
|
|
ints in MTZ batch record. |
|
|
Length of MTZ batch record. |
|
|
Offset to start of binary data |
|
|
Length of an MTZ header record. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Add a batch record.
The
|
|
|
Add a header to the list of header records.
This is only possible before any reflections have been written to the file, since a header may change the number of solumns in the file. Only the headers 'COLUMN' and 'VALM' are actually understood by this function, incrementing the number of columns and seting the missing number flag respectively. Terminal headers (
|
|
|
Add a history entry.
The
|
|
|
Add a row to the file. The data contains raw floats, missing values should already be set to umtz_mnf().
|
|
|
Get the reciprocal space matric tensor for a given cell. This is used to calculate 1/resol^2 from the Miller indices using: s = h*h*metric[0] + k*k*metric[1] + l*l*metric[2] + h*k*metric[3] + h*l*metric[4] + k*l*metric[5];
|
|
|
Close an MTZ file and write the headers. An MTZ file which is opened for writing but not closed will be corrupted.
|
|
|
For internal use only. |
|
|
Return a pointer to the first batch record.
|
|
|
Return a pointer to the first header.
To access the n'th header, use
|
|
|
Return a pointer to the first history entry.
To access the n'th history entry, use
|
|
|
Get the cell for dataset i, or if no datasets are present, the base cell. If i is zero, the base cell is returned.
|
|
|
Get a row from the file. The result contains raw floats, missing number flags are not processed at this stage.
|
|
|
Test whether f is a missing number flag, according to the file.
|
|
|
Test if the string hdr starts with the keyword key.
|
|
|
Return a pointer to the space after the last batch record. See umtz_last_head().
|
|
|
Return a pointer to the space after the last header. To loop over headers use umtz_hdr* ptr; for ( ptr = umtz_first_head(file); ptr != umtz_last_head(file); ptr++ )
|
|
|
Return a pointer to the space after the last history entry. See umtz_last_head().
|
|
|
For internal use only. |
|
|
Return the value of the missing number flag for this file.
If
|
|
|
Return the number of data columns in the file.
|
|
|
Return the number of headers in the file.
|
|
|
Count the number of headers beginning with a particular keyword.
|
|
|
Return the number of history entries in the file.
|
|
|
Return the number of reflections in the file.
|
|
|
Open an mtz file for reading or writing.
|
|
|
For internal use only. |
|
|
For internal use only. |
|
|
Skip to the (n-1)'th reflection in the file. The first record is zero.
|
1.2.8.1 written by Dimitri van Heesch,
© 1997-2001