Making a pedestal from selected events within a run

SmallDataAna_psana (psana) as a function that will select events satisfying a certain condition and write out the average of the data, the std of all events and a status set in the same form as the calibration scripts save the data used for processing of the image data.
This can be used to refine the pedestal used during an experiment to use e.g. dropped shots from the same run, rather than from a run taken e.g. at the beginning of the shift. This does NOT work for gain switching detectors.
makePedestal(self, detname, useFilter=None, numEvts=-1, pedRange=[10,10000], rmsRange=[2.,7.], i0Check='ipm', dirname='./')
detname is the alias of the detector in the DAQ: this is the same name you would use when setting up the smalData production. useFilter is the name of the event selection. numEvents is the number of events to be used: -1 means all events in the run. The event will be read in a single thread using index mode.
pedRange and rmsRange specify what pixels are considered good: a status file with pixels failing any of these cuts will be created as well. If dirname is set to 'calib', then the file will be written to the calibration directory used so that it will be used in future data reprocessing. By default, these files will be written locally.
i0Check is used to make sure that we are using events within xray intensity for this selection: if you pass e.g. 'ipm' for XCS or XPP, the average 'ipm value' for off events and all events will be calculated and making the pedestal will be aborted if no difference between the two is seen. Passing "None" will default to the gas detector, and passing an empty string corresponds to no check.
  • No labels