Content

Jungfrau 0.5M, 1M, 4M

photo from https://lcls.slac.stanford.edu/detectors/jungfrau

photo from Kaz on 2020-10-04

Information from Philip

Test runs

3/6/2017 Philip: The data is in cxi11216.  There is one tile.  I appear to be using runs 9,
11, and 12 as pedestals for gain 0, 1, 2.  Runs 18-22 have some data,
which is highly non-optimal; we have better stuff but in a painful format.

 First look at 1-st event of exp=cxi11216:run=40

Philip's code in /reg/neh/home/philiph/psana/jungfrau/singleModule/makeTuple.py (copy on 2017-05-10)

Pedestal subtraction by Philip
    g0cut = 1<<14
    g1cut = 2<<14
    g2cut = 3<<14
         fG0 = frame<g0cut
         fG1 = (frame>=g0cut) & (frame<g1cut)
         fG2 = frame>=g2cut
         fGval = fG0*1 + fG1*2 + fG2*3

         frame = (frame&0x3fff).astype('int')
         frame[fG0] -= ped0[fG0] # positive sign is accounted in gain0 constants
         frame[fG1] -= ped1[fG1] # negative sign in gain1
         frame[fG2] -= ped2[fG2] # negative sign in gain2


Dark runs processing

Command to process dark runs: jungfrau_ndarr_dark_proc, e.g.

jungfrau_ndarr_dark_proc -h

jungfrau_ndarr_dark_proc -d exp=cxi11216:run=9,11,12:smd -s CxiEndstation.0:Jungfrau.0 -n 2000 -u
Help message after command: jungfrau_ndarr_dark_proc -h
> jungfrau_ndarr_dark_proc -h

Usage: 
jungfrau_ndarr_dark_proc -d <dataset> [-s <source>] [-f <file-name-template>]
       [-n <events-collect>] [-m <events-skip>] [-v <verbosity-bitword>] [-p <plot-bitword>] ...
       where -v, -S control bit-words stand for 1/2/4/8/16/32/... - ave/rms/status/mask/max/min/sta_int_lo/sta_int_hi
Ex.1:  jungfrau_ndarr_dark_proc -d exp=cxi11216:run=9,11,12:smd -s CxiEndstation.0:Jungfrau.0 -f work/nda-#exp-#run-#src-#evts-#type-#date-#time-#fid-#sec-#nsec.txt -n 100
Ex.2:  jungfrau_ndarr_dark_proc -d exp=cxi11216:run=9,11,12:smd -s CxiEndstation.0:Jungfrau.0 -n 5000 -u
Ex.3:  jungfrau_ndarr_dark_proc -d exp=cxi11216:run=9,11,12:smd -s CxiEndstation.0:Jungfrau.0 -n 20 -m 0 -v 7 -p 1
Ex.4:  bsub -q psnehq -o log-%J.txt /reg/neh/home4/dubrovin/LCLS/con-ana-1.3.31-jf/arch/x86_64-rhel7-gcc48-opt/bin/jungfrau_ndarr_dark_proc -d exp=cxi11216:run=9,11,12:smd -s CxiEndstation.0:Jungfrau.0 -n 100 -u
Ex.5:  jungfrau_ndarr_dark_proc -d exp=xcsx22015:run=503,504,505:smd -s XcsEndstation.0:Jungfrau.0 -u
Proceses jungfrau dark dataset.
Options:
  -h, --help            show this help message and exit
  -d DSNAME, --dsname=DSNAME
                        dataset name, default = exp=cxi11216:run=9,12,13:smd
  -s SOURCE, --source=SOURCE
                        input ndarray source name, default =
                        CxiEndstation.0:Jungfrau.0
  -f OFNAME, --ofname=OFNAME
                        output file name template, default =
                        work/nda-#exp-#run-#src-#evts-#type.txt
  -n EVENTS, --events=EVENTS
                        number of events to collect, default = 10000
  -m EVSKIP, --evskip=EVSKIP
                        number of events to skip, default = 0
  -b INTLOW, --intlow=INTLOW
                        intensity low limit, default = 1
  -t INTHIG, --inthig=INTHIG
                        intensity high limit, default = 16000
  -B RMSLOW, --rmslow=RMSLOW
                        rms low limit, default = 0.001
  -T RMSHIG, --rmshig=RMSHIG
                        rms high limit, default = 16000
  -F FRACLM, --fraclm=FRACLM
                        allowed fraction limit, default = 0.1
  -g NSIGMA, --nsigma=NSIGMA
                        number of sigma for gated average, default = 6.0
  -p PLOTIM, --plotim=PLOTIM
                        control bit-word to plot images, default = 0
  -v VERBOS, --verbos=VERBOS
                        control bit-word for verbosity, default = (oct) 0377
  -S SAVEBW, --savebw=SAVEBW
                        control bit-word to save arrays, default = (oct) 0367
  -D INTNLO, --intnlo=INTNLO
                        number of sigma from mean for low limit on INTENSITY,
                        default = 6.0
  -U INTNHI, --intnhi=INTNHI
                        number of sigma from mean for high limit on INTENSITY,
                        default = 6.0
  -L RMSNLO, --rmsnlo=RMSNLO
                        number of sigma from mean for low limit on RMS,
                        default = 6.0
  -H RMSNHI, --rmsnhi=RMSNHI
                        number of sigma from mean for high limit on RMS,
                        default = 6.0
  -c EVCODE, --evcode=EVCODE
                        comma separated event codes for selection as OR
                        combination, any negative code inverts selection,
                        default = None
  -C CLBDIR, --clbdir=CLBDIR
                        calib directory for deployment of calibration files,
                        default = None
  -u, --upload          upload files in calib directory, default = False

Correction

det.calib method is used to get Jungfrau calibrated data. Implementation in Detector/UtilsJungfrau.py

Apply pedestals' correction to the same data which were used for calibration of cxi11216, run 9,11,12, use "working" part of the segment:

    img.shape = (512,1024)

    img = img[:512,:]

Run 9, gain 0

  • raw:
  • calib:
  • common mode corrections in half-rows and columns for gain0 pixel as mask:
           
            

Run 11, gain 2

  • raw:
  • calib:

Run 12, gain 1

  • raw:
  • calib:

Default gain factors

Script jungfrau_deploy_constants deploys gain constants as explained in Jungfrau and Epix10ka Calibration with default gain factors listed in table

Gain rangeDefault gain, ADU/keVAveraged of pixel gains from file
041.5/reg/g/psdm/detector/gains/jungfrau/MDEF/g0_gain.npy
1-1.39

/reg/g/psdm/detector/gains/jungfrau/MDEF/g1_gain.npy

2-0.11/reg/g/psdm/detector/gains/jungfrau/MDEF/g2_gain.npy

Geometry

Segment/detector geometry is explained in 2017-10-11-JF-sensor-layout.pdf


Basic segment geometry is implemented in PSCalib.SegGeometryJungfrauV1.py

mask of edges:

Calibration constants

Example of geometry constants for 1-segment detector is in

/reg/g/psdm/detector/alignment/jungfrau/

    calib/Jungfrau::CalibV1/CxiEndstation.0:Jungfrau.0/geometry/1-end.data

Gungfrau 4M geometry

2020-01-13 drawing from Rebecca: LCL5004-007815_Sheet3.pdf

Script in LCLS psana: Detector/examples/ex_jungfrau_seg_coordinates.py

Jungfrau 4M panel center coordinates
panel long  side: 77.648 mm
panel short side: 38.938 mm
Jungfrau4M panel centers in inch
panel X[inch] Y[inch]
0    -2.236   1.733
1    -0.612   1.733
2     1.012   1.335
3     2.635   1.335
4    -2.635  -1.335
5    -1.011  -1.335
6     0.613  -1.732
7     2.236  -1.732
Jungfrau4M panel centers in um
panel X[um]      Y[um]
0    -56807.100  44005.500
1    -15557.500  44005.500
2     25692.100  33921.700
3     66941.700  33921.700
4    -66941.700 -33921.700
5    -25692.100 -33921.700
6     15557.500 -44005.500
7     56807.100 -44005.500

Jungfrau 4M image

/reg/d/psdm/DET/detdaq17/calib/Jungfrau::CalibV1/DetLab.0:Jungfrau.2/geometry/1-end.data (panels in geometry swapped after det.raw)

imajes of det.raw,  det.calib, and sequentially numerated pixels for (8,512,1024)

Ex: Detector/examples/ex_jungfrau_images.py 41 and 42


Detector interface

Calibration constant types

Detector interface expects to find constant in calib directory of few types:

  • pedestals - from dark runs processing
  • pixel_status - from dark runs processing
  • pixel_gain - supplied by Philip
  • pixel_offset - supplied by Philip
  • pixel_mask - user defined ROI mask
  • geometry - in /reg/g/psdm/detector/alignment/jungfrau/

Examples

  • Detector/examples/ex_jungfrau_det.py
  • Detector/examples/ex_jungfrau_raw_plot.py
  • Detector/examples/ex_jungfrau_ipython.py
  • PSCalib/src/SegGeometryStore.py 5
  • PSCalib/src/SegGeometryJungfrauV1.py [0,...6]

Data type and shape

  • raw data:  shape:(1, 512, 1024)  size:524288  dtype:uint16
  • calib data:  shape:(1, 512, 1024)  size:524288  dtype:float32
  • mask:  shape:(1, 512, 1024)  size:524288  dtype:uint8
  • status_as_mask:  shape:(1, 512, 1024)  size:524288  dtype:uint8
  • mask_geo:  shape:(1, 512, 1024)  size:524288  dtype:uint8
  • mask_calib:  shape:(1, 512, 1024)  size:524288  dtype:uint8


  • pedestals:  shape:(3, 1, 512, 1024)  size:1572864  dtype:float32
  • rms:  shape:(3, 1, 512, 1024)  size:1572864  dtype:float32
  • gain:  shape:(3, 1, 512, 1024)  size:1572864  dtype:float32
  • offset:  shape:(3, 1, 512, 1024)  size:1572864  dtype:float32
  • datast:  shape:(3, 1, 512, 1024)  size:1572864  dtype:uint16
  • status:  shape:(3, 1, 512, 1024)  size:1572864  dtype:uint16
  • coords_x:  shape:(1, 512, 1024)  size:524288  dtype:float64
  • coords_y:  shape:(1, 512, 1024)  size:524288  dtype:float64
  • area:  shape:(1, 512, 1024)  size:524288  dtype:float64
  • image (calibrated data or raw):  shape:(514, 1030)  size:529420  dtype:float32
  • image_xaxis:  shape:(514,)  size:514  dtype:float64
  • image_yaxis:  shape:(1030,)  size:1030  dtype:float64
  • common_mod:  shape:(16,)  size:16  dtype:float64 [   7.    1.  100.    0.    0.]

1M Jungfrau test

Code fix

Add V2 of data and configuration objects

Dark run processing

Philip wrote:

xcsx22015 run 513.  I see gain 0 and 1.
508, 509, 510: normal, forced gain1, forced gain2 dark runs
516, 517, 518: ditto
jungfrau_ndarr_dark_proc -d exp=xcsx22015:run=503,504,505:smd -s XcsEndstation.0:Jungfrau.0 -u 
jungfrau_ndarr_dark_proc -d exp=xcsx22015:run=508,509,510:smd -s XcsEndstation.0:Jungfrau.0 -u
jungfrau_ndarr_dark_proc -d exp=xcsx22015:run=516,517,518:smd -s XcsEndstation.0:Jungfrau.0 -u

Constants of types

  • pedestals
  • pixel_max
  • pixel_min
  • pixel_rms
  • pixel_status

are deployed in

/reg/d/psdm/xcs/xcsx22015/calib/Jungfrau::CalibV1/XcsEndstation.0:Jungfrau.0/

  • geometry -  is also deployed for two segments. Sensor orientation may need to be tuned.

 Constants of

  • pixel_gain
  • pixel_offset

were merged from Philip's files per segment per gain constants. Merging script example is Detector/example/ex_jungfrau_merge_constants.py

Total gain correction formula is

Energy[keV or ADU] = (code - pedestal - offset) / gain

Gain files in units of [ADU/keV] are supplied by PSI and account for correct scale orientation sign. Offset is going to be calibrated by Philip.

Common mode correction is going to be applied to the numerator (for same gain mode pixels?).

Image

python Detector/examples/ex_jungfrau_det.py 3

python Detector/examples/ex_jungfrau_images.py 3 # or 4 loops over dataset events plots calibrated image and raw spectrum:


3 - exp=xcsx22015:run=513 - data

4 - exp=xcsx22015:run=552 - Silver behenate

Alignment for MFX

  • 2017-11-30
  • exp=mfx11116:run=624-626
  • MfxEndstation.0:Jungfrau.0

geometry constants including x,y offsets relative IP
# TITLE      Geometry parameters of Jungfrau
# DATE_TIME  2017-10-26 11:00:00 PDT
# METROLOGY  no metrology available
# AUTHOR     dubrovin
# EXPERIMENT xcsx22015
# DETECTOR   XcsEndstation.0:Jungfrau.0
# CALIB_TYPE geometry
# COMMENT:01 Manually created as an example for the 2-segment 1M Jungfrau detector
# COMMENT:02 
# PARAM:01 PARENT     - name and version of the parent object
# PARAM:02 PARENT_IND - index of the parent object
# PARAM:03 OBJECT     - name and version of the object
# PARAM:04 OBJECT_IND - index of the new object
# PARAM:05 X0         - x-coordinate [um] of the object origin in the parent frame
# PARAM:06 Y0         - y-coordinate [um] of the object origin in the parent frame
# PARAM:07 Z0         - z-coordinate [um] of the object origin in the parent frame
# PARAM:08 ROT_Z      - object design rotation angle [deg] around Z axis of the parent frame
# PARAM:09 ROT_Y      - object design rotation angle [deg] around Y axis of the parent frame
# PARAM:10 ROT_X      - object design rotation angle [deg] around X axis of the parent frame
# PARAM:11 TILT_Z     - object tilt angle [deg] around Z axis of the parent frame
# PARAM:12 TILT_Y     - object tilt angle [deg] around Y axis of the parent frame
# PARAM:13 TILT_X     - object tilt angle [deg] around X axis of the parent frame
# HDR PARENT IND      OBJECT     IND    X0[um]  Y0[um]  Z0[um]   ROT-Z ROT-Y ROT-X    TILT-Z   TILT-Y   TILT-X
JFCAMERA:V1    0    JUNGFRAU:V1    0         0   20625       0       0     0   180    0.0      0.0      0.0
JFCAMERA:V1    0    JUNGFRAU:V1    1         0  -20625       0       0     0   180    0.0      0.0      0.0
IP:V1          0    JFCAMERA:V1    0    -90000   -3000  100000      90     0     0    0.0      0.0      0.0


References




  • No labels