You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

Content

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] = frame[fG0] - ped0[fG0]
         frame[fG1] = ped1[fG1] - frame[fG1]
         frame[fG2] = ped2[fG2] - frame[fG2]

Pedestal subtracted events  for runs 18, 22 from Philip: 

 

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 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 -f nda.expand -n 20 -m 0 -v 7 -p 1
Ex.3:  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.txt -n 5000 -u
Ex.4:  bsub -q psnehq -o log-%J.txt /reg/neh/home4/dubrovin/LCLS/con-jungfrau/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
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 =
                        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 = 255
  -S SAVEBW, --savebw=SAVEBW
                        control bit-word to save arrays, default = 255
  -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:


Geometry

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

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

  • geometry
  • 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. IT NEEDS TO BE TUNED FOR SENSORS' POSITION AND ORIENTATION

 Need in constants of

  • pixel_gain
  • pixel_offset

 

Image

python Detector/examples/ex_jungfrau_det.py 3

References


  • No labels