Python: module pycbf

pycbf (version still_being_written, 14 Dec 2005) | index d:\wright\cbflib\cbflib_0.7.7\pycbf\pycbf.py

`pycbf - python bindings to the CBFlib library
A library for reading and writing ImageCIF and CBF files
which store area detector images for crystallography.
This work is a derivative of the CBFlib version 0.7.7 library
by Paul J. Ellis of Stanford Synchrotron Radiation Laboratory
and Herbert J. Bernstein of Bernstein + Sons
See:
http://www.bernstein-plus-sons.com/software/CBF/
Licensing is GPL based, see:
http://www.bernstein-plus-sons.com/software/CBF/doc/CBFlib_NOTICES.html
These bindings were automatically generated by SWIG, and the
input to SWIG was automatically generated by a python script.
We very strongly recommend you do not attempt to edit them
by hand!
Copyright (C) 2007 Jonathan Wright
ESRF, Grenoble, France
email: wright@esrf.fr`

Modules
`` |  |
_pycbf | new |  |

Classes
`` |  | __builtin__.object cbf_detector_struct cbf_handle_struct cbf_positioner_struct
class cbf_detector_struct(__builtin__.object)
`` | `Proxy of C cbf_detector_struct struct`
| Methods defined here: __del__ lambda self __getattr__ lambda self, name __init__(self, *args) `__init__(self) -> cbf_detector_struct` __repr__ = _swig_repr(self) __setattr__ lambda self, name, value get_beam_center(*args) `Returns : double index1,double index2,double center1,double center2 *args : C prototype: int cbf_get_beam_center (cbf_detector detector, double *index1, double *index2, double *center1, double *center2); CBFLib documentation: DESCRIPTION cbf_get_beam_center sets *center1 and *center2 to the displacements in mm along the detector axes from pixel (0, 0) to the point at which the beam intersects the detector and *index1 and *index2 to the corresponding indices. cbf_set_beam_center sets the offsets in the axis category for the detector element axis with precedence 1 to place the beam center at the position given in mm by *center1 and *center2 as the displacements in mm along the detector axes from pixel (0, 0) to the point at which the beam intersects the detector at the indices given *index1 and *index2. Any of the destination pointers may be NULL for getting the beam center. For setting the beam axis, either the indices of the center must not be NULL. The indices are non-negative for beam centers within the detector surface, but the center for an axis with a negative increment will be negative for a beam center within the detector surface. ARGUMENTS detector Detector handle. index1 Pointer to the destination slow index. index2 Pointer to the destination fast index. center1 Pointer to the destination displacement along the slow axis. center2 Pointer to the destination displacement along the fast axis. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` get_detector_distance(*args) `Returns : double distance *args : C prototype: int cbf_get_detector_distance (cbf_detector detector, double *distance); CBFLib documentation: DESCRIPTION cbf_get_detector_distance sets *distance to the nearest distance from the sample position to the detector plane. ARGUMENTS detector Detector handle. distance Pointer to the destination distance. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` get_detector_normal(*args) `Returns : double normal1,double normal2,double normal3 *args : C prototype: int cbf_get_detector_normal (cbf_detector detector, double *normal1, double *normal2, double *normal3); CBFLib documentation: DESCRIPTION cbf_get_detector_normal sets *normal1, *normal2, and *normal3 to the 3 components of the of the normal vector to the detector plane. The vector is normalized. Any of the destination pointers may be NULL. ARGUMENTS detector Detector handle. normal1 Pointer to the destination x component of the normal vector. normal2 Pointer to the destination y component of the normal vector. normal3 Pointer to the destination z component of the normal vector. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` get_inferred_pixel_size(*args) `Returns : Float pixel size *args : Int axis_number C prototype: int cbf_get_inferred_pixel_size (cbf_detector detector, unsigned int axis_number, double *psize); CBFLib documentation: DESCRIPTION cbf_get_inferred_pixel_size sets *psize to point to the double value in millimeters of the pixel size for the axis axis_number value for pixel at (index1, index2) on the detector surface. The slow index is treated as axis 1 and the fast index is treated as axis 2. ARGUMENTS detector Detector handle. axis_number The number of the axis. area Pointer to the destination pizel size in mm. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` get_pixel_area(*args) `Returns : double area,double projected_area *args : double index1,double index2 C prototype: int cbf_get_pixel_area (cbf_detector detector, double index1, double index2, double *area, double *projected_area); CBFLib documentation: DESCRIPTION cbf_get_pixel_area sets *area to the area of the pixel at (index1, index2) on the detector surface and *projected_area to the apparent area of the pixel as viewed from the sample position. Either of the destination pointers may be NULL. ARGUMENTS detector Detector handle. index1 Slow index. index2 Fast index. area Pointer to the destination area in mm2. projected_area Pointer to the destination apparent area in mm2. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` get_pixel_coordinates(*args) `Returns : double coordinate1,double coordinate2,double coordinate3 *args : double index1,double index2 C prototype: int cbf_get_pixel_coordinates (cbf_detector detector, double index1, double index2, double *coordinate1, double *coordinate2, double *coordinate3); CBFLib documentation: DESCRIPTION cbf_get_pixel_coordinates sets *coordinate1, *coordinate2, and *coordinate3 to the vector position of pixel (index1, index2) on the detector surface. If index1 and index2 are integers then the coordinates correspond to the center of a pixel. Any of the destination pointers may be NULL. ARGUMENTS detector Detector handle. index1 Slow index. index2 Fast index. coordinate1 Pointer to the destination x component. coordinate2 Pointer to the destination y component. coordinate3 Pointer to the destination z component. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` get_pixel_normal(*args) `Returns : double normal1,double normal2,double normal3 *args : double index1,double index2 C prototype: int cbf_get_pixel_normal (cbf_detector detector, double index1, double index2, double *normal1, double *normal2, double *normal3); CBFLib documentation: DESCRIPTION cbf_get_detector_normal sets *normal1, *normal2, and *normal3 to the 3 components of the of the normal vector to the pixel at (index1, index2). The vector is normalized. Any of the destination pointers may be NULL. ARGUMENTS detector Detector handle. index1 Slow index. index2 Fast index. normal1 Pointer to the destination x component of the normal vector. normal2 Pointer to the destination y component of the normal vector. normal3 Pointer to the destination z component of the normal vector. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` Properties defined here: axes get = cbf_detector_struct_axes_get(...) set = cbf_detector_struct_axes_set(...) displacement get = cbf_detector_struct_displacement_get(...) set = cbf_detector_struct_displacement_set(...) increment get = cbf_detector_struct_increment_get(...) set = cbf_detector_struct_increment_set(...) index get = cbf_detector_struct_index_get(...) set = cbf_detector_struct_index_set(...) positioner get = cbf_detector_struct_positioner_get(...) set = cbf_detector_struct_positioner_set(...) Data and other attributes defined here: __dict__ = <dictproxy object> `dictionary for instance variables (if defined)` __swig_destroy__ = <built-in function delete_cbf_detector_struct> __swig_getmethods__ = {'axes': <built-in function cbf_detector_struct_axes_get>, 'displacement': <built-in function cbf_detector_struct_displacement_get>, 'increment': <built-in function cbf_detector_struct_increment_get>, 'index': <built-in function cbf_detector_struct_index_get>, 'positioner': <built-in function cbf_detector_struct_positioner_get>} __swig_setmethods__ = {'axes': <built-in function cbf_detector_struct_axes_set>, 'displacement': <built-in function cbf_detector_struct_displacement_set>, 'increment': <built-in function cbf_detector_struct_increment_set>, 'index': <built-in function cbf_detector_struct_index_set>, 'positioner': <built-in function cbf_detector_struct_positioner_set>} __weakref__ = <attribute '__weakref__' of 'cbf_detector_struct' objects> `list of weak references to the object (if defined)`
class cbf_handle_struct(__builtin__.object)
`` | `Proxy of C cbf_handle_struct struct`
| Methods defined here: __del__ lambda self __getattr__ lambda self, name __init__(self, *args) `__init__(self) -> cbf_handle_struct` __repr__ = _swig_repr(self) __setattr__ lambda self, name, value category_name(*args) `Returns : *args : string C prototype: int cbf_category_name (cbf_handle handle, const char **categoryname); CBFLib documentation: DESCRIPTION cbf_category_name sets *categoryname to point to the name of the current category of the current data block. The category name will be valid as long as the category exists. The name must not be modified by the program in any way. ARGUMENTS handle CBF handle. categoryname Pointer to the destination category name pointer. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` column_name(*args) `Returns : *args : string C prototype: int cbf_column_name (cbf_handle handle, const char **columnname); CBFLib documentation: DESCRIPTION cbf_column_name sets *columnname to point to the name of the current column of the current category. The column name will be valid as long as the column exists. The name must not be modified by the program in any way. ARGUMENTS handle CBF handle. columnname Pointer to the destination column name pointer. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` construct_detector(*args) `Returns : pycbf detector object *args : Integer element_number C prototype: int cbf_construct_detector (cbf_handle handle, cbf_detector *detector, unsigned int element_number); CBFLib documentation: DESCRIPTION cbf_construct_detector constructs a detector object for detector element number element_number using the description in the CBF object handle and initialises the detector handle *detector. ARGUMENTS handle CBF handle. detector Pointer to the destination detector handle. element_number The number of the detector element counting from 0 by order of appearance in the "diffrn_data_frame" category. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` construct_goniometer(*args) `Returns : pycbf goniometer object *args : C prototype: int cbf_construct_goniometer (cbf_handle handle, cbf_goniometer *goniometer); CBFLib documentation: DESCRIPTION cbf_construct_goniometer constructs a goniometer object using the description in the CBF object handle and initialises the goniometer handle *goniometer. ARGUMENTS handle CBF handle. goniometer Pointer to the destination goniometer handle. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` count_categories(*args) `Returns : unsigned *args : C prototype: int cbf_count_categories (cbf_handle handle, unsigned int *categories); CBFLib documentation: DESCRIPTION cbf_count_categories puts the number of categories in the current data block in *categories. ARGUMENTS handle CBF handle. categories Pointer to the destination category count. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` count_columns(*args) `Returns : Integer *args : C prototype: int cbf_count_columns (cbf_handle handle, unsigned int *columns); CBFLib documentation: DESCRIPTION cbf_count_columns puts the number of columns in the current category in *columns. ARGUMENTS handle CBF handle. columns Pointer to the destination column count. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` count_datablocks(*args) `Returns : unsigned *args : C prototype: int cbf_count_datablocks (cbf_handle handle, unsigned int *datablocks); CBFLib documentation: DESCRIPTION cbf_count_datablocks puts the number of data blocks in *datablocks . ARGUMENTS handle CBF handle. datablocks Pointer to the destination data block count. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` count_elements(*args) `Returns : Integer *args : C prototype: int cbf_count_elements (cbf_handle handle, unsigned int *elements); CBFLib documentation: DESCRIPTION cbf_count_elements sets *elements to the number of detector elements. ARGUMENTS handle CBF handle. elements Pointer to the destination count. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` count_rows(*args) `Returns : Integer *args : C prototype: int cbf_count_rows (cbf_handle handle, unsigned int *rows); CBFLib documentation: DESCRIPTION cbf_count_rows puts the number of rows in the current category in *rows . ARGUMENTS handle CBF handle. rows Pointer to the destination row count. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` datablock_name(*args) `Returns : *args : string C prototype: int cbf_datablock_name (cbf_handle handle, const char **datablockname); CBFLib documentation: DESCRIPTION cbf_datablock_name sets *datablockname to point to the name of the current data block. The data block name will be valid as long as the data block exists and has not been renamed. The name must not be modified by the program in any way. ARGUMENTS handle CBF handle. datablockname Pointer to the destination data block name pointer. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` delete_row(*args) `Returns : *args : Integer C prototype: int cbf_delete_row (cbf_handle handle, unsigned int rownumber); CBFLib documentation: DESCRIPTION cbf_delete_row deletes a row from the current category. Rows starting from rownumber +1 are moved down by 1. If the current row was higher than rownumber, or if the current row is the last row, it will also move down by 1. The row numbers start from 0. ARGUMENTS handle CBF handle. rownumber The number of the row to delete. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` find_category(*args) `Returns : string *args : C prototype: int cbf_find_category (cbf_handle handle, const char *categoryname); CBFLib documentation: DESCRIPTION cbf_find_category makes the category in the current data block with name categoryname the current category. The comparison is case-insensitive. If the category does not exist, the function returns CBF_NOTFOUND. The current column and row become undefined. ARGUMENTS handle CBF handle. categoryname The name of the category to find. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` find_category_root(*args) `Returns : String categoryroot *args : String categoryname C prototype: int cbf_find_category_root (cbf_handle handle, const char* categoryname, const char** categoryroot); CBFLib documentation: DESCRIPTION cbf_find_category_root sets *categoryroot to the root category of which categoryname is an alias. cbf_set_category_root sets categoryname_in as an alias of categoryroot in the dictionary associated with handle, creating the dictionary if necessary. cbf_require_category_root sets *categoryroot to the root category of which categoryname is an alias, if there is one, or to the value of categoryname, if categoryname is not an alias. A returned categoryroot string must not be modified in any way. ARGUMENTS handle CBF handle. categoryname category name which may be an alias. categoryroot pointer to a returned category root name. categoryroot_in input category root name. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` find_column(*args) `Returns : string *args : C prototype: int cbf_find_column (cbf_handle handle, const char *columnname); CBFLib documentation: DESCRIPTION cbf_find_column makes the columns in the current category with name columnname the current column. The comparison is case-insensitive. If the column does not exist, the function returns CBF_NOTFOUND. The current row is not affected. ARGUMENTS handle CBF handle. columnname The name of column to find. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` find_datablock(*args) `Returns : string *args : C prototype: int cbf_find_datablock (cbf_handle handle, const char *datablockname); CBFLib documentation: DESCRIPTION cbf_find_datablock makes the data block with name datablockname the current data block. The comparison is case-insensitive. If the data block does not exist, the function returns CBF_NOTFOUND. The current category becomes undefined. ARGUMENTS handle CBF handle. datablockname The name of the data block to find. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` find_nextrow(*args) `Returns : string *args : C prototype: int cbf_find_nextrow (cbf_handle handle, const char *value); CBFLib documentation: DESCRIPTION cbf_find_nextrow makes the makes the next row in the current column with value value the current row. The search starts from the row following the last row found with cbf_find_row or cbf_find_nextrow, or from the current row if the current row was defined using any other function. The comparison is case-sensitive. If no more matching rows exist, the function returns CBF_NOTFOUND. The current column is not affected. ARGUMENTS handle CBF handle. value the value to search for. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` find_row(*args) `Returns : string *args : C prototype: int cbf_find_row (cbf_handle handle, const char *value); CBFLib documentation: DESCRIPTION cbf_find_row makes the first row in the current column with value value the current row. The comparison is case-sensitive. If a matching row does not exist, the function returns CBF_NOTFOUND. The current column is not affected. ARGUMENTS handle CBF handle. value The value of the row to find. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` find_tag_category(*args) `Returns : String categoryname_in *args : String tagname C prototype: int cbf_find_tag_category (cbf_handle handle, const char* tagname, const char** categoryname); CBFLib documentation: DESCRIPTION cbf_find_tag_category sets categoryname to the category associated with tagname in the dictionary associated with handle. cbf_set_tag_category upddates the dictionary associated with handle to indicated that tagname is in category categoryname_in. ARGUMENTS handle CBF handle. tagname tag name. categoryname pointer to a returned category name. categoryname_in input category name. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` find_tag_root(*args) `Returns : String tagroot *args : String tagname C prototype: int cbf_find_tag_root (cbf_handle handle, const char* tagname, const char** tagroot); CBFLib documentation: DESCRIPTION cbf_find_tag_root sets *tagroot to the root tag of which tagname is an alias. cbf_set_tag_root sets tagname as an alias of tagroot_in in the dictionary associated with handle, creating the dictionary if necessary. cbf_require_tag_root sets *tagroot to the root tag of which tagname is an alias, if there is one, or to the value of tagname, if tagname is not an alias. A returned tagroot string must not be modified in any way. ARGUMENTS handle CBF handle. tagname tag name which may be an alias. tagroot pointer to a returned tag root name. tagroot_in input tag root name. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` force_new_category(*args) `Returns : string *args : C prototype: int cbf_force_new_category (cbf_handle handle, const char *categoryname); CBFLib documentation: DESCRIPTION cbf_force_new_category creates a new category in the current data block with name categoryname and makes it the current category. Duplicate category names are allowed. Even if a category with this name already exists, a new category of the same name is created and becomes the current category. The allows for the creation of unlooped tag/value lists drawn from the same category. ARGUMENTS handle CBF handle. categoryname The name of the new category. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` force_new_datablock(*args) `Returns : string *args : C prototype: int cbf_force_new_datablock (cbf_handle handle, const char *datablockname); CBFLib documentation: DESCRIPTION cbf_force_new_datablock creates a new data block with name datablockname and makes it the current data block. Duplicate data block names are allowed. cbf_force_new_saveframe creates a new savew frame with name saveframename and makes it the current save frame. Duplicate save frame names are allowed. Even if a save frame with this name already exists, a new save frame is created and becomes the current save frame. ARGUMENTS handle CBF handle. datablockname The name of the new data block. saveframename The name of the new save frame. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` force_new_saveframe(*args) `Returns : string *args : C prototype: int cbf_force_new_saveframe (cbf_handle handle, const char *saveframename); CBFLib documentation: DESCRIPTION cbf_force_new_datablock creates a new data block with name datablockname and makes it the current data block. Duplicate data block names are allowed. cbf_force_new_saveframe creates a new savew frame with name saveframename and makes it the current save frame. Duplicate save frame names are allowed. Even if a save frame with this name already exists, a new save frame is created and becomes the current save frame. ARGUMENTS handle CBF handle. datablockname The name of the new data block. saveframename The name of the new save frame. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` get_3d_image(*args) `get_3d_image(self, void ?)` get_3d_image_size(*args) `get_3d_image_size(self, void ?)` get_axis_setting(*args) `Returns : Float start,Float increment *args : String axis_id C prototype: int cbf_get_axis_setting (cbf_handle handle, unsigned int reserved, const char *axis_id, double *start, double *increment); CBFLib documentation: DESCRIPTION cbf_get_axis_setting sets *start and *increment to the corresponding values of the axis axis_id. Either of the destination pointers may be NULL. The parameter reserved is presently unused and should be set to 0. ARGUMENTS handle CBF handle. reserved Unused. Any value other than 0 is invalid. axis_id Axis id. start Pointer to the destination start value. increment Pointer to the destination increment value. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` get_bin_sizes(*args) `get_bin_sizes(self, void ?)` get_crystal_id(*args) `Returns : *args : string C prototype: int cbf_get_crystal_id (cbf_handle handle, const char **crystal_id); CBFLib documentation: DESCRIPTION cbf_get_crystal_id sets *crystal_id to point to the ASCII value of the "diffrn.crystal_id" entry. If the value is not ASCII, the function returns CBF_BINARY. The value will be valid as long as the item exists and has not been set to a new value. The value must not be modified by the program in any way. ARGUMENTS handle CBF handle. crystal_id Pointer to the destination value pointer. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` get_datestamp(*args) `Returns : int year,int month,int day,int hour,int minute,double second, int timezone *args : C prototype: int cbf_get_datestamp (cbf_handle handle, unsigned int reserved, int *year, int *month, int *day, int *hour, int *minute, double *second, int *timezone); CBFLib documentation: DESCRIPTION cbf_get_datestamp sets *year, *month, *day, *hour, *minute and *second to the corresponding values of the collection timestamp. *timezone is set to timezone difference from UTC in minutes. The parameter < i>reserved is presently unused and should be set to 0. Any of the destination pointers may be NULL. ARGUMENTS handle CBF handle. reserved Unused. Any value other than 0 is invalid. year Pointer to the destination timestamp year. month Pointer to the destination timestamp month (1-12). day Pointer to the destination timestamp day (1-31). hour Pointer to the destination timestamp hour (0-23). minute Pointer to the destination timestamp minute (0-59). second Pointer to the destination timestamp second (0-60.0). timezone Pointer to the destination timezone difference from UTC in minutes. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` get_dictionary(*args) `Returns : CBFHandle dictionary *args : C prototype: int cbf_get_dictionary (cbf_handle handle, cbf_handle * dictionary); CBFLib documentation: DESCRIPTION cbf_get_dictionary sets *dictionary to the handle of a CBF which has been associated with the CBF handle by cbf_set_dictionary. cbf_set_dictionary associates the CBF handle dictionary_in with handle as its dictionary. cbf_require_dictionary sets *dictionary to the handle of a CBF which has been associated with the CBF handle by cbf_set_dictionary or creates a new empty CBF and associates it with handle, returning the new handle in *dictionary. ARGUMENTS handle CBF handle. dictionary Pointer to CBF handle of dictionary. dictionary_in CBF handle of dcitionary. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` get_diffrn_id(*args) `Returns : *args : string C prototype: int cbf_get_diffrn_id (cbf_handle handle, const char **diffrn_id); CBFLib documentation: DESCRIPTION cbf_get_diffrn_id sets *diffrn_id to point to the ASCII value of the "diffrn.id" entry. cbf_require_diffrn_id also sets *diffrn_id to point to the ASCII value of the "diffrn.id" entry, but, if the "diffrn.id" entry does not exist, it sets the value in the CBF and in*diffrn_id to the character string given by default_id, creating the category and column is necessary. The diffrn_id will be valid as long as the item exists and has not been set to a new value. The diffrn_id must not be modified by the program in any way. ARGUMENTS handle CBF handle. diffrn_id Pointer to the destination value pointer. default_id Character string default value. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` get_divergence(*args) `Returns : Float div_x_source,Float div_y_source,Float div_x_y_source *args : C prototype: int cbf_get_divergence (cbf_handle handle, double *div_x_source, double *div_y_source, double *div_x_y_source); CBFLib documentation: DESCRIPTION cbf_get_divergence sets *div_x_source, *div_y_source and *div_x_y_source to the corresponding source divergence parameters. Any of the destination pointers may be NULL. ARGUMENTS handle CBF handle. div_x_source Pointer to the destination div_x_source. div_y_source Pointer to the destination div_y_source. div_x_y_source Pointer to the destination div_x_y_source. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` get_doublevalue(*args) `Returns : double *args : C prototype: int cbf_get_doublevalue (cbf_handle handle, double *number); CBFLib documentation: DESCRIPTION cbf_get_doublevalue sets *number to the value of the ASCII item at the current column and row interpreted as a decimal floating-point number. cbf_require_doublevalue sets *number to the value of the ASCII item at the current column and row interpreted as a decimal floating-point number, setting it to defaultvalue if necessary. If the value is not ASCII, the function returns CBF_BINARY. ARGUMENTS handle CBF handle. number Pointer to the destination number. defaultvalue default number value. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` get_element_id(*args) `Returns : String *args : Integer element_number C prototype: int cbf_get_element_id (cbf_handle handle, unsigned int element_number, const char **element_id); CBFLib documentation: DESCRIPTION cbf_get_element_id sets *element_id to point to the ASCII value of the element_number th "diffrn_data_frame.detector_element_id" entry, counting from 0. If the detector element does not exist, the function returns CBF_NOTFOUND. The element_id will be valid as long as the item exists and has not been set to a new value. The element_id must not be modified by the program in any way. ARGUMENTS handle CBF handle. element_number The number of the detector element counting from 0 by order of appearance in the "diffrn_data_frame" category. element_id Pointer to the destination. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` get_gain(*args) `Returns : Float gain,Float gain_esd *args : C prototype: int cbf_get_gain (cbf_handle handle, unsigned int element_number, double *gain, double *gain_esd); CBFLib documentation: DESCRIPTION cbf_get_gain sets *gain and *gain_esd to the corresponding gain parameters for element number element_number. Either of the destination pointers may be NULL. ARGUMENTS handle CBF handle. element_number The number of the detector element counting from 0 by order of appearance in the "diffrn_data_frame" category. gain Pointer to the destination gain. gain_esd Pointer to the destination gain_esd. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` get_image(*args) `get_image(self, void ?)` get_image_size(*args) `Returns : size_t ndim1,size_t ndim2 *args : Integer element_number C prototype: int cbf_get_image_size (cbf_handle handle, unsigned int reserved, unsigned int element_number, size_t *ndim1, size_t *ndim2); CBFLib documentation: DESCRIPTION cbf_get_image_size sets *ndim1 and *ndim2 to the slow and fast dimensions of the image array for element number element_number. If the array is 1-dimensional, *ndim1 will be set to the array size and *ndim2 will be set to 1. If the array is 3-dimensional an error code will be returned. cbf_get_3d_image_size sets *ndim1, *ndim2 and *ndim3 to the slowest, next fastest and fastest dimensions, respectively, of the 3D image array for element number element_number. If the array is 1-dimensional, *ndim1 will be set to the array size and *ndim2 and` get_integerarray_as_string(*args) `Returns : (Binary)String *args : C prototype: int cbf_get_integerarray (cbf_handle handle, int *binary_id, void *array, size_t elsize, int elsigned, size_t elements, size_t *elements_read); CBFLib documentation: DESCRIPTION cbf_get_integerarray reads the binary value of the item at the current column and row into an integer array. The array consists of elements elements of elsize bytes each, starting at array. The elements are signed if elsigned is non-0 and unsigned otherwise. *binary_id is set to the binary section identifier and *elements_read to the number of elements actually read. cbf_get_realarray reads the binary value of the item at the current column and row into a real array. The array consists of elements elements of elsize bytes each, starting at array. *binary_id is set to the binary section identifier and *elements_read to the number of elements actually read. If any element in the integer binary data cant fit into the destination element, the destination is set the nearest possible value. If the value is not binary, the function returns CBF_ASCII. If the requested number of elements cant be read, the function will read as many as it can and then return CBF_ENDOFDATA. Currently, the destination array must consist of chars, shorts or ints (signed or unsigned). If elsize is not equal to sizeof (char), sizeof (short) or sizeof (int), for cbf_get_integerarray, or sizeof(double) or sizeof(float), for cbf_get_realarray the function returns CBF_ARGUMENT. An additional restriction in the current version of CBFlib is that values too large to fit in an int are not correctly decompressed. As an example, if the machine with 32-bit ints is reading an array containing a value outside the range 0 .. 2^32-1 (unsigned) or -2^31 .. 2^31-1 (signed), the array will not be correctly decompressed. This restriction will be removed in a future release. For cbf_get_realarray, only IEEE format is supported. No conversion to other floating point formats is done at this time. ARGUMENTS handle CBF handle. binary_id Pointer to the destination integer binary identifier. array Pointer to the destination array. elsize Size in bytes of each destination array element. elsigned Set to non-0 if the destination array elements are signed. elements The number of elements to read. elements_read Pointer to the destination number of elements actually read. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` get_integerarrayparameters(*args) `Returns : int compression,int binary_id,int elsize,int elsigned,int elunsigned, int elements,int minelement,int maxelement *args : C prototype: int cbf_get_integerarrayparameters (cbf_handle handle, unsigned int *compression, int *binary_id, size_t *elsize, int *elsigned, int *elunsigned, size_t *elements, int *minelement, int *maxelement); CBFLib documentation: DESCRIPTION cbf_get_integerarrayparameters sets *compression, *binary_id, *elsize, *elsigned, *elunsigned, *elements, *minelement and *maxelement to values read from the binary value of the item at the current column and row. This provides all the arguments needed for a subsequent call to cbf_set_integerarray, if a copy of the array is to be made into another CIF or CBF. cbf_get_realarrayparameters sets *compression, *binary_id, *elsize, *elements to values read from the binary value of the item at the current column and row. This provides all the arguments needed for a subsequent call to cbf_set_realarray, if a copy of the arry is to be made into another CIF or CBF. The variants cbf_get_integerarrayparameters_wdims and cbf_get_realarrayparameters_wdims set **byteorder, *dim1, *dim2, *dim3, and *padding as well, providing the additional parameters needed for a subsequent call to cbf_set_integerarray_wdims or cbf_set_realarray_wdims. The value returned in *byteorder is a pointer either to the string "little_endian" or to the string "big_endian". This should be the byte order of the data, not necessarily of the host machine. No attempt should be made to modify this string. At this time only "little_endian" will be returned. The values returned in *dim1, *dim2 and *dim3 are the sizes of the fastest changing, second fastest changing and third fastest changing dimensions of the array, if specified, or zero, if not specified. The value returned in *padding is the size of the post-data padding, if any and if specified in the data header. The value is given as a count of octets. If the value is not binary, the function returns CBF_ASCII. ARGUMENTS handle CBF handle. compression Compression method used. elsize Size in bytes of each array element. binary_id Pointer to the destination integer binary identifier. elsigned Pointer to an integer. Set to 1 if the elements can be read as signed integers. elunsigned Pointer to an integer. Set to 1 if the elements can be read as unsigned integers. elements Pointer to the destination number of elements. minelement Pointer to the destination smallest element. maxelement Pointer to the destination largest element. byteorder Pointer to the destination byte order. dim1 Pointer to the destination fastest dimension. dim2 Pointer to the destination second fastest dimension. dim3 Pointer to the destination third fastest dimension. padding Pointer to the destination padding size. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` get_integerarrayparameters_wdims(*args) `get_integerarrayparameters_wdims(self, void ?)` get_integervalue(*args) `Returns : int *args : C prototype: int cbf_get_integervalue (cbf_handle handle, int *number); CBFLib documentation: DESCRIPTION cbf_get_integervalue sets *number to the value of the ASCII item at the current column and row interpreted as a decimal integer. cbf_require_integervalue sets *number to the value of the ASCII item at the current column and row interpreted as a decimal integer, setting it to defaultvalue if necessary. If the value is not ASCII, the function returns CBF_BINARY. ARGUMENTS handle CBF handle. number pointer to the number. defaultvalue default number value. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` get_integration_time(*args) `Returns : Float time *args : C prototype: int cbf_get_integration_time (cbf_handle handle, unsigned int reserved, double *time); CBFLib documentation: DESCRIPTION cbf_get_integration_time sets *time to the integration time in seconds. The parameter reserved is presently unused and should be set to 0. ARGUMENTS handle CBF handle. reserved Unused. Any value other than 0 is invalid. time Pointer to the destination time. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` get_orientation_matrix(*args) `Returns : Float matrix_0,Float matrix_1,Float matrix_2,Float matrix_3, Float matrix_4,Float matrix_5,Float matrix_6,Float matrix_7, Float matrix_8 *args : C prototype: int cbf_get_orientation_matrix (cbf_handle handle, double ub_matrix[9]); CBFLib documentation: DESCRIPTION cbf_get_orientation_matrix sets ub_matrix to point to the array of orientation matrix entries in the "diffrn" category in the order of columns: "UB[1][1]" "UB[1][2]" "UB[1][3]" "UB[2][1]" "UB[2][2]" "UB[2][3]" "UB[3][1]" "UB[3][2]" "UB[3][3]" cbf_set_orientation_matrix sets the values in the "diffrn" category to the values pointed to by ub_matrix. ARGUMENTS handle CBF handle. ubmatric Source or destination array of 9 doubles giving the orientation matrix parameters. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` get_overload(*args) `Returns : Float overload *args : Integer element_number C prototype: int cbf_get_overload (cbf_handle handle, unsigned int element_number, double *overload); CBFLib documentation: DESCRIPTION cbf_get_overload sets *overload to the overload value for element number element_number. ARGUMENTS handle CBF handle. element_number The number of the detector element counting from 0 by order of appearance in the "diffrn_data_frame" category. overload Pointer to the destination overload. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` get_pixel_size(*args) `Returns : Float pixel_size *args : Int element_number,Int axis_number C prototype: int cbf_get_pixel_size (cbf_handle handle, unsigned int element_number, unsigned int axis_number, double *psize); CBFLib documentation: DESCRIPTION cbf_get_pixel_size sets *psize to point to the double value in millimeters of the axis axis_number of the detector element element_number. The axis_number is numbered from 1, starting with the fastest axis. If the pixel size is not given explcitly in the "array_element_size" category, the function returns CBF_NOTFOUND. ARGUMENTS handle CBF handle. element_number The number of the detector element counting from 0 by order of appearance in the "diffrn_data_frame" category. axis_number The number of the axis, fastest first, starting from 1.` get_polarization(*args) `Returns : float polarizn_source_ratio,float polarizn_source_norm *args : C prototype: int cbf_get_polarization (cbf_handle handle, double *polarizn_source_ratio, double *polarizn_source_norm); CBFLib documentation: DESCRIPTION cbf_get_polarization sets *polarizn_source_ratio and *polarizn_source_norm to the corresponding source polarization parameters. Either destination pointer may be NULL. ARGUMENTS handle CBF handle. polarizn_source_ratio Pointer to the destination polarizn_source_ratio. polarizn_source_norm Pointer to the destination polarizn_source_norm. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` get_real_3d_image(*args) `get_real_3d_image(self, void ?)` get_real_image(*args) `get_real_image(self, void ?)` get_realarray(*args) `get_realarray(self, void ?)` get_realarrayparameters(*args) `Returns : int compression,int binary_id,int elsize,int elements *args : C prototype: int cbf_get_realarrayparameters (cbf_handle handle, unsigned int *compression, int *binary_id, size_t *elsize, size_t *elements); CBFLib documentation: DESCRIPTION cbf_get_integerarrayparameters sets *compression, *binary_id, *elsize, *elsigned, *elunsigned, *elements, *minelement and *maxelement to values read from the binary value of the item at the current column and row. This provides all the arguments needed for a subsequent call to cbf_set_integerarray, if a copy of the array is to be made into another CIF or CBF. cbf_get_realarrayparameters sets *compression, *binary_id, *elsize, *elements to values read from the binary value of the item at the current column and row. This provides all the arguments needed for a subsequent call to cbf_set_realarray, if a copy of the arry is to be made into another CIF or CBF. The variants cbf_get_integerarrayparameters_wdims and cbf_get_realarrayparameters_wdims set **byteorder, *dim1, *dim2, *dim3, and *padding as well, providing the additional parameters needed for a subsequent call to cbf_set_integerarray_wdims or cbf_set_realarray_wdims. The value returned in *byteorder is a pointer either to the string "little_endian" or to the string "big_endian". This should be the byte order of the data, not necessarily of the host machine. No attempt should be made to modify this string. At this time only "little_endian" will be returned. The values returned in *dim1, *dim2 and *dim3 are the sizes of the fastest changing, second fastest changing and third fastest changing dimensions of the array, if specified, or zero, if not specified. The value returned in *padding is the size of the post-data padding, if any and if specified in the data header. The value is given as a count of octets. If the value is not binary, the function returns CBF_ASCII. ARGUMENTS handle CBF handle. compression Compression method used. elsize Size in bytes of each array element. binary_id Pointer to the destination integer binary identifier. elsigned Pointer to an integer. Set to 1 if the elements can be read as signed integers. elunsigned Pointer to an integer. Set to 1 if the elements can be read as unsigned integers. elements Pointer to the destination number of elements. minelement Pointer to the destination smallest element. maxelement Pointer to the destination largest element. byteorder Pointer to the destination byte order. dim1 Pointer to the destination fastest dimension. dim2 Pointer to the destination second fastest dimension. dim3 Pointer to the destination third fastest dimension. padding Pointer to the destination padding size. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` get_realarrayparameters_wdims(*args) `get_realarrayparameters_wdims(self, void ?)` get_reciprocal_cell(*args) `get_reciprocal_cell(self, void ?)` get_timestamp(*args) `Returns : Float time,Integer timezone *args : C prototype: int cbf_get_timestamp (cbf_handle handle, unsigned int reserved, double *time, int *timezone); CBFLib documentation: DESCRIPTION cbf_get_timestamp sets *time to the collection timestamp in seconds since January 1 1970. *timezone is set to timezone difference from UTC in minutes. The parameter reserved is presently unused and should be set to 0. Either of the destination pointers may be NULL. ARGUMENTS handle CBF handle. reserved Unused. Any value other than 0 is invalid. time Pointer to the destination collection timestamp. timezone Pointer to the destination timezone difference. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` get_typeofvalue(*args) `Returns : *args : string C prototype: int cbf_get_typeofvalue (cbf_handle handle, const char **typeofvalue); CBFLib documentation: DESCRIPTION cbf_get_value sets *typeofvalue to point an ASCII descriptor of the value of the item at the current column and row. The strings that may be returned are "null" for a null value indicated by a "." or a "?", "bnry" for a binary value, "word" for an unquoted string, "dblq" for a double-quoted string, "sglq" for a single-quoted string, and "text" for a semicolon-quoted text field. A field for which no value has been set sets *typeofvalue to NULL rather than to the string "null". The typeofvalue must not be modified by the program in any way. ARGUMENTS handle CBF handle. typeofvalue Pointer to the destination type-of-value string pointer. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` get_unit_cell(*args) `get_unit_cell(self, void ?)` get_value(*args) `Returns : *args : string C prototype: int cbf_get_value (cbf_handle handle, const char **value); CBFLib documentation: DESCRIPTION cbf_get_value sets *value to point to the ASCII value of the item at the current column and row. cbf_set_value sets *value to point to the ASCII value of the item at the current column and row, creating the data item if necessary and initializing it to a copy of defaultvalue. If the value is not ASCII, the function returns CBF_BINARY. The value will be valid as long as the item exists and has not been set to a new value. The value must not be modified by the program in any way. ARGUMENTS handle CBF handle. value Pointer to the destination value pointer. value Default value character string. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` get_wavelength(*args) `Returns : double *args : C prototype: int cbf_get_wavelength (cbf_handle handle, double *wavelength); CBFLib documentation: DESCRIPTION cbf_get_wavelength sets *wavelength to the current wavelength in Angstrom. ARGUMENTS handle CBF handle. wavelength Pointer to the destination. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` insert_row(*args) `Returns : *args : Integer C prototype: int cbf_insert_row (cbf_handle handle, unsigned int rownumber); CBFLib documentation: DESCRIPTION cbf_insert_row adds a new row to the current category. The new row is inserted as row rownumber and existing rows starting from rownumber are moved up by 1. The new row becomes the current row. If the category has fewer than rownumber rows, the function returns CBF_NOTFOUND. The row numbers start from 0. ARGUMENTS handle CBF handle. rownumber The row number of the new row. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` new_category(*args) `Returns : string *args : C prototype: int cbf_new_category (cbf_handle handle, const char *categoryname); CBFLib documentation: DESCRIPTION cbf_new_category creates a new category in the current data block with name categoryname and makes it the current category. If a category with this name already exists, the existing category becomes the current category. ARGUMENTS handle CBF handle. categoryname The name of the new category. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` new_column(*args) `Returns : string *args : C prototype: int cbf_new_column (cbf_handle handle, const char *columnname); CBFLib documentation: DESCRIPTION cbf_new_column creates a new column in the current category with name columnname and makes it the current column. If a column with this name already exists, the existing column becomes the current category. ARGUMENTS handle CBF handle. columnname The name of the new column. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` new_datablock(*args) `Returns : string *args : C prototype: int cbf_new_datablock (cbf_handle handle, const char *datablockname); CBFLib documentation: DESCRIPTION cbf_new_datablock creates a new data block with name datablockname and makes it the current data block. cbf_new_saveframe creates a new save frame with name saveframename within the current data block and makes the new save frame the current save frame. If a data block or save frame with this name already exists, the existing data block or save frame becomes the current data block or save frame. ARGUMENTS handle CBF handle. datablockname The name of the new data block. saveframename The name of the new save frame. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` new_row(*args) `Returns : *args : C prototype: int cbf_new_row (cbf_handle handle); CBFLib documentation: DESCRIPTION cbf_new_row adds a new row to the current category and makes it the current row. ARGUMENTS handle CBF handle. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` new_saveframe(*args) `Returns : string *args : C prototype: int cbf_new_saveframe (cbf_handle handle, const char *saveframename); CBFLib documentation: DESCRIPTION cbf_new_datablock creates a new data block with name datablockname and makes it the current data block. cbf_new_saveframe creates a new save frame with name saveframename within the current data block and makes the new save frame the current save frame. If a data block or save frame with this name already exists, the existing data block or save frame becomes the current data block or save frame. ARGUMENTS handle CBF handle. datablockname The name of the new data block. saveframename The name of the new save frame. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` next_category(*args) `Returns : *args : C prototype: int cbf_next_category (cbf_handle handle); CBFLib documentation: DESCRIPTION cbf_next_category makes the category following the current category in the current data block the current category. If there are no more categories, the function returns CBF_NOTFOUND. The current column and row become undefined. ARGUMENTS handle CBF handle. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` next_column(*args) `Returns : *args : C prototype: int cbf_next_column (cbf_handle handle); CBFLib documentation: DESCRIPTION cbf_next_column makes the column following the current column in the current category the current column. If there are no more columns, the function returns CBF_NOTFOUND. The current row is not affected. ARGUMENTS handle CBF handle. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` next_datablock(*args) `Returns : *args : C prototype: int cbf_next_datablock (cbf_handle handle); CBFLib documentation: DESCRIPTION cbf_next_datablock makes the data block following the current data block the current data block. If there are no more data blocks, the function returns CBF_NOTFOUND. The current category becomes undefined. ARGUMENTS handle CBF handle. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` next_row(*args) `Returns : *args : C prototype: int cbf_next_row (cbf_handle handle); CBFLib documentation: DESCRIPTION cbf_next_row makes the row following the current row in the current category the current row. If there are no more rows, the function returns CBF_NOTFOUND. The current column is not affected. ARGUMENTS handle CBF handle. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` read_file(*args) `Returns : *args : String filename,Integer headers C prototype: int cbf_read_file (cbf_handle handle, FILE *file, int headers); CBFLib documentation: DESCRIPTION cbf_read_file reads the CBF or CIF file file into the CBF object specified by handle, using the CIF 1.0 convention of 80 character lines. cbf_read_widefile reads the CBF or CIF file file into the CBF object specified by handle, using the CIF 1.1 convention of 2048 character lines. A warning is issued to stderr for ascii lines over the limit. No test is performed on binary sections. Validation is performed in three ways levels: during the lexical scan, during the parse, and, if a dictionary was converted, against the value types, value enumerations, categories and parent-child relationships specified in the dictionary. headers controls the interprestation of binary section headers of imgCIF files. MSG_DIGEST: Instructs CBFlib to check that the digest of the binary section matches any header value. If the digests do not match, the call will return CBF_FORMAT. This evaluation and comparison is delayed (a "lazy" evaluation) to ensure maximal processing efficiency. If an immediately evaluation is required, see MSG_DIGESTNOW, below. MSG_DIGESTNOW: Instructs CBFlib to check that the digest of the binary section matches any header value. If the digests do not match, the call will return CBF_FORMAT. This evaluation and comparison is performed during initial parsing of the section to ensure timely error reporting at the expense of processing efficiency. If a more efficient delayed ("lazy") evaluation is required, see MSG_DIGESTNOW, below. MSG_NODIGEST: Do not check the digest (default). CBFlib defers reading binary sections as long as possible. In the current version of CBFlib, this means that: 1. The file must be a random-access file opened in binary mode (fopen` read_template(*args) `Returns : *args : String filename C prototype: int cbf_read_template (cbf_handle handle, FILE *file); CBFLib documentation: DESCRIPTION cbf_read_template reads the CBF or CIF file file into the CBF object specified by handle and selects the first datablock as the current datablock. ARGUMENTS handle Pointer to a CBF handle. file Pointer to a file descriptor. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` read_widefile(*args) `read_widefile(self, void ?)` remove_category(*args) `Returns : *args : C prototype: int cbf_remove_category (cbf_handle handle); CBFLib documentation: DESCRIPTION cbf_remove_category deletes the current category. The current category becomes undefined. ARGUMENTS handle CBF handle. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` remove_column(*args) `Returns : *args : C prototype: int cbf_remove_column (cbf_handle handle); CBFLib documentation: DESCRIPTION cbf_remove_column deletes the current column. The current column becomes undefined. ARGUMENTS handle CBF handle. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` remove_datablock(*args) `Returns : *args : C prototype: int cbf_remove_datablock (cbf_handle handle); CBFLib documentation: DESCRIPTION cbf_remove_datablock deletes the current data block. cbf_remove_saveframe deletes the current save frame. The current data block becomes undefined. ARGUMENTS handle CBF handle. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` remove_row(*args) `Returns : *args : C prototype: int cbf_remove_row (cbf_handle handle); CBFLib documentation: DESCRIPTION cbf_remove_row deletes the current row in the current category. If the current row was the last row, it will move down by 1, otherwise, it will remain the same. ARGUMENTS handle CBF handle. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` remove_saveframe(*args) `Returns : *args : C prototype: int cbf_remove_saveframe (cbf_handle handle); CBFLib documentation: DESCRIPTION cbf_remove_datablock deletes the current data block. cbf_remove_saveframe deletes the current save frame. The current data block becomes undefined. ARGUMENTS handle CBF handle. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` require_category(*args) `Returns : string *args : C prototype: int cbf_require_category (cbf_handle handle, const char *categoryname); CBFLib documentation: DESCRIPTION cbf_rewuire_category makes the category in the current data block with name categoryname the current category, if it exists, or creates the catagory if it does not exist. The comparison is case-insensitive. The current column and row become undefined. ARGUMENTS handle CBF handle. categoryname The name of the category to find. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` require_category_root(*args) `require_category_root(self, char categoryname) -> char` require_column(*args) `Returns : string *args : C prototype: int cbf_require_column (cbf_handle handle, const char *columnname); CBFLib documentation: DESCRIPTION cbf_require_column makes the columns in the current category with name columnname the current column, if it exists, or creates it if it does not. The comparison is case-insensitive. The current row is not affected. ARGUMENTS handle CBF handle. columnname The name of column to find. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` require_column_doublevalue(*args) `Returns : Float defaultvalue *args : String columnname,Float Value C prototype: int cbf_require_column_doublevalue (cbf_handle handle, const char *columnname, double *number, const double defaultvalue); CBFLib documentation: DESCRIPTION cbf_require_column_doublevalue sets *number to the value of the ASCII item at the current row for the column given with the name given by *columnname, with the value interpreted as a decimal floating-point number, or to the number given by defaultvalue if the item cannot be found. ARGUMENTS handle CBF handle. columnname Name of the column containing the number. number pointer to the location to receive the floating-point value. defaultvalue Value to use if the requested column and value cannot be found. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` require_column_integervalue(*args) `Returns : Int Value *args : String Columnvalue,Int default C prototype: int cbf_require_column_integervalue (cbf_handle handle, const char *columnname, int *number, const int defaultvalue); CBFLib documentation: DESCRIPTION cbf_require_column_doublevalue sets *number to the value of the ASCII item at the current row for the column given with the name given by *columnname, with the value interpreted as an integer number, or to the number given by defaultvalue if the item cannot be found. ARGUMENTS handle CBF handle. columnname Name of the column containing the number. number pointer to the location to receive the integer value. defaultvalue Value to use if the requested column and value cannot be found. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` require_column_value(*args) `Returns : String Name *args : String columnnanme,String Default C prototype: int cbf_require_column_value (cbf_handle handle, const char *columnname, const char **value, const char *defaultvalue); CBFLib documentation: DESCRIPTION cbf_require_column_doublevalue sets *value to the ASCII item at the current row for the column given with the name given by *columnname, or to the string given by defaultvalue if the item cannot be found. ARGUMENTS handle CBF handle. columnname Name of the column containing the number. value pointer to the location to receive the value. defaultvalue Value to use if the requested column and value cannot be found. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` require_datablock(*args) `Returns : string *args : C prototype: int cbf_require_datablock (cbf_handle handle, const char *datablockname); CBFLib documentation: DESCRIPTION cbf_require_datablock makes the data block with name datablockname the current data block, if it exists, or creates it if it does not. The comparison is case-insensitive. The current category becomes undefined. ARGUMENTS handle CBF handle. datablockname The name of the data block to find or create. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` require_doublevalue(*args) `Returns : Float Number *args : Float Default C prototype: int cbf_require_doublevalue (cbf_handle handle, double *number, double defaultvalue); CBFLib documentation: DESCRIPTION cbf_get_doublevalue sets *number to the value of the ASCII item at the current column and row interpreted as a decimal floating-point number. cbf_require_doublevalue sets *number to the value of the ASCII item at the current column and row interpreted as a decimal floating-point number, setting it to defaultvalue if necessary. If the value is not ASCII, the function returns CBF_BINARY. ARGUMENTS handle CBF handle. number Pointer to the destination number. defaultvalue default number value. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` require_integervalue(*args) `Returns : Int number *args : Int thedefault C prototype: int cbf_require_integervalue (cbf_handle handle, int *number, int defaultvalue); CBFLib documentation: DESCRIPTION cbf_get_integervalue sets *number to the value of the ASCII item at the current column and row interpreted as a decimal integer. cbf_require_integervalue sets *number to the value of the ASCII item at the current column and row interpreted as a decimal integer, setting it to defaultvalue if necessary. If the value is not ASCII, the function returns CBF_BINARY. ARGUMENTS handle CBF handle. number pointer to the number. defaultvalue default number value. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` require_tag_root(*args) `Returns : String tagroot *args : String tagname C prototype: int cbf_require_tag_root (cbf_handle handle, const char* tagname, const char** tagroot); CBFLib documentation: DESCRIPTION cbf_find_tag_root sets *tagroot to the root tag of which tagname is an alias. cbf_set_tag_root sets tagname as an alias of tagroot_in in the dictionary associated with handle, creating the dictionary if necessary. cbf_require_tag_root sets *tagroot to the root tag of which tagname is an alias, if there is one, or to the value of tagname, if tagname is not an alias. A returned tagroot string must not be modified in any way. ARGUMENTS handle CBF handle. tagname tag name which may be an alias. tagroot pointer to a returned tag root name. tagroot_in input tag root name. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` require_value(*args) `Returns : String Value *args : String defaultvalue C prototype: int cbf_require_value (cbf_handle handle, const char **value, const char *defaultvalue ); CBFLib documentation: DESCRIPTION cbf_get_value sets *value to point to the ASCII value of the item at the current column and row. cbf_set_value sets *value to point to the ASCII value of the item at the current column and row, creating the data item if necessary and initializing it to a copy of defaultvalue. If the value is not ASCII, the function returns CBF_BINARY. The value will be valid as long as the item exists and has not been set to a new value. The value must not be modified by the program in any way. ARGUMENTS handle CBF handle. value Pointer to the destination value pointer. value Default value character string. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` reset_category(*args) `Returns : *args : C prototype: int cbf_reset_category (cbf_handle handle); CBFLib documentation: DESCRIPTION cbf_reset_category deletes all columns and rows from current category. ARGUMENTS handle CBF handle. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` reset_datablock(*args) `Returns : *args : C prototype: int cbf_reset_datablock (cbf_handle handle); CBFLib documentation: DESCRIPTION cbf_reset_datablock deletes all categories from the current data block. cbf_reset_saveframe deletes all categories from the current save frame. ARGUMENTS handle CBF handle. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` reset_datablocks(*args) `Returns : *args : C prototype: int cbf_reset_datablocks (cbf_handle handle); CBFLib documentation: DESCRIPTION cbf_reset_datablocks deletes all categories from all data blocks. The current data block does not change. ARGUMENTS handle CBF handle. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` reset_saveframe(*args) `Returns : *args : C prototype: int cbf_reset_saveframe (cbf_handle handle); CBFLib documentation: DESCRIPTION cbf_reset_datablock deletes all categories from the current data block. cbf_reset_saveframe deletes all categories from the current save frame. ARGUMENTS handle CBF handle. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` rewind_blockitem(*args) `Returns : CBF_NODETYPE *args : C prototype: int cbf_rewind_blockitem (cbf_handle handle, CBF_NODETYPE * type); CBFLib documentation: DESCRIPTION cbf_rewind_category makes the first category in the current data block the current category. cbf_rewind_saveframe makes the first saveframe in the current data block the current saveframe. cbf_rewind_blockitem makes the first blockitem (category or saveframe) in the current data block the current blockitem. If there are no categories, saveframes or blockitems the function returns CBF_NOTFOUND. The current column and row become undefined. ARGUMENTS handle CBF handle. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` rewind_category(*args) `Returns : *args : C prototype: int cbf_rewind_category (cbf_handle handle); CBFLib documentation: DESCRIPTION cbf_rewind_category makes the first category in the current data block the current category. cbf_rewind_saveframe makes the first saveframe in the current data block the current saveframe. cbf_rewind_blockitem makes the first blockitem (category or saveframe) in the current data block the current blockitem. If there are no categories, saveframes or blockitems the function returns CBF_NOTFOUND. The current column and row become undefined. ARGUMENTS handle CBF handle. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` rewind_column(*args) `Returns : *args : C prototype: int cbf_rewind_column (cbf_handle handle); CBFLib documentation: DESCRIPTION cbf_rewind_column makes the first column in the current category the current column. If there are no columns, the function returns CBF_NOTFOUND. The current row is not affected. ARGUMENTS handle CBF handle. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` rewind_datablock(*args) `Returns : *args : C prototype: int cbf_rewind_datablock (cbf_handle handle); CBFLib documentation: DESCRIPTION cbf_rewind_datablock makes the first data block the current data block. If there are no data blocks, the function returns CBF_NOTFOUND. The current category becomes undefined. ARGUMENTS handle CBF handle. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` rewind_row(*args) `Returns : *args : C prototype: int cbf_rewind_row (cbf_handle handle); CBFLib documentation: DESCRIPTION cbf_rewind_row makes the first row in the current category the current row. If there are no rows, the function returns CBF_NOTFOUND. The current column is not affected. ARGUMENTS handle CBF handle. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` rewind_saveframe(*args) `Returns : *args : C prototype: int cbf_rewind_saveframe (cbf_handle handle); CBFLib documentation: DESCRIPTION cbf_rewind_category makes the first category in the current data block the current category. cbf_rewind_saveframe makes the first saveframe in the current data block the current saveframe. cbf_rewind_blockitem makes the first blockitem (category or saveframe) in the current data block the current blockitem. If there are no categories, saveframes or blockitems the function returns CBF_NOTFOUND. The current column and row become undefined. ARGUMENTS handle CBF handle. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` row_number(*args) `Returns : Integer *args : C prototype: int cbf_row_number (cbf_handle handle, unsigned int *row); CBFLib documentation: DESCRIPTION cbf_row_number sets *row to the number of the current row of the current category. ARGUMENTS handle CBF handle. row Pointer to the destination row number. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` select_category(*args) `Returns : *args : Integer C prototype: int cbf_select_category (cbf_handle handle, unsigned int category); CBFLib documentation: DESCRIPTION cbf_select_category selects category number category in the current data block as the current category. The first category is number 0. The current column and row become undefined. If the category does not exist, the function returns CBF_NOTFOUND. ARGUMENTS handle CBF handle. category Number of the category to select. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` select_column(*args) `Returns : *args : Integer C prototype: int cbf_select_column (cbf_handle handle, unsigned int column); CBFLib documentation: DESCRIPTION cbf_select_column selects column number column in the current category as the current column. The first column is number 0. The current row is not affected If the column does not exist, the function returns CBF_NOTFOUND. ARGUMENTS handle CBF handle. column Number of the column to select. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` select_datablock(*args) `Returns : *args : Integer C prototype: int cbf_select_datablock (cbf_handle handle, unsigned int datablock); CBFLib documentation: DESCRIPTION cbf_select_datablock selects data block number datablock as the current data block. The first data block is number 0. If the data block does not exist, the function returns CBF_NOTFOUND. ARGUMENTS handle CBF handle. datablock Number of the data block to select. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` select_row(*args) `Returns : *args : Integer C prototype: int cbf_select_row (cbf_handle handle, unsigned int row); CBFLib documentation: DESCRIPTION cbf_select_row selects row number row in the current category as the current row. The first row is number 0. The current column is not affected If the row does not exist, the function returns CBF_NOTFOUND. ARGUMENTS handle CBF handle. row Number of the row to select. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` set_3d_image(*args) `set_3d_image(self, void ?)` set_axis_setting(*args) `Returns : *args : String axis_id,Float start,Float increment C prototype: int cbf_set_axis_setting (cbf_handle handle, unsigned int reserved, const char *axis_id, double start, double increment); CBFLib documentation: DESCRIPTION cbf_set_axis_setting sets the starting and increment values of the axis axis_id to start and increment. The parameter reserved is presently unused and should be set to 0. ARGUMENTS handle CBF handle. reserved Unused. Any value other than 0 is invalid. axis_id Axis id. start Start value. increment Increment value. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` set_bin_sizes(*args) `set_bin_sizes(self, void ?)` set_category_root(*args) `Returns : *args : String categoryname,String categoryroot C prototype: int cbf_set_category_root (cbf_handle handle, const char* categoryname_in, const char*categoryroot); CBFLib documentation: DESCRIPTION cbf_find_category_root sets *categoryroot to the root category of which categoryname is an alias. cbf_set_category_root sets categoryname_in as an alias of categoryroot in the dictionary associated with handle, creating the dictionary if necessary. cbf_require_category_root sets *categoryroot to the root category of which categoryname is an alias, if there is one, or to the value of categoryname, if categoryname is not an alias. A returned categoryroot string must not be modified in any way. ARGUMENTS handle CBF handle. categoryname category name which may be an alias. categoryroot pointer to a returned category root name. categoryroot_in input category root name. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` set_crystal_id(*args) `Returns : string *args : C prototype: int cbf_set_crystal_id (cbf_handle handle, const char *crystal_id); CBFLib documentation: DESCRIPTION cbf_set_crystal_id sets the "diffrn.crystal_id" entry to the ASCII value crystal_id. ARGUMENTS handle CBF handle. crystal_id ASCII value. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` set_datablockname(*args) `Returns : string *args : C prototype: int cbf_set_datablockname (cbf_handle handle, const char *datablockname); CBFLib documentation: DESCRIPTION cbf_set_datablockname changes the name of the current data block to datablockname. cbf_set_saveframename changes the name of the current save frame to saveframename. If a data block or save frame with this name already exists (comparison is case-insensitive), the function returns CBF_IDENTICAL. ARGUMENTS handle CBF handle. datablockname The new data block name. datablockname The new save frame name. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` set_datestamp(*args) `Returns : *args : int year,int month,int day,int hour,int minute,double second, int timezone,Float precision C prototype: int cbf_set_datestamp (cbf_handle handle, unsigned int reserved, int year, int month, int day, int hour, int minute, double second, int timezone, double precision); CBFLib documentation: DESCRIPTION cbf_set_datestamp sets the collection timestamp in seconds since January 1 1970 to the value specified by time. The timezone difference from UTC in minutes is set to timezone. If no timezone is desired, timezone should be CBF_NOTIM EZONE. The parameter reserved is presently unused and should be set to 0. The precision of the new timestamp is specified by the value precision in seconds. If precision is 0, the saved timestamp is assumed accurate to 1 second. ARGUMENTS handle CBF handle. reserved Unused. Any value other than 0 is invalid. time Timestamp in seconds since January 1 1970. timezone Timezone difference from UTC in minutes or CBF_NOTIMEZONE. precision Timestamp precision in seconds. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` set_dictionary(*args) `Returns : *args : CBFHandle dictionary C prototype: int cbf_set_dictionary (cbf_handle handle, cbf_handle dictionary_in); CBFLib documentation: DESCRIPTION cbf_get_dictionary sets *dictionary to the handle of a CBF which has been associated with the CBF handle by cbf_set_dictionary. cbf_set_dictionary associates the CBF handle dictionary_in with handle as its dictionary. cbf_require_dictionary sets *dictionary to the handle of a CBF which has been associated with the CBF handle by cbf_set_dictionary or creates a new empty CBF and associates it with handle, returning the new handle in *dictionary. ARGUMENTS handle CBF handle. dictionary Pointer to CBF handle of dictionary. dictionary_in CBF handle of dcitionary. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` set_diffrn_id(*args) `Returns : string *args : C prototype: int cbf_set_diffrn_id (cbf_handle handle, const char *diffrn_id); CBFLib documentation: DESCRIPTION cbf_set_diffrn_id sets the "diffrn.id" entry of the current datablock to the ASCII value diffrn_id. This function also changes corresponding "diffrn_id" entries in the "diffrn_source", "diffrn_radiation", "diffrn_detector" and "diffrn_measurement" categories. ARGUMENTS handle CBF handle. diffrn_id ASCII value. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` set_divergence(*args) `Returns : *args : Float div_x_source,Float div_y_source,Float div_x_y_source C prototype: int cbf_set_divergence (cbf_handle handle, double div_x_source, double div_y_source, double div_x_y_source); CBFLib documentation: DESCRIPTION cbf_set_divergence sets the source divergence parameters to the values specified by div_x_source, div_y_source and div_x_y_source. ARGUMENTS handle CBF handle. div_x_source New value of div_x_source. div_y_source New value of div_y_source. div_x_y_source New value of div_x_y_source. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` set_doublevalue(*args) `Returns : *args : String format,Float number C prototype: int cbf_set_doublevalue (cbf_handle handle, const char *format, double number); CBFLib documentation: DESCRIPTION cbf_set_doublevalue sets the item at the current column and row to the floating-point value number written as an ASCII string with the format specified by format as appropriate for the printf function. ARGUMENTS handle CBF handle. format Format for the number. number Floating-point value. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` set_gain(*args) `Returns : *args : Float gain,Float gain_esd C prototype: int cbf_set_gain (cbf_handle handle, unsigned int element_number, double gain, double gain_esd); CBFLib documentation: DESCRIPTION cbf_set_gain sets the gain of element number element_number to the values specified by gain and gain_esd. ARGUMENTS handle CBF handle. element_number The number of the detector element counting from 0 by order of appearance in the "diffrn_data_frame" category. gain New gain value. gain_esd New gain_esd value. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` set_image(*args) `set_image(self, void ?)` set_integerarray(*args) `Returns : *args : int compression,int binary_id,(binary) String data,int elsize, int elsigned,int elements C prototype: int cbf_set_integerarray (cbf_handle handle, unsigned int compression, int binary_id, void *array, size_t elsize, int elsigned, size_t elements); CBFLib documentation: DESCRIPTION cbf_set_integerarray sets the binary value of the item at the current column and row to an integer array. The array consists of elements elements of elsize bytes each, starting at array. The elements are signed if elsigned is non-0 and unsigned otherwise. binary_id is the binary section identifier. cbf_set_realarray sets the binary value of the item at the current column and row to an integer array. The array consists of elements elements of elsize bytes each, starting at array. binary_id is the binary section identifier. The cbf_set_integerarray_wdims and cbf_set_realarray_wdims allow the data header values of byteorder, dim1, dim2, dim3 and padding to be set to the data byte order, the fastest, second fastest and third fastest array dimensions and the size in byte of the post data padding to be used. The array will be compressed using the compression scheme specifed by compression. Currently, the available schemes are: CBF_CANONICAL Canonical-code compression (section 3.3.1) CBF_PACKED CCP4-style packing (section 3.3.2) CBF_PACKED_V2 CCP4-style packing, version 2 (section 3.3.2) CBF_BYTE_OFFSET Simple "byte_offset" compression. CBF_NONE No compression. NOTE: This scheme is by far the slowest of the four and uses much more disk space. It is intended for routine use with small arrays only. With large arrays (like images) it should be used only for debugging. The values compressed are limited to 64 bits. If any element in the array is larger than 64 bits, the value compressed is the nearest 64-bit value.` set_integerarray_wdims(*args) `set_integerarray_wdims(self, void ?)` set_integervalue(*args) `Returns : int number *args : C prototype: int cbf_set_integervalue (cbf_handle handle, int number); CBFLib documentation: DESCRIPTION cbf_set_integervalue sets the item at the current column and row to the integer value number written as a decimal ASCII string. ARGUMENTS handle CBF handle. number Integer value. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` set_integration_time(*args) `Returns : *args : Float time C prototype: int cbf_set_integration_time (cbf_handle handle, unsigned int reserved, double time); CBFLib documentation: DESCRIPTION cbf_set_integration_time sets the integration time in seconds to the value specified by time. The parameter reserved is presently unused and should be set to 0. ARGUMENTS handle CBF handle. reserved Unused. Any value other than 0 is invalid. time Integration time in seconds. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` set_orientation_matrix(*args) `Returns : *args : Float matrix_0,Float matrix_1,Float matrix_2,Float matrix_3, Float matrix_4,Float matrix_5,Float matrix_6,Float matrix_7, Float matrix_8 C prototype: int cbf_set_orientation_matrix (cbf_handle handle, double ub_matrix[9]); CBFLib documentation: DESCRIPTION cbf_get_orientation_matrix sets ub_matrix to point to the array of orientation matrix entries in the "diffrn" category in the order of columns: "UB[1][1]" "UB[1][2]" "UB[1][3]" "UB[2][1]" "UB[2][2]" "UB[2][3]" "UB[3][1]" "UB[3][2]" "UB[3][3]" cbf_set_orientation_matrix sets the values in the "diffrn" category to the values pointed to by ub_matrix. ARGUMENTS handle CBF handle. ubmatric Source or destination array of 9 doubles giving the orientation matrix parameters. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` set_overload(*args) `Returns : *args : Integer element_number,Float overload C prototype: int cbf_set_overload (cbf_handle handle, unsigned int element_number, double overload); CBFLib documentation: DESCRIPTION cbf_set_overload sets the overload value of element number element_number to overload. ARGUMENTS handle CBF handle. element_number The number of the detector element counting from 0 by order of appearance in the "diffrn_data_frame" category. overload New overload value. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` set_pixel_size(*args) `Returns : *args : Int element_number,Int axis_number,Float pixel size C prototype: int cbf_set_pixel_size (cbf_handle handle, unsigned int element_number, unsigned int axis_number, double psize); CBFLib documentation: DESCRIPTION cbf_set_pixel_size sets the item in the &quote;size&quote; column of the "array_structure_list" category at the row which matches axis axis_number of the detector element element_number converting the double pixel size psize from meters to millimeters in storing it in the "size" column for the axis axis_number of the detector element element_number. The axis_number is numbered from 1, starting with the fastest axis. If the "array_structure_list" category does not already exist, it is created. If the appropriate row in the "array_structure_list" catgeory does not already exist, it is created. If the pixel size is not given explcitly in the "array_element_size category", the function returns CBF_NOTFOUND. ARGUMENTS handle CBF handle. element_number The number of the detector element counting from 0 by order of appearance in the "diffrn_data_frame" category. axis_number The number of the axis, fastest first, starting from 1.` set_polarization(*args) `Returns : *args : Float polarizn_source_ratio,Float polarizn_source_norm C prototype: int cbf_set_polarization (cbf_handle handle, double polarizn_source_ratio, double polarizn_source_norm); CBFLib documentation: DESCRIPTION cbf_set_polarization sets the source polarization to the values specified by polarizn_source_ratio and polarizn_source_norm. ARGUMENTS handle CBF handle. polarizn_source_ratio New value of polarizn_source_ratio. polarizn_source_norm New value of polarizn_source_norm. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` set_real_3d_image(*args) `set_real_3d_image(self, void ?)` set_real_image(*args) `set_real_image(self, void ?)` set_realarray(*args) `set_realarray(self, void ?)` set_realarray_wdims(*args) `set_realarray_wdims(self, void ?)` set_reciprocal_cell(*args) `set_reciprocal_cell(self, void ?)` set_tag_category(*args) `Returns : *args : String tagname,String categoryname_in C prototype: int cbf_set_tag_category (cbf_handle handle, const char* tagname, const char* categoryname_in); CBFLib documentation: DESCRIPTION cbf_find_tag_category sets categoryname to the category associated with tagname in the dictionary associated with handle. cbf_set_tag_category upddates the dictionary associated with handle to indicated that tagname is in category categoryname_in. ARGUMENTS handle CBF handle. tagname tag name. categoryname pointer to a returned category name. categoryname_in input category name. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` set_tag_root(*args) `Returns : *args : String tagname,String tagroot_in C prototype: int cbf_set_tag_root (cbf_handle handle, const char* tagname, const char*tagroot_in); CBFLib documentation: DESCRIPTION cbf_find_tag_root sets *tagroot to the root tag of which tagname is an alias. cbf_set_tag_root sets tagname as an alias of tagroot_in in the dictionary associated with handle, creating the dictionary if necessary. cbf_require_tag_root sets *tagroot to the root tag of which tagname is an alias, if there is one, or to the value of tagname, if tagname is not an alias. A returned tagroot string must not be modified in any way. ARGUMENTS handle CBF handle. tagname tag name which may be an alias. tagroot pointer to a returned tag root name. tagroot_in input tag root name. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` set_timestamp(*args) `Returns : *args : Float time,Integer timezone,Float precision C prototype: int cbf_set_timestamp (cbf_handle handle, unsigned int reserved, double time, int timezone, double precision); CBFLib documentation: DESCRIPTION cbf_set_timestamp sets the collection timestamp in seconds since January 1 1970 to the value specified by time. The timezone difference from UTC in minutes is set to timezone. If no timezone is desired, timezone should be CBF_NOTIM EZONE. The parameter reserved is presently unused and should be set to 0. The precision of the new timestamp is specified by the value precision in seconds. If precision is 0, the saved timestamp is assumed accurate to 1 second. ARGUMENTS handle CBF handle. reserved Unused. Any value other than 0 is invalid. time Timestamp in seconds since January 1 1970. timezone Timezone difference from UTC in minutes or CBF_NOTIMEZONE. precision Timestamp precision in seconds. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` set_typeofvalue(*args) `Returns : string *args : C prototype: int cbf_set_typeofvalue (cbf_handle handle, const char *typeofvalue); CBFLib documentation: DESCRIPTION cbf_set_typeofvalue sets the type of the item at the current column and row to the type specified by the ASCII character string given by typeofvalue. The strings that may be used are "null" for a null value indicated by a "." or a "?", "word" for an unquoted string, "dblq" for a double-quoted string, "sglq" for a single-quoted string, and "text" for a semicolon-quoted text field. Not all types may be used for all values. No changes may be made to the type of binary values. You may not set the type of a string that contains a single quote followed by a blank or a tab or which contains multiple lines to "sglq". You may not set the type of a string that contains a double quote followed by a blank or a tab or which contains multiple lines to "dblq". ARGUMENTS handle CBF handle. typeofvalue ASCII string for desired type of value. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` set_unit_cell(*args) `set_unit_cell(self, void ?)` set_value(*args) `Returns : string *args : C prototype: int cbf_set_value (cbf_handle handle, const char *value); CBFLib documentation: DESCRIPTION cbf_set_value sets the item at the current column and row to the ASCII value value. ARGUMENTS handle CBF handle. value ASCII value. defaultvalue default ASCII value. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` set_wavelength(*args) `Returns : double wavelength *args : C prototype: int cbf_set_wavelength (cbf_handle handle, double wavelength); CBFLib documentation: DESCRIPTION cbf_set_wavelength sets the current wavelength in Angstrom to wavelength. ARGUMENTS handle CBF handle. wavelength Wavelength in Angstrom. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` write_file(*args) `Returns : *args : String filename,Integer ciforcbf,Integer Headers,Integer encoding C prototype: int cbf_write_file (cbf_handle handle, FILE *file, int readable, int ciforcbf, int headers, int encoding); CBFLib documentation: DESCRIPTION cbf_write_file writes the CBF object specified by handle into the file file, following CIF 1.0 conventions of 80 character lines. cbf_write_widefile writes the CBF object specified by handle into the file file, following CIF 1.1 conventions of 2048 character lines. A warning is issued to stderr for ascii lines over the limit, and an attempt is made to fold lines to fit. No test is performed on binary sections. If a dictionary has been provided, aliases will be applied on output. Unlike cbf_read_file, the file does not have to be random-access. If the file is random-access and readable, readable can be set to non-0 to indicate to CBFlib that the file can be used as a buffer to conserve disk space. If the file is not random-access or not readable, readable must be 0. If readable is non-0, CBFlib will close the file when it is no longer required, otherwise this is the responsibility of the program. ciforcbf selects the format in which the binary sections are written: CIF Write an imgCIF file. CBF Write a CBF file (default). headers selects the type of header used in CBF binary sections and selects whether message digests are generated. The value of headers can be a logical OR of any of: MIME_HEADERS Use MIME-type headers (default). MIME_NOHEADERS Use a simple ASCII headers. MSG_DIGEST Generate message digests for binary data validation. MSG_NODIGEST Do not generate message digests (default). encoding selects the type of encoding used for binary sections and the type of line-termination in imgCIF files. The value can be a logical OR of any of: ENC_BASE64 Use BASE64 encoding (default). ENC_QP Use QUOTED-PRINTABLE encoding. ENC_BASE8 Use BASE8 (octal) encoding. ENC_BASE10 Use BASE10 (decimal) encoding. ENC_BASE16 Use BASE16 (hexadecimal) encoding. ENC_FORWARD For BASE8, BASE10 or BASE16 encoding, map bytes to words forward (1234) (default on little-endian machines). ENC_BACKWARD Map bytes to words backward (4321) (default on big-endian machines). ENC_CRTERM Terminate lines with CR. ENC_LFTERM Terminate lines with LF (default). ARGUMENTS handle CBF handle. file Pointer to a file descriptor. readable If non-0: this file is random-access and readable and can be used as a buffer. ciforcbf Selects the format in which the binary sections are written (CIF/CBF). headers Selects the type of header in CBF binary sections and message digest generation. encoding Selects the type of encoding used for binary sections and the type of line-termination in imgCIF files. RETURN VALUE Returns an error code on failure or 0 for success. SEE ALSO` write_widefile(*args) `write_widefile(self, void ?)` Properties defined here: node get = cbf_handle_struct_node_get(...) set = cbf_handle_struct_node_set(...) row get = cbf_handle_struct_row_get(...) set = cbf_handle_struct_row_set(...) search_row get = cbf_handle_struct_search_row_get(...) set = cbf_handle_struct_search_row_set(...) Data and other attributes defined here: __dict__ = <dictproxy object> `dictionary for instance variables (if defined)` __swig_destroy__ = <built-in function delete_cbf_handle_struct> __swig_getmethods__ = {'node': <built-in function cbf_handle_struct_node_get>, 'row': <built-in function cbf_handle_struct_row_get>, 'search_row': <built-in function cbf_handle_struct_search_row_get>} __swig_setmethods__ = {'node': <built-in function cbf_handle_struct_node_set>, 'row': <built-in function cbf_handle_struct_row_set>, 'search_row': <built-in function cbf_handle_struct_search_row_set>} __weakref__ = <attribute '__weakref__' of 'cbf_handle_struct' objects> `list of weak references to the object (if defined)`
class cbf_positioner_struct(__builtin__.object)
`` |  | Methods defined here: __del__ lambda self __getattr__ lambda self, name __init__(self, *args) `__init__(self) -> cbf_positioner_struct` __repr__ = _swig_repr(self) __setattr__ lambda self, name, value get_reciprocal(*args) `Returns : double reciprocal1,double reciprocal2,double reciprocal3 *args : double ratio,double wavelength,double real1,double real2,double real3 C prototype: int cbf_get_reciprocal (cbf_goniometer goniometer, unsigned int reserved, double ratio, double wavelength, double real1, double real2, double real3, double *reciprocal1, double *reciprocal2, double *reciprocal3); CBFLib documentation: DESCRIPTION cbf_get_reciprocal sets *reciprocal1, * reciprocal2, and * reciprocal3 to the 3 components of the of the reciprocal-space vector corresponding to the real-space vector (real1, real2, real3). The reciprocal-space vector is oriented to correspond to the goniometer setting with all axes at 0. The value wavelength is the wavlength in Angstrom and the value ratio specifies the current goniometer setting and varies from 0.0 at the beginning of the exposur e to 1.0 at the end, irrespective of the actual rotation range. Any of the destination pointers may be NULL. The parameter reserved is presently unused and should be set to 0. ARGUMENTS goniometer Goniometer handle. reserved Unused. Any value other than 0 is invalid. ratio Goniometer setting. 0 = beginning of exposure, 1 = end. wavelength Wavelength in Angstrom. real1 x component of the real-space vector. real2 y component of the real-space vector. real3 z component of the real-space vector. reciprocal1 Pointer to the destination x component of the reciprocal-space vector. reciprocal2 Pointer to the destination y component of the reciprocal-space vector. reciprocal3 Pointer to the destination z component of the reciprocal-space vector. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` get_rotation_axis(*args) `Returns : double vector1,double vector2,double vector3 *args : C prototype: int cbf_get_rotation_axis (cbf_goniometer goniometer, unsigned int reserved, double *vector1, double *vector2, double vector3); CBFLib documentation: DESCRIPTION cbf_get_rotation_axis sets *vector1, *vector2, and *vector3 to the 3 components of the goniometer rotation axis used for the exposure. Any of the destination pointers may be NULL. The parameter reserved is presently unused and should be set to 0. ARGUMENTS goniometer Goniometer handle. reserved Unused. Any value other than 0 is invalid. vector1 Pointer to the destination x component of the rotation axis. vector2 Pointer to the destination y component of the rotation axis. vector3 Pointer to the destination z component of the rotation axis. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` get_rotation_range(*args) `Returns : Float start,Float increment *args : C prototype: int cbf_get_rotation_range (cbf_goniometer goniometer, unsigned int reserved, double *start, double *increment); CBFLib documentation: DESCRIPTION cbf_get_rotation_range sets *start and *increment to the corresponding values of the goniometer rotation axis used for the exposure. Either of the destination pointers may be NULL. The parameter reserved is presently unused and should be set to 0. ARGUMENTS goniometer Goniometer handle. reserved Unused. Any value other than 0 is invalid. start Pointer to the destination start value. increment Pointer to the destination increment value. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` rotate_vector(*args) `Returns : double final1,double final2,double final3 *args : double ratio,double initial1,double initial2,double initial3 C prototype: int cbf_rotate_vector (cbf_goniometer goniometer, unsigned int reserved, double ratio, double initial1, double initial2, double initial3, double *final1, double *final2, double *final3); CBFLib documentation: DESCRIPTION cbf_rotate_vector sets *final1, *final2, and *final3 to the 3 components of the of the vector (initial1, initial2, initial3) after reorientation by applying the goniometer rotations. The value ratio specif ies the goniometer setting and varies from 0.0 at the beginning of the exposure to 1.0 at the end, irrespective of the actual rotation range. Any of the destination pointers may be NULL. The parameter reserved is presently unused and should be set to 0. ARGUMENTS goniometer Goniometer handle. reserved Unused. Any value other than 0 is invalid. ratio Goniometer setting. 0 = beginning of exposure, 1 = end. initial1 x component of the initial vector. initial2 y component of the initial vector. initial3 z component of the initial vector. vector1 Pointer to the destination x component of the final vector. vector2 Pointer to the destination y component of the final vector. vector3 Pointer to the destination z component of the final vector. RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` Properties defined here: axes get = cbf_positioner_struct_axes_get(...) set = cbf_positioner_struct_axes_set(...) axes_are_connected get = cbf_positioner_struct_axes_are_connected_get(...) set = cbf_positioner_struct_axes_are_connected_set(...) axis get = cbf_positioner_struct_axis_get(...) set = cbf_positioner_struct_axis_set(...) matrix get = cbf_positioner_struct_matrix_get(...) set = cbf_positioner_struct_matrix_set(...) matrix_is_valid get = cbf_positioner_struct_matrix_is_valid_get(...) set = cbf_positioner_struct_matrix_is_valid_set(...) Data and other attributes defined here: __dict__ = <dictproxy object> `dictionary for instance variables (if defined)` __swig_destroy__ = <built-in function delete_cbf_positioner_struct> __swig_getmethods__ = {'axes': <built-in function cbf_positioner_struct_axes_get>, 'axes_are_connected': <built-in function cbf_positioner_struct_axes_are_connected_get>, 'axis': <built-in function cbf_positioner_struct_axis_get>, 'matrix': <built-in function cbf_positioner_struct_matrix_get>, 'matrix_is_valid': <built-in function cbf_positioner_struct_matrix_is_valid_get>} __swig_setmethods__ = {'axes': <built-in function cbf_positioner_struct_axes_set>, 'axes_are_connected': <built-in function cbf_positioner_struct_axes_are_connected_set>, 'axis': <built-in function cbf_positioner_struct_axis_set>, 'matrix': <built-in function cbf_positioner_struct_matrix_set>, 'matrix_is_valid': <built-in function cbf_positioner_struct_matrix_is_valid_set>} __weakref__ = <attribute '__weakref__' of 'cbf_positioner_struct' objects> `list of weak references to the object (if defined)`

Functions
`` |  | cbf_detector_struct_swigregister(...) cbf_handle_struct_swigregister(...) cbf_positioner_struct_swigregister(...) get_local_integer_byte_order(*args) `Returns : string *args : C prototype: int cbf_get_local_integer_byte_order (char ** byte_order); CBFLib documentation: DESCRIPTION cbf_get_local_integer_byte_order returns the byte order of integers on the machine on which the API is being run in the form of a character string returned as the value pointed to by byte_order. cbf_get_local_real_byte_order returns the byte order of reals on the machine on which the API is being run in the form of a character string returned as the value pointed to by byte_order. cbf_get_local_real_format returns the format of floats on the machine on which the API is being run in the form of a character string returned as the value pointed to by real_format. The strings returned must not be modified in any way. The values returned in byte_order may be the strings "little_endian" or "big-endian". The values returned in real_format may be the strings "ieee 754-1985" or "other". Additional values may be returned by future versions of the API. ARGUMENTS byte_order pointer to the returned string real_format pointer to the returned string RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` get_local_real_byte_order(*args) `Returns : string *args : C prototype: int cbf_get_local_real_byte_order (char ** byte_order); CBFLib documentation: DESCRIPTION cbf_get_local_integer_byte_order returns the byte order of integers on the machine on which the API is being run in the form of a character string returned as the value pointed to by byte_order. cbf_get_local_real_byte_order returns the byte order of reals on the machine on which the API is being run in the form of a character string returned as the value pointed to by byte_order. cbf_get_local_real_format returns the format of floats on the machine on which the API is being run in the form of a character string returned as the value pointed to by real_format. The strings returned must not be modified in any way. The values returned in byte_order may be the strings "little_endian" or "big-endian". The values returned in real_format may be the strings "ieee 754-1985" or "other". Additional values may be returned by future versions of the API. ARGUMENTS byte_order pointer to the returned string real_format pointer to the returned string RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________` get_local_real_format(*args) `Returns : string *args : C prototype: int cbf_get_local_real_format (char ** real_format ); CBFLib documentation: DESCRIPTION cbf_get_local_integer_byte_order returns the byte order of integers on the machine on which the API is being run in the form of a character string returned as the value pointed to by byte_order. cbf_get_local_real_byte_order returns the byte order of reals on the machine on which the API is being run in the form of a character string returned as the value pointed to by byte_order. cbf_get_local_real_format returns the format of floats on the machine on which the API is being run in the form of a character string returned as the value pointed to by real_format. The strings returned must not be modified in any way. The values returned in byte_order may be the strings "little_endian" or "big-endian". The values returned in real_format may be the strings "ieee 754-1985" or "other". Additional values may be returned by future versions of the API. ARGUMENTS byte_order pointer to the returned string real_format pointer to the returned string RETURN VALUE Returns an error code on failure or 0 for success. _________________________________________________________________`

Data
`` |  | CBF = 0 CBF_BYTE_OFFSET = 112 CBF_CANONICAL = 80 CBF_CATEGORY = 5 CBF_COLUMN = 6 CBF_DATABLOCK = 3 CBF_FLOAT = 32 CBF_INTEGER = 16 CBF_LINK = 1 CBF_NONE = 64 CBF_PACKED = 96 CBF_PREDICTOR = 128 CBF_ROOT = 2 CBF_SAVEFRAME = 4 CBF_UNDEFINED = 65536 CBF_UNDEFNODE = 0 CIF = 1 ENC_BACKWARD = 128 ENC_BASE10 = 8 ENC_BASE16 = 16 ENC_BASE64 = 2 ENC_BASE8 = 32 ENC_CRTERM = 256 ENC_DEFAULT = 578 ENC_FORWARD = 64 ENC_LFTERM = 512 ENC_NONE = 1 ENC_QP = 4 HDR_DEFAULT = 6 MIME_HEADERS = 2 MIME_NOHEADERS = 1 MSG_DIGEST = 8 MSG_DIGESTNOW = 16 MSG_NODIGEST = 4 PLAIN_HEADERS = 1 __author__ = 'Jon Wright <wright@esrf.fr>' __credits__ = 'Paul Ellis and Herbert Bernstein for the excellent CBFlib!' __date__ = '14 Dec 2005' __version__ = 'still_being_written'

Author
`` |  | Jon Wright <wright@esrf.fr>

Credits
`` |  | Paul Ellis and Herbert Bernstein for the excellent CBFlib!