General remarks
Command geometry_convert
with parameters executed in psana environment converts geometry constants between psana and CrystFEL formats forth and back depending on input file name extension. Converter works for a few major composite detectors cspad, pnccd, epix10ka, jungfrau.
Forward conversion by default changes coordinate frame from psana (the same frame as in optical metrology) to CrystFEL (LAB frame: z-along photon beam, y-up, x=[y×z]). The LAB frame is widely used in crystallography data processing. Backward conversion does not change coordinate frame and generates panels' positions and tilts as is. Pixel coordinates reconstructed in psana from this file will also be defined in the LAB frame.
Conversion commands
Conversion from psana to CrystFEL
Command for "forward" conversion of the detector geometry constants from psana to CrystFEL needs in a couple of parameters for input psana geometry file name (-f) and optionally output CrystFEL geometry file name (-o), for example
geometry_convert -f geo-cspad-psana.data -o geo-cspad-crystfel.geom
By default converter changes coordinate frame from psana (similar to one in optical metrology) to LAB (usually used in CrystFEL). Parameter --cframe 0
allows to keep the coordinate frame unchanged.
Forward converter recognizes detectors epix10ka, jungfrau, cspad, pnccd
from their segment names EPIX10KA:V1, EPIX10KA:V2, JUNGFRAU:V1, JUNGFRAU:V2, SENS2X1:V1, PNCCD:V1, MTRX:V2:512:512:75:75 loaded from the input geometry file.
Use dataset for z position correction
Since ana-4.0.47-py3 three optional parameters added to apply z-position correction from PV variables.
To apply z position correction at least --dsname parameter should be specified. In this case PV names CXI:DS1:MMS:06.RBV, CXI:DS2:MMS:06.RBV, MFX:DET:MMS:04.RBV, XPP:ROB:POS:Z, AMO:LMP:MMS:10.RBV are tested for availability.
- if nothing found, the list of all available PV names is printed, correction is not applied,
- if more than one found, specification of one of them is requested in parameter --zpvname,
- if one is found - its value is used with factor --f_um to apply correction.
- if --zpvname is specified incorrectly and not found, the list of all available PV names is printed, correction is not applied.\
Example of the command with z position correction:
geometry_convert -f geo-jungfrau.data -o geo-jungfrau.geom --dsname exp=cxic00318:run=123:smd --zpvname CXI:DS1:MMS:06.RBV
Conversion from CrystFEL to psana
Command for "backward" conversion of the detector geometry constants from CrystFEL to psana needs in a couple of parameters for detector type (-d) and input CrystFEL geometry file name (-f). Optional output file name (-o) for psana geometry is also useful, for example
geometry_convert -d epix10ka -f geo-epix10ka2m-crystfel.geom -o geo-epix10ka2m-psana.txt
The file name extension *.geom
in option -f launches conversion from CrystFEL to psana.
For now, backward converter works for detector types epix10ka, jungfrau, cspad (with quads like in cxi), cspadv2 (without quads like in xpp), pnccd
. Information about detector type is missing in the CrystFEL *.geom file, so parameted -d needs to be specified.
Special case of CSPAD detector
ASIC naming convention in CrystFEL are slightly different for cspad with and without moving quads. Appropriate detector type (-d) should be specified explicitly as cspad or cspadv2, respectively, for exampe
geometry_convert -d cspad -f geo-cspad-cxi-crystfel.geom -o geo-cspad-cxi-psana.data
geometry_convert -d cspadv2 -f geo-cspad-xpp-crystfel.geom -o geo-cspad-xpp-psana.data
Command help
More information about command and parameters can be obtained with help option (-h),
geometry_convert -h