Versions Compared

Key

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

...


Code Block
languagepy
themeRDark
def getROIs(run):
    """ Set parameter for ROI analysis. Set writeArea to True to write the full ROI in the h5 file.
    See roi_rebin.py for more info
    """
    if isinstance(run,str):
        run=int(run)
    ret_dict = {}
    if run<21:
        roi_dict = {}
        roi_dict['ROIs'] = [ [[1,2], [127,394], [655,923]]] # can define more than one ROI
        roi_dict['writeArea'] = True
        roi_dict['thresADU'] = None
        ret_dict['jungfrau1M'] = roi_dict
    elif run>20 and run<43:
        roi_dict = {}
        roi_dict['ROIs'] = [chip22] # can define more than one ROI
        roi_dict['writeArea'] = True
        roi_dict['thresADU'] = None
        ret_dict['jungfrau1M'] = roi_dict
    elif run>42:
        roi_dict = {}
        roi_dict['ROIs'] = [chip22] # can define more than one ROI
        roi_dict['writeArea'] = True
        roi_dict['thresADU'] = None
        ret_dict['jungfrau1M'] = roi_dict
    return ret_dict


Besides, the ROI definition, the parameters are the following:

writeArea: whether to write the full ROI to file or only the statistics (intensity sum, and other statistics)

thresADU: pixel intensity threshold. Any pixel below that value are set to 0.

Use of SmallDataAna_psana

and extracting information from the average image

to set up the producer's parameters

See the following link to learn how to start an interactive iPython session and make an average image for a given detector:

1.2 Area Detector treatment with DetObject#1.2AreaDetectortreatmentwithDetObject-InteractiveSmallDataAnasession

Once an average image has been created, a ROI can be selected by running:

...