Page History
...
Code Block |
---|
from PSCalib.GeometryAccess import *
fname_geometry = ’<path>/geometry/0-end.data’
geometry = GeometryAccess(fname_geometry, 0377)
pix_size = geometry.get_pixel_scale_size()
X, Y, Z = geometry.get_pixel_coords(’QUAD:V1’, 1) # for quad
X, Y, Z = geometry.get_pixel_coords() # for top object (CSPAD)
iX, iY = geometry.get_pixel_coord_indexes(’QUAD:V1’, 1, pix_scale_size_um=None, xy0_off_pix=None) # for quad
iX, iY = geometry.get_pixel_coord_indexes(xy0_off_pix=(1000, 1000)) # for top object (CSPAD)
img = img_from_pixel_arrays(iX,iY,W=<intensity-array>)
img = img_from_pixel_arrays(iX,iY) # Image of 0/1 for fake/real pixels
arr = geometry.get_pixel_mask(’QUAD:V1’, 1, 1+2+4+8)
arr.shape = (8,185,388)
dict_comm = geometry.get_dict_of_comments()
d = geometry.get_dict_of_comments()
print "d[’DATE_TIME’] = %s" % d[’DATE_TIME’]
|
...
Geometry File Format Conversion
TJ Lane has geometry-conversion scripts (currently psana/cheetah/crystfel). They can be obtained from github here: https://github.com/LinacCoherentLightSource/psgeom. Cctbx.xfel conversion instruction can be found here: http://viper.lbl.gov/cctbx.xfel/index.php/Cxi02416_calibration. Use the following command to convert cbf to psana format:
cxi.cbfheader2slaccalib
There's a command to go from psana format to cctbx, it's not documented above but Aaron Brewster says it is
cxi.slaccalib2cbfheader
Summary
Pixel detector geometry generic parameterization presented in this note is implemented in LCLS analysis software releases since ana-0.13.N. Both C++ and Python interfaces are available.
...