This note is about application (script) which allows to check quality of the optical metrology input during measurement.
Optical metrology measurements contains enough information for self check. Historically this quality check is done offline when entire detector or its quad is measured and entire file is available. Sometimes this file contains typo, which can be fixed using over-defined rectangular geometry of the detector segments. However, it could be much better to fix this problem during optical measurements with microscope. Simple application which can check partial optical metrology input is now available and described in this note.
Optical metrology quality check (QC) application is implemented as a self consistent script which uses standard python features with numpy and matplotlib libraries. It can be downloaded from
https://github.com/lcls-psana/CalibManager/blob/master/app/optical_metrology_check
and used as is by the command
python optical_metrology_check <opt-met-file.txt> |
For development purpose it could be better to use it through psana-conda release system. Code is available since ana-1.2.8. Example:
# login to one of psana nodes ssh -Y pslogin.slac.stanford.edu ssh -Y psana.slac.stanford.edu # set psana environment if it is missing in your .bash_profile or .bash_login source /reg/g/psdm/etc/ana_env.sh |
# setup conda environment source conda_setup # go to any directiory mkdir my-test-dir cd my-test-dir |
optical_metrology_check -h optical_metrology_check <opt-met-file.txt> |
A few complete optical metrology files can be found under directory /reg/g/psdm/detector/alignment/cspad/, e.g. calib-xpp-2016-08-22-camera3/2016-08-22-CSPAD-XPP-Camera3-Metrology.txt
However, script can run on partial metrology file, e.d.: metrology_test.txt, which can be downloaded and used for test purpose:
optical_metrology_check metrology_test.txt |
Running script prints a few section of results, e.g.:
(ana-1.2.8) [dubrovin@psanagpu104:~/my-test-dir]$ optical_metrology_check metrology_test.txt Command: /reg/g/psdm/sw/conda/inst/miniconda2-prod-rhel7/envs/ana-1.2.8/bin/optical_metrology_check metrology_test.txt Argument list: ['metrology_test.txt'] Optional parameters: <key> <value> <default> psz 109.92 109.92 vrb 15 15 ifn ./optical_metrology.txt ./optical_metrology.txt plt True True ofp ./om ./om ------------------------------------------------------------ |
In read_optical_metrology_file: metrology_test.txt EMPTY LINE IS IGNORED IS RECOGNIZED QUAD: 1 EMPTY LINE IS IGNORED COMMENT IS IGNORED : "# this is comment" EMPTY LINE IS IGNORED TITLE LINE: Point X Y Z EMPTY LINE IS IGNORED ACCEPT RECORD: 1 0 0 697 ACCEPT RECORD: 2 -15 20903 604 ACCEPT RECORD: 3 43529 20930 172 ACCEPT RECORD: 4 43542 23 297 EMPTY LINE IS IGNORED ACCEPT RECORD: 9 159 46961 508 ACCEPT RECORD: 10 78 90506 321 ACCEPT RECORD: 11 20986 90547 156 ACCEPT RECORD: 12 21070 47003 343 EMPTY LINE IS IGNORED ACCEPT RECORD: 13 23423 46973 341 ACCEPT RECORD: 14 23540 90519 116 ACCEPT RECORD: 15 44447 90457 -67 ACCEPT RECORD: 16 44342 46917 93 EMPTY LINE IS IGNORED ACCEPT RECORD: 21 47105 69413 27 ACCEPT RECORD: 22 47103 90323 -40 ACCEPT RECORD: 23 90653 90322 -435 ACCEPT RECORD: 24 90651 69415 -365 EMPTY LINE IS IGNORED ACCEPT RECORD: 25 44480 259 284 ACCEPT RECORD: 26 44381 43805 129 ACCEPT RECORD: 27 65305 43846 -50 ACCEPT RECORD: 28 65389 303 109 EMPTY LINE IS IGNORED ACCEPT RECORD: 29 67741 149 98 ACCEPT RECORD: 30 67705 43731 -48 EMPTY LINE IS IGNORED ------------------------------------------------------------ |
check_points_numeration WARNING - numeration of points in table is NOT sequential or started from non-x4 number Measured segment 0 point numbers: ( 1 2 3 4) OK - points in segment are sequential Measured segment 1 point numbers: ( 9 10 11 12) OK - points in segment are sequential Measured segment 2 point numbers: ( 13 14 15 16) OK - points in segment are sequential Measured segment 3 point numbers: ( 21 22 23 24) OK - points in segment are sequential Measured segment 4 point numbers: ( 25 26 27 28) OK - points in segment are sequential |
X-Y quality check for optical metrology measurements ---------------------------------------------------------------------------------------------------------------------------- segm: S1 S2 dS1 dS2 L1 L2 dL1 dL2 angle(deg) D1 D2 dD d(dS) d(dL) ---------------------------------------------------------------------------------------------------------------------------- segm: 0 20903 20907 23 27 43542 43544 -15 -13 0.03290 48302 48304 -1 -4 -2 segm: 1 20911 20908 -81 -84 43545 43544 42 41 0.10855 48307 48302 4 3 1 segm: 2 20919 20907 117 105 43546 43540 -56 -62 -0.14606 48301 48310 -8 12 6 segm: 3 20910 20907 2 -1 43546 43550 -2 2 0.00066 48309 48308 1 3 -4 segm: 4 20909 20924 -99 -84 43546 43543 44 41 0.12040 48307 48309 -1 -15 3 ---------------------------------------------------------------------------------------------------------------------------- |
Z quality check for optical metrology measurements ----------------------------------------------------------------------------------------------------------------------------------------- segm: SA LA XSize YSize dZS1 dZS2 dZL1 dZL2 dZSA dZLA ddZS ddZL dZX dZY angXZ(deg) angYZ(deg) dz3(um) ----------------------------------------------------------------------------------------------------------------------------------------- segm: 0 20905 43543 43543 20905 -93 -125 -400 -432 -109 -416 32 32 -416 -109 -0.54737 -0.29874 -31.962 segm: 1 20909 43544 20909 43544 -165 -165 -187 -187 -165 -187 0 0 -165 -187 -0.45212 -0.24605 0.028 segm: 2 20913 43543 20913 43543 -248 -183 -225 -160 -215 -192 -65 -65 -215 -192 -0.59039 -0.25330 -64.821 segm: 3 20908 43548 43548 20908 -67 -70 -392 -395 -68 -393 3 3 -393 -68 -0.51771 -0.18771 -2.973 segm: 4 20916 43544 20916 43544 -175 -179 -155 -159 -177 -157 4 4 -177 -157 -0.48484 -0.20658 3.885 ----------------------------------------------------------------------------------------------------------------------------------------- |
See for detail CSPAD Geometry and Alignment
dD (um) - difference between diagonals
d(dS) (um) - difference between two short sides
d(dL) (um) - difference between two long sides
dz3 (um) - deviation one of the measured points from the plane of three other points
All these parameters should be about zero within fraction of the pixel size. If not... re-measurement is desirable. |
Application generates and saves in current directory a few useful plots;
map of measured sensors for metrology_test.txt and 2016-08-22-CSPAD-XPP-Camera3-Metrology.txt metrology files:
frequency distributions of a few important parameters, as shown for 2016-08-22-CSPAD-XPP-Camera3-Metrology.txt