Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleList of few quaternions
collapsetrue
Angles around x,y,z:     0.0     0.0     0.0   quaternion: w, x, y, z:   1.000000   0.000000   0.000000   0.000000
Angles around x,y,z:    30.0     0.0     0.0   quaternion: w, x, y, z:   0.965926   0.258819   0.000000   0.000000
Angles around x,y,z:    60.0     0.0     0.0   quaternion: w, x, y, z:   0.866025   0.500000   0.000000   0.000000
Angles around x,y,z:    90.0     0.0     0.0   quaternion: w, x, y, z:   0.707107   0.707107   0.000000   0.000000
Angles around x,y,z:   120.0     0.0     0.0   quaternion: w, x, y, z:   0.500000   0.866025   0.000000   0.000000
Angles around x,y,z:   150.0     0.0     0.0   quaternion: w, x, y, z:   0.258819   0.965926   0.000000   0.000000
Angles around x,y,z:     0.0     0.0     0.0   quaternion: w, x, y, z:   1.000000   0.000000   0.000000   0.000000
Angles around x,y,z:     0.0    30.0     0.0   quaternion: w, x, y, z:   0.965926   0.000000   0.258819   0.000000
Angles around x,y,z:     0.0    60.0     0.0   quaternion: w, x, y, z:   0.866025   0.000000   0.500000   0.000000
Angles around x,y,z:     0.0    90.0     0.0   quaternion: w, x, y, z:   0.707107   0.000000   0.707107   0.000000
Angles around x,y,z:     0.0   120.0     0.0   quaternion: w, x, y, z:   0.500000   0.000000   0.866025   0.000000
Angles around x,y,z:     0.0   150.0     0.0   quaternion: w, x, y, z:   0.258819   0.000000   0.965926   0.000000
Angles around x,y,z:     0.0     0.0     0.0   quaternion: w, x, y, z:   1.000000   0.000000   0.000000   0.000000
Angles around x,y,z:     0.0     0.0    30.0   quaternion: w, x, y, z:   0.965926   0.000000   0.000000   0.258819
Angles around x,y,z:     0.0     0.0    60.0   quaternion: w, x, y, z:   0.866025   0.000000   0.000000   0.500000
Angles around x,y,z:     0.0     0.0    90.0   quaternion: w, x, y, z:   0.707107   0.000000   0.000000   0.707107
Angles around x,y,z:     0.0     0.0   120.0   quaternion: w, x, y, z:   0.500000   0.000000   0.000000   0.866025
Angles around x,y,z:     0.0     0.0   150.0   quaternion: w, x, y, z:   0.258819   0.000000   0.000000   0.965926

...

Rotation around beta and omega

Code Block
titlecell-fiber.cellbeta=90, phi=0, omega=(0,180,30)
collapsetrue
CrystFEL unit cell file version 1.0
lattice_type = triclinic
centering = I
a = 18.36 A
b = 26.65 A
c = 4.81 A
al = 90.0 deg
be = 90.0 deg
ga = 102.83 deg

Detector

Code Block
titledet1500x1500.geom
collapsetrue
adu_per_eV = 1.0
; Single panel
0/min_fs = 0
0/max_fs = 1500
0/min_ss = 0
0/max_ss = 1500
0/corner_x = -750.00
0/corner_y = -750.00
0/fs = x
0/ss = y
0/clen = 0.1      ; 10cm
0/res = 9090.9    ; 110 micron pixel size

pattern_sim

command to generate simulated events:

Code Block
cat quaternion_basis_x90.txt | pattern_sim -g det1500x1500.geom -p cell-fiber.cell --photon-energy=6003 -o result_x90 -n 3 -s 1 --no-noise

Results

Code Block
titlebeta=90, phi=0, omega=(0,180,30)
collapsetrue
Angles around x,y,z:    90.0     0.0     0.0   quaternion: w, x, y, z:   0.707107   0.707107   0.000000   0.000000
Angles around x,y,z:    90.0     0.0    30.0   quaternion: w, x, y, z:   0.683013   0.683013   0.183013   0.183013
Angles around x,y,z:    90.0     0.0    60.0   quaternion: w, x, y, z:   0.612372   0.612372   0.353553   0.353553
Angles around x,y,z:    90.0     0.0     090.0   quaternion: w, x, y, z:   0.707107500000   0.707107500000   0.000000500000   0.000000500000
Angles around x,y,z:    90.0     0.0    30120.0   quaternion: w, x, y, z:   0.683013353553   0.683013353553   0.183013612372   0.183013612372
Angles around x,y,z:    90.0     0.0    60150.0   quaternion: w, x, y, z:   0.612372183013   0.612372183013   0.353553683013   0.353553
Angles around x,y,z:    90.0 683013

Rotation around beta, phi and omega

Code Block
titlebeta=90-18=72, phi=-3.5, omega=(0,180,30)
collapsetrue
Angles around x,y,z:    72.0.0    -3.5     900.0   quaternion: w, x, y, z:   0.500000808640   0.500000587511   -0.500000024706   0.500000017950
Angles around x,y,z:    9072.0    -3.5  0.0   1201.0   quaternion: w, x, y, z:   0.353553808452   0.353553587704   -0.612372019578   0.612372025006
Angles around x,y,z:    9072.0     0.0-3.5     1502.0   quaternion: w, x, y, z:   0.183013808203   0.183013587853   -0.683013014449   0.683013

 

 

 

Code Block
titlebeta=90+18=108, phi=3.5, omega=(0,180,30)
collapsetrue
Angles around x,y,z:   108032060
Angles around x,y,z:    72.0     -3.5     03.0   quaternion: w, x, y, z:   0.587511807893   0.808640587957   -0.017950009318   -0.024706039112
Angles around x,y,z:    10872.0     -3.5    30 4.0   quaternion: w, x, y, z:   0.573887807521   0.776440588015   -0.226630004187   0.128195046160
Angles around x,y,z:   108 72.0     -3.5    60 5.0   quaternion: w, x, y, z:   0.521153807087   0.691327588030   0.419865000944   0.272359
Angles around x,y,z:   108.0     3.5    90.0   quaternion: w, x, y, z:   0.432903   0.559102   0.584487   0.397963
Angles around x,y,z:   108.0     3.5   120.0   quaternion: w, x, y, z:   0.315152   0.388775   0.709278   0.496446
Angles around x,y,z:   108.0     3.5   150.0   quaternion: w, x, y, z:   0.175923   0.191953   0.785732   0.561098

 

Rotation around omega

Quaternions

Table of quaternions was generated using methods in pyimgalgos/src/Quaternion.py

Self-test for Quaternion

self-test uses a chain of conversions:

  • angles -> rotation matrix -> quaternion -> rotation matrix -> angles,

where in and out angles and rotation matrix coincide.

Script cxif5315/make-quaternions.py generates file with a list of quaternions from file with table of angles

Code Block
titleList of few quaternions
collapsetrue
Angles around x,y,z:     0.0     0.0     0.0   quaternion: w, x, y, z:   1.000000   0.000000   0.000000   0.000000
Angles around x,y,z:    30.0     0.0     0.0   quaternion: w, x, y, z:   0.965926   0.258819   0.000000   0.000000
Angles around x,y,z:    60.0     0.0     0.0   quaternion: w, x, y, z:   0.866025   0.500000   0.000000   0.000000
Angles around x,y,z:    90.0     0.0     0.0   quaternion: w, x, y, z:   0.707107   0.707107   0.000000   0.000000
Angles around x,y,z:   120.0     0.0     0.0   quaternion: w, x, y, z:   0.500000   0.866025   0.000000   0.000000
Angles around x,y,z:   150.0     0.0     0.0   quaternion: w, x, y, z:   0.258819   0.965926   0.000000   0.000000
Angles around x,y,z:     0.0     0.0     0.0   quaternion: w, x, y, z:   1.000000   0.000000   0.000000   0.000000
Angles around x,y,z:     0.0    30.0     0.0   quaternion: w, x, y, z:   0.965926   0.000000   0.258819   0.000000
Angles around x,y,z:     0.0    60.0     0.0   quaternion: w, x, y, z:   0.866025   0.000000   0.500000   0.000000
Angles around x,y,z:     0.0    90.0     0.0   quaternion: w, x, y, z:   0.707107   0.000000   0.707107   0.000000
Angles around x,y,z:     0.0   120.0     0.0   quaternion: w, x, y, z:   0.500000   0.000000   0.866025   0.000000
Angles around x,y,z:     0.0   150.0     0.0   quaternion: w, x, y, z:   0.258819   0.000000   0.965926   0.000000
Angles around x,y,z:     0.0     0.0     0.0   quaternion: w, x, y, z:   1.000000   0.000000   0.000000   0.000000
Angles around x,y,z:     0.0     0.0    30.0   quaternion: w, x, y, z:   0.965926   0.000000   0.000000   0.258819
Angles around x,y,z:     0.0     0.0    60.0   quaternion: w, x, y, z:   0.866025   0.000000   0.000000   0.500000
Angles around x,y,z:     0.0     0.0    90.0   quaternion: w, x, y, z:   0.707107   0.000000   0.000000   0.707107
Angles around x,y,z:     0.0     0.0   120.0   quaternion: w, x, y, z:   0.500000   0.000000   0.000000   0.866025
Angles around x,y,z:     0.0     0.0   150.0   quaternion: w, x, y, z:   0.258819   0.000000   0.000000   0.965926

Unit cell

Code Block
titlecell-fiber.cell
collapsetrue
CrystFEL unit cell file version 1.0
lattice_type = triclinic
centering = I
a = 18.36 A
b = 26.65 A
c = 4.81 A
al = 90.0 deg
be = 90.0 deg
ga = 102.83 deg

Detector

Code Block
titledet1500x1500.geom
collapsetrue
adu_per_eV = 1.0
; Single panel
0/min_fs = 0
0/max_fs = 1500
0/min_ss = 0
0/max_ss = 1500
0/corner_x = -750.00
0/corner_y = -750.00
0/fs = x
0/ss = y
0/clen = 0.1      ; 10cm
0/res = 9090.9    ; 110 micron pixel size

pattern_sim

command to generate simulated events:

Code Block
cat quaternion_basis_x90.txt | pattern_sim -g det1500x1500.geom -p cell-fiber.cell --photon-energy=6003 -o result_x90 -n 3 -s 1 --no-noise

Results

Code Block
titlebeta=90, phi=0, omega=(0,180,30)
collapsetrue
Angles around x,y,z:    90.0     0.0     0.0   quaternion: w, x, y, z:   0.707107   0.707107   0.000000   0.000000
Angles around x,y,z:    90.0     0.0    30.0   quaternion: w, x, y, z:   0.683013   0.683013   0.183013   0.183013
Angles around x,y,z:    90.0     0.0    60.0   quaternion: w, x, y, z:   0.612372   0.612372   0.353553   0.353553
Angles around x,y,z:    90.0     0.0    90.0   quaternion: w, x, y, z:   0.500000   0.500000   0.500000   0.500000
Angles around x,y,z:    90.0     0.0   120.0   quaternion: w, x, y, z:   0.353553   0.353553   0.612372   0.612372
Angles around x,y,z:    90.0     0.0   150.0   quaternion: w, x, y, z:   0.183013   0.183013   0.683013   0.683013

 

 

 

Code Block
titlebeta=90+18=108, phi=3.5, omega=(0,180,30)
collapsetrue
Angles around x,y,z:   108.0     3.5     0.0   quaternion: w, x, y, z:   0.587511   0.808640   0.017950  -0.024706
Angles around x,y,z:   108.0     3.5    30.0   quaternion: w, x, y, z:   0.573887   0.776440   0.226630   0.128195
Angles around x,y,z:   108.0     3.5    60.0   quaternion: w, x, y, z:   0.521153   0.691327   0.419865   0.272359
Angles around x,y,z:   108.0     3.5    90.0   quaternion: w, x, y, z:   0.432903   0.559102   0.584487   0.397963
Angles around x,y,z:   108.0     3.5   120.0   quaternion: w, x, y, z:   0.315152   0.388775   0.709278   0.496446
Angles around x,y,z:   108.0     3.5   150.0   quaternion: w, x, y, z:   0.175923   0.191953   0.785732   0.561098

 

...

053205

Unit cell

Code Block
titlecell-fiber.cell
collapsetrue
CrystFEL unit cell file version 1.0
lattice_type = triclinic
centering = I
a = 18.36 A
b = 26.65 A
c = 4.81 A
al = 90.0 deg
be = 90.0 deg
ga = 102.83 deg

Detector

Code Block
titledet1500x1500.geom
collapsetrue
adu_per_eV = 1.0
; Single panel
0/min_fs = 0
0/max_fs = 1500
0/min_ss = 0
0/max_ss = 1500
0/corner_x = -750.00
0/corner_y = -750.00
0/fs = x
0/ss = y
0/clen = 0.1   ; 10cm
0/res = 9098   ; 109.92 micron pixel size

pattern_sim

command to generate simulated events:

Code Block
cat quaternion_basis_x90.txt | pattern_sim -g det1500x1500.geom -p cell-fiber.cell -o result_x90 --photon-energy=6003 --spectrum=tophat --beam-bandwidth=1e-6 --min-size=30 --max-size=3 -n 3 -s 1 --no-noise

# output file accumulates events... (bug?)
# OR per event with complete control on names etc.

echo "0.587174 0.803196 0.095372 0.031718" | pattern_sim -g det1500x1500.geom -p cell-fiber.cell -o results_x90 --photon-energy=6003 --spectrum=tophat --beam-bandwidth=1e-6 --min-size=30 --max-size=30 -n 1 -s 1 --no-noise --no-fringes

Results

Rotation around omega

Angles around x,y,z: 90.0 0 (0,180,1):

Image Addedimage generated with defailt sample size

Image AddedImage Added

Angles around x,y,z: 90.0 0 -3.5 (0,180,1):

Image RemovedImage RemovedImage AddedImage Added

Angles around x,y,z: 90.0 -3.5 (0,180,1):

Image Removed

Angles around x,y,z: 90.0-18 -3.5 (0,180,1):

Image RemovedImage Removed

Summary

  • Thomas White did not advice to use pattern_sim due to potential bugs.
  • In stead he suggested to use diffraction.

 

 

 

 

Summary

  • Thomas White did not advice to use pattern_sim due to potential bugs.
  • In stead he suggested to use diffraction.

 

 

...

.0-18 -3.5 (0,180,1):

Image AddedImage Added

Summary

  • Thomas White did not advice to use pattern_sim due to potential bugs.
  • In stead he suggested to use diffraction.
  • pattern_sim has a few problems in different versions
    • source /reg/g/cfel/crystfel/crystfel-0.6.2/setup-sh  # has problems with peak intensity ~25*e6 ADU, not sensitive to adu_per_eV, etc

    • --spectrum=tophat --beam-bandwidth=1e-6 - removes photon energy spread
    • --min-size=30 --max-size=30             - changes a size of sample and peak size and intensity
    • -n NNN - this option generates accumulated image
    •  ...