Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

-d <dirname>: the smallData file is read from <dirname>. The cube files will also be written there. At this point, the cubes will always be written where the smallData is read from.
---old---
These files are typically named "CubeSetup_<somethingDescriptive>" and are passed along to a job submission script called "cubeRun" . cubeRun has a help function that explains the command line parameters, but they are very similar to littleDataRun, aside from the necessary "-c <CubeSetupFilename>". The following are some of the options that differ from littleDataRun. -m  takes the common mode parameter: 5 means using the unbonded pixels and 1 uses the zero peak. "1" works better, but fails if ASICs have a lot of signal. The unbounded pixels always work. If we want to threshold the pixels in high gain mode, I would suggest 2.5 rms or 25 ADU as typically working values to start with.

-s <size>: rebin image to size x size pixels

-m <common mode parmaeter>:  apply common mode

-t <thres in ADU>: hitfinder

-T <thres in Rms>: hitfinder

-R store raw cspad data (NOT image)

j <number of MPI jobs>
If you specify a number of jobs exceeding the number of bins significantly, a fake variable will be added for binning to spread the bin-based calculation to more cores/nodes. This intermediate variable will be taken out at the very end.The hdf5 file also stores the pedestal and rms values. If the data is stored is "raw" format, then the big CsPad will have the shape of 32x185x388 instead of 1692x1691. The same is true for the pedestal and the rms. We also store the x/y values for each pixel. 

Cube data format

By default, the data gets saved in an hdf5 file in /reg/d/psdm/<instrument>/<expname>/hdf5/smalldata

and the files have names like Cube_<expname>_Run<runnumber>_<cubename><optional _on/off>.h5

h5ls -r on an example file looks like this:

Code Block
/Cfg__epix10ka2m__calib_mask Dataset {16, 352, 384}
/Cfg__epix10ka2m__gain   Dataset {7, 16, 352, 384}
/Cfg__epix10ka2m__ix     Dataset {16, 352, 384}/
Cfg__epix10ka2m__iy     Dataset {16, 352, 384}
/Cfg__epix10ka2m__mask   Dataset {16, 352, 384}
/Cfg__epix10ka2m__ped    Dataset {7, 16, 352, 384}
/Cfg__epix10ka2m__rms    Dataset {7, 16, 352, 384}
/Cfg__epix10ka2m__x      Dataset {16, 352, 384}
/Cfg__epix10ka2m__y      Dataset {16, 352, 384}
/binVar                  Dataset {13}
/binVar_bins             Dataset {13}
/cubeSelection           Dataset {1}
/epix10ka2m              Dataset {13, 16, 352, 384}
/ipm5__sum               Dataset {13}
/nEntries                Dataset {13}
/std_binVar_bins         Dataset {13}
/std_delay               Dataset {13}
/std_ipm5__sum           Dataset {13}

 

/Cfg__<detnames>__<parametername>

are calibration parameters for a detector. This will be added whenever detector data from the big xtc file is added.

/nEntries is somewhat self-explanatory

/binVar_bins are the bin boundaries for the binning variable.

/std__<varname> are the std calculated from all data points in the bin.

/ipm5__sum and /epix10ka2m are the main data: ipm5__sum is from the smalldata and in this case can be used for normalization of the incoming beam intensity. epix10ka2m is the full data for the epix10ka2m detector.

cubeSelection is a dataset stored for its attribute which is the text of the selection criteria used for the creating of this cube.

Advanced options (in progress)

Multi-dimensional binning

You can add more dimensions to bin the data in by using <cube>.add_BinVar:

Code Block
 def add_BinVar(self, addBinVars):        
"""        
add extra dimensions to bin the data in        
parameters: addBinVars: dict or list                    
list: only 1 extra variable [varname, bin1, bin2, ....]                    
dict: {varname: bins}        
"""

Indices for the events in all dimensions will be created and turned into one big flat index after which xarray binning is used. Finally, the data is reshaped into the expected formIt is possible to do this.

Returning event-by-event data (from smallData

...

ONLY when using SmallDataAna.makeCubeData)

Code Block
ana.addToCube(<cubename>, targetVar, isIdxVar=True)

When variables are added to the cube is isIdxVars=True (default is False), in additional to the cube-dictionary, a second dictionary with list of values for each bin of the cube are returned. This only works for the SmallDataAna method, NOT the SmallDataAna_psana one. You can then treat the returned data further, e.g. by pic,ing one event for each bin out of the list and write out the data for those events. This is demonstrated in PickedEventsCube.pyIt is possible to do this.

Getting data from laser-off images closest in time for each cube slice

...