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

Compare with Current View Page History

Version 1 Next »

Run dependent parameters: 

First up are functions that will return e.g. the region-of-interest boundaries for each run. During the experiment, this should be kept up-to-date so if the setup changes, the littleData file will get an entry with new boundaries for a just finished range of runs. This way, the littleDataRun script will always use the correct region of interest for each run.

UserData: Roi definition

def getROIs(run, expname):

    if run<=314:

        sigROI = [[1,2], [85,120], [0,388]]

        sigROI2 = [[1,2], [0,184], [30,315]]

    else:

        sigROI = [[1,2], [83,112], [0,388]]

        sigROI2 = [[1,2], [0,184], [30,315]]

    return sigROI, sigROI2

 

 

ROI: whole area

Below is an entry that show how to add a ROI on a cs140k detector to the littleData. the integral of the ROI and the center-of-mass values for the ROI will always be stored. WriteArea=True will cause the full ROI be written to the event.

User Data: small subarea

have_cs140_0 = checkDet(env, 'cs140_0')

if have_cs140_0:

    cs140_0 = DetObject('cs140_0' ,env, int(run), name='vonHamos')

    cs140_0.addROI('ROI',ROIs[0], writeArea=True, rms=cs140_0.rms)

    cs14)                                                        

    dets.append(cs140_0)

 
 

ROI: projection

 
For a second cs140 detector, we chose a larger ROI, but only save the projections in "x" and "y". Here the projection is done without any further treatment (first lines) and with a threshold of 25 ADU. A threshold using the noise of the pixel as determined in the pedestal run is also possible (use cutRMS = xx where xx is the number of noise RMS a pixel needs to be higher as)

UserData: projections of ROI

have_cs140_1 = checkDet(env, 'cs140_1')

if have_cs140_1:

    cs140_1 = DetObject('cs140_1' ,env, int(run), name='Rowland')

    cs140_1.addROI('ROI',ROIs[1], rms=cs140_1.rms)

    cs140_1.ROI.addProj('_x', axis=0)

    cs140_1.ROI.addProj('_y', axis=1)

    cs140_1.ROI.addProj('_ythres', axis=1, singlePhoton=False, cutADU=25.)

    cs140_1.ROI.addProj('_xthres', axis=0, singlePhoton=False, cutADU=25.)

    dets.append(cs140_1)

 
 

Use of SmallDataAna_psana

For the use of the interactive features of SmallDataAna_psana, we recommend to start it in an ipython session as interactive grabbing of user input is currently not implemented via the notebook.

Creating an average image

 

In order to decide on the proper ROI, fit a team center or make a mask, the first step is always to create an image that you would like to use as base. This is achieved using the following function

 
SDAna In: anaps.AvImage()
 
This will by default create an average image of 100 events of an area detector. 
 
The full command with all its options and a examples is here:
 

AvImage

LDana In [1]: anaps.AvImage?

Type:        instancemethod

String form: <bound method LittleDataAna_psana.AvImage of <LittleDataAna_psana.LittleDataAna_psana object at 0x7fd37fe03590>>

File:        /reg/d/psdm/xpp/xpptut15/res/littleData/xppmodules/scripts/LittleDataAna_psana.py

Definition:  anaps.AvImage(self, detname='None', numEvts=100, thresADU=0.0, thresRms=0.0,useLdat=False, nSkip=0, minIpm=-1.0, common_mode=True)

Docstring:   <no docstring>

 

LDana In [2]: anaps.AvImage()

detectors in event: 

cs140_rob

opal_1

Select detector to select ROI of?:

cs140_rob

try get detector info to make average image for:  cs140_rob

try to make psana Detector with:  cs140_rob

requested  100  used  100

 

LDana In [3]: anaps.plotAvImage()

plot AvImg_cs140_rob using the 5/99.5 percentiles as plot min/max: (1603.9, 1950.21)

  
If you would like to take a quick look at your average image before proceeding, use as seen above:
 
SDAna In: anaps.plotAvImage()
 
which will result in a figure like this popping up:
  • No labels