Package fabio :: Module marccdimage
[hide private]
[frames] | no frames]

Module marccdimage

source code



Authors: Henning O. Sorensen & Erik Knudsen
         Center for Fundamental Research: Metal Structures in Four Dimensions
         Risoe National Laboratory
         Frederiksborgvej 399
         DK-4000 Roskilde
         email:henning.sorensen@risoe.dk

         + (mods for fabio) Jon Wright, ESRF
marccdimage can read MarCCD and MarMosaic images including header info.

JPW : Use a parser in case of typos (sorry?)

Classes [hide private]
  marccdimage
Read in data in mar ccd format, also MarMosaic images, including header info
Functions [hide private]
 
make_format(c_def_string)
Reads the header definition in c and makes the format string to pass to struct.unpack
source code
 
interpret_header(header, fmt, names)
given a format and header interpret it
source code
Variables [hide private]
  CDEFINITION = '\ntypedef struct frame_header_type {\n ...
  C_TO_STRUCT = {'INT32': 'i', 'UINT16': 'H', 'UINT32': 'I', 'ch...
  C_SIZES = {'INT32': 4, 'UINT16': 2, 'UINT32': 4, 'char': 1}
  MAXIMAGES = 9
  HEADER_FORMAT = 'IccccccccccccccccIIIIIIIIIIIIIIIIIIIIIIIIIIII...
  HEADER_NAMES = ['header_type', 'header_name[16]', 'header_name...
  __package__ = 'fabio'
Variables Details [hide private]

CDEFINITION

Value:
'''
typedef struct frame_header_type {
         /* File/header format parameters (256 bytes) */
         UINT32        header_type;  /* flag for header type  
                                           (can be  used as magic numb\
er) */
         char header_name[16];           /* header name (MMX) */
         UINT32        header_major_version;   /* header_major_version\
...

C_TO_STRUCT

Value:
{'INT32': 'i', 'UINT16': 'H', 'UINT32': 'I', 'char': 'c'}

HEADER_FORMAT

Value:
'IccccccccccccccccIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIccccccccccccc\
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccIII\
IIIIIIIIIIIIIIIIIIIccccccccccccccccccccccccccccccccccccccccHHHHHHHHHHH\
HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH\
HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHiiiiiiiiiiiiiiiiiiiiiii\
iiiiicccccccccccccccciiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiccccccc\
ccccccccciiiiiiiiiiccccccccccccccccccccccccccccccccccccccccccccccccccc\
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\
...

HEADER_NAMES

Value:
['header_type',
 'header_name[16]',
 'header_name[16]',
 'header_name[16]',
 'header_name[16]',
 'header_name[16]',
 'header_name[16]',
 'header_name[16]',
...