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.

Azimuthal Integration

Another option is to reduce the data by azimuthally averaging the signal. Here, we need to know the center for the integration as well as the detector distance and beam energy. The latter two are mostly important for the q-values of the bins that will also be stored in the littleData. As conditions will change during an experiment, it is convenient to have a function that return the correct integration setup for each (range of) run(s).

run dependent integration parameters

 

def getAzIntParams(run):
    ret_dict = {'eBeam': 8.015}
    ret_dict['cspad_center'] = [87697.946016760892, 94865.383526655729]
    ret_dict['cspad_dis_to_sam'] = 110.
    return ret_dict

 


UserData: azimuthal integration

 

haveCspad = checkDet(ds.env(), 'cspad')
if haveCspad:
    cspad = DetObject('cspad' ,ds.env(), int(run), name='cspad')
    for iROI,ROI in enumerate(ROIs):
        cspad.addROI('ROI_%d'%iROI, ROI)
 
    cspad.azav_eBeam=azIntParams['eBeam']
    if azIntParams.has_key('cspad_center'):
        cspad.azav_center=azIntParams['cspad_center']
        cspad.azav_dis_to_sam=azIntParams['cspad_dis_to_sam']
        try:
            cspad.addAzAv(phiBins=7)
        except:
            pass
    dets.append(cspad)

 

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