marcif_header.h

Go to the documentation of this file.
00001 /***********************************************************************
00002  *
00003  * cif_header.h
00004  *
00005  * Copyright by:        Dr. Claudio Klein
00006  *                      X-ray Research GmbH, Hamburg
00007  *
00008  * Version:     1.0
00009  * Date:        30/10/2000
00010  *
00011  * History:
00012  * Version    Date      Changes
00013  * ______________________________________________________________________
00014  *
00015  *
00016  ***********************************************************************/
00017 
00018 #define N_SCAN_AXES             4
00019 
00020 #define N_SCAN_FRAME_AXES       15
00021 #define AXIS_PHI                0
00022 #define AXIS_OMEGA              1
00023 #define AXIS_CHI                2
00024 #define AXIS_THETA              3
00025 #define AXIS_DISTANCE           4
00026 #define AXIS_Z                  5
00027 #define AXIS_SLIT_1_HOR         6
00028 #define AXIS_SLIT_1_VER         7
00029 #define AXIS_SLIT_2_HOR         8
00030 #define AXIS_SLIT_2_VER         9 
00031 #define AXIS_TRANS_HOR          10
00032 #define AXIS_TRANS_VER          11
00033 #define AXIS_ROT_HOR            12
00034 #define AXIS_ROT_VER            13
00035 #define AXIS_BEAMSTOP           14
00036 
00037 /*
00038  * General mmCIF items 
00039  */
00040 
00041 typedef struct {
00042         char                    creation_date           [32];
00043         char                    creation_method         [32];
00044 } AUDIT;
00045 
00046 typedef struct {
00047         float                   angle_alpha;
00048         float                   angle_beta;
00049         float                   angle_gamma;
00050         float                   length_a;
00051         float                   length_b;
00052         float                   length_c;
00053         float                   length_alpha_esd;
00054         float                   length_beta_esd;
00055         float                   length_gamma_esd;
00056         float                   length_a_esd;
00057         float                   length_b_esd;
00058         float                   length_c_esd;
00059         float                   volume;
00060         float                   volume_esd;
00061         int                     formula_units_Z;
00062 } CELL;
00063 
00064 typedef struct {
00065         char                    name_common             [32];
00066 } CHEMICAL;
00067 
00068 typedef struct {
00069         char                    cell_refinement         [32];
00070         char                    data_collection         [32];
00071         char                    data_reduction          [32];
00072 } COMPUTING;
00073 
00074 typedef struct {
00075         char                    colour                  [32];
00076         char                    description             [64];
00077         float                   size_min;
00078         float                   size_max;
00079         float                   size_mid;
00080         float                   size_rad;
00081 } EXPTL_CRYSTAL;
00082 
00083 typedef struct {
00084         float                   ambient_temp;
00085         float                   ambient_pressure;
00086 } DIFFRN;
00087 
00088 typedef struct {
00089         char                    detector                [32];
00090         char                    collimation             [32];
00091         char                    monochromator           [32];
00092         char                    type                    [32];
00093 } DIFFRN_RADIATION;
00094 
00095 typedef struct {
00096         char                    id                      [16];
00097         float                   polarisn_norm;
00098         float                   polarisn_ratio;
00099         float                   wavelength;
00100         float                   wavelength_wt;
00101 } DIFFRN_RADIATION_WAVELENGTH;
00102 
00103 typedef struct {
00104         char                    source                  [32];
00105         char                    type                    [32];
00106         float                   current;
00107         float                   power;
00108         float                   voltage;
00109 } DIFFRN_SOURCE;
00110 
00111 
00112 /*
00113  * CBF/imgCIF specific items
00114  */
00115 
00116 typedef struct {
00117         char                    compression_type        [32];
00118         char                    encoding_type           [32];
00119         char                    byte_order              [16];
00120 } ARRAY_STRUCTURE;
00121 
00122 typedef struct {
00123         int                     dimension;
00124         int                     index;
00125         int                     precedence;
00126         char                    direction               [16];
00127 } ARRAY_STRUCTURE_LIST;
00128 
00129 typedef struct {
00130         int                     index                   [ 2];
00131         float                   pixelsize               [ 2];
00132 } ARRAY_ELEMENT_SIZE;
00133 
00134 typedef struct {
00135         float                   gain;
00136         char                    linearity               [20];
00137         float                   offset;
00138         float                   scaling;
00139         float                   overload;
00140         float                   undefined_value;
00141 } ARRAY_INTENSITIES;
00142 
00143 typedef struct {
00144         char                    id                      [32];
00145         char                    type                    [32];
00146         char                    equipment               [32];
00147         char                    depends_on              [32];
00148         float                   vector                  [ 3];
00149         float                   offset                  [ 3];
00150 } AXIS;
00151 
00152 typedef struct {
00153         char                    detector                [32];
00154         char                    type                    [32];
00155         char                    details                 [64];
00156         int                     number_of_axes;
00157         float                   deadtime;
00158 } DIFFRN_DETECTOR;
00159 
00160 typedef struct {
00161         float                   center_x;
00162         float                   center_y;
00163 } DIFFRN_DETECTOR_ELEMENT;
00164 
00165 typedef struct {
00166         char                    details                 [128];
00167         char                    device                  [32];
00168         char                    device_type             [32];
00169         char                    method                  [32];
00170         int                     number_of_axes;
00171         float                   sample_detector_distance;
00172 } DIFFRN_MEASUREMENT;
00173 
00174 typedef struct {
00175         int                     frames;
00176         char                    frame_id_start          [64];
00177         char                    frame_id_end            [64];
00178         float                   integration_time;
00179 } DIFFRN_SCAN;
00180 
00181 typedef struct {
00182         char                    axis_id                 [32];
00183         float                   angle_start;
00184         float                   angle_range;
00185         float                   angle_increment;
00186         float                   displacement_start;
00187         float                   displacement_range;
00188         float                   displacement_increment;
00189 } DIFFRN_SCAN_AXIS;
00190 
00191 typedef struct {
00192         float                   integration_time;
00193         int                     frame_number;
00194 } DIFFRN_SCAN_FRAME;
00195 
00196 typedef struct {
00197         char                    axis_id                 [32];
00198         float                   angle;
00199         float                   displacement;
00200 } DIFFRN_SCAN_FRAME_AXIS;
00201 
00202 /* marresearch MARIP category */
00203 typedef struct {
00204         char                    id                      [16];
00205         char                    detector_id             [32];
00206 } MARIP;
00207 
00208 typedef struct {
00209         int                     gap                     [8];
00210 } MARIP_GAPS;
00211 
00212 typedef struct {
00213         int                     channel_a;
00214         int                     channel_b;
00215         int                     add_channel_a;
00216         int                     add_channel_b;
00217         int                     oversampling;
00218         float                   multiplier;
00219         float                   gain;
00220 } MARIP_ADC;
00221 
00222 typedef struct {
00223         int                     scanmode;
00224         int                     number_of_pixels;
00225         int                     number_of_pixels_larger_16_bit;
00226         float                   pixel_height;
00227         float                   pixel_length;
00228         float                   radial_offset;
00229         float                   tangential_offset;
00230 } MARIP_SCAN;
00231 
00232 typedef struct {
00233         char                    type                    [16];
00234         float                   time;
00235         float                   dose;
00236 } MARIP_EXPOSURE;
00237 
00238 typedef struct {
00239         char                    axis_id                 [32];
00240         float                   angle_start;
00241         float                   angle_end;
00242         float                   angle_increment;
00243         int                     oscillations;
00244         float                   displacement;
00245 } MARIP_AXIS;
00246 
00247 typedef struct {
00248         float                   start;
00249         float                   end;
00250         float                   min;
00251         float                   max;
00252         float                   avg;
00253         float                   esd;
00254         int                     measurements;
00255 } MARIP_EXPOSURE_DOSE;
00256 
00257 typedef struct {
00258         float                   intensity_avg;
00259         float                   intensity_esd;
00260         int                     intensity_min;
00261         int                     intensity_max;
00262         int                     histogram_start;
00263         int                     histogram_end;
00264         int                     histogram_max;
00265 } MARIP_DATA;
00266 
00267 typedef struct {
00268 
00269         char                    entry_id                [32];
00270         char                    array_id                [32];
00271         char                    crystal_id              [32];
00272         char                    diffrn_id               [32];
00273         char                    detector_id             [32];
00274         char                    scan_id                 [32];
00275         char                    element_id              [32];
00276         char                    data_id                 [32];
00277         char                    mar_id                  [32];
00278         char                    frame_id                [64];
00279         int                     binary_id;
00280 
00281         /* Category */          /* Element */   
00282         AUDIT                   audit;
00283         CELL                    cell;
00284         CHEMICAL                chemical;
00285         COMPUTING               computing;
00286         DIFFRN                  diffrn;
00287         DIFFRN_RADIATION        diffrn_radiation;
00288         DIFFRN_RADIATION_WAVELENGTH diffrn_radiation_wavelength;
00289         DIFFRN_SOURCE           diffrn_source;
00290         EXPTL_CRYSTAL           exptl_crystal;
00291 
00292         ARRAY_STRUCTURE         array_structure;
00293         ARRAY_STRUCTURE_LIST    array_structure_list[2];
00294         ARRAY_ELEMENT_SIZE      array_element_size;
00295         ARRAY_INTENSITIES       array_intensities;
00296         AXIS                    axis                    [N_SCAN_FRAME_AXES];
00297         DIFFRN_DETECTOR         diffrn_detector;
00298         DIFFRN_DETECTOR_ELEMENT diffrn_detector_element;
00299         DIFFRN_MEASUREMENT      diffrn_measurement;
00300         DIFFRN_SCAN             diffrn_scan;
00301         DIFFRN_SCAN_AXIS        diffrn_scan_axis        [N_SCAN_AXES];
00302         DIFFRN_SCAN_FRAME       diffrn_scan_frame;
00303         DIFFRN_SCAN_FRAME_AXIS  diffrn_scan_frame_axis  [N_SCAN_FRAME_AXES];
00304 
00305         MARIP                   diffrn_detector_mar;
00306         MARIP_ADC               diffrn_detector_mar_adc;
00307         MARIP_GAPS              diffrn_detector_mar_gaps;
00308         MARIP_DATA              diffrn_detector_mar_data;
00309         MARIP_SCAN              diffrn_detector_mar_scan;
00310         MARIP_AXIS              diffrn_detector_mar_axis[N_SCAN_AXES+1];
00311         MARIP_EXPOSURE          diffrn_detector_mar_exposure;
00312         MARIP_EXPOSURE_DOSE     diffrn_detector_mar_exposure_dose;
00313 } CIF_HEADER;