Versions Compared

Key

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

...

Cloak
iddelayscan
  • Fetching the ControlPV information:
    ControlPV is available from the env object, and since it only changes at the beginning
    of each calibration cycle, the begincalibcycle function is the appropriate place to get it:
    none
    The ControlConfig object may contain several pvControl and pvMonitor objects. In this case
    there's only one, but make sure the name matches anyway: none
  • Fetching the IPIMB and PhaseCavity information:
    All the other information that we need, is available through the evt object, and
    event member function is the place to get it:
    none
    Use "XppSb3Ipm-1|Ipimb-0" (a.k.a. IPM3) sum of all channels for normalization and filtering
    none
    Use "XppSb3Pim-1|Ipimb-0" (a.k.a. PIM3) channel 1 as signal
    none
    Get the phase cavity:
    none
    Compute delay time and fill histograms
    none

Image peak finding

Here are a collection of useful algorithms for image analysis: http://docs.scipy.org/doc/scipy/reference/ndimage.html

...

To get a rough picture of the full detector, here's an example of how XtcExplorer/src/cspad.py does it:

  • For each Quadrant (cspad_layout.txt):
    Code Block
    none
    none
        def get_quad_image( self, data3d, qn) :
            """get_quad_image
            Get an image for this quad (qn)
    
            @param data3d           3d data array (row vs. col vs. section)
            @param qn               quad number
            """
            # Construct one image for each quadrant, each with 8 sections
            # from a data3d = 3 x 2*194 x 185 data array
            #   +---+---+-------+
            #   |   |   |   6   |
            #   + 5 | 4 +-------+
            #   |   |   |   7   |
            #   +---+---+---+---+
            #   |   2   |   |   |
            #   +-------+ 0 | 1 |
            #   |   3   |   |   |
            #   +-------+---+---+
            #
            # each section read from the event has "landscape" orientation
            # with 185 rows (first index) and 2*194 columns (2nd index)
            #   - Sections 0,1: "portrait" orientation / tilted 90 degrees counter clockwise:
            #                    first index increases from left to right, 2nd index increases from bottom to top, 
            #   - Sections 2,3: "landscape" orientation / as is:
            #                    first index increases from top to bottom, 2nd index increases from left to right
            #   - Sections 4,5: "portrait" orientation / tilted 90 degrees clockwise:
            #                    first index increases from right to left, 2nd index increases from top to bottom, 
            #   - Sections 6,7: "landscape" orientation / as is:
            #                    first index increases from top to bottom, 2nd index increases from left to right
            #   Again, the orientations of the Sections for quadrant 1 are rotated 90 degrees clockwise
        
            pairs = []
            for i in range (8) :
            
                # 1) insert gap between asics in the 2x1
                asics = np.hsplit( data3d[i], 2)
                gap = np.zeros( (185,3), dtype=data3d.dtype )
                #
                # gap should be 3 pixels wide
                pair = np.hstack( (asics[0], gap, asics[1]) )
    
                # all sections are originally 185 (rows) x 388 (columns) 
                # Re-orient each section in the quad
    
                if i==0 or i==1 :
                    pair = pair[:,::-1].T   # reverse columns, switch columns to rows. 
                if i==4 or i==5 :
                    pair = pair[::-1,:].T   # reverse rows, switch rows to columns
                pairs.append( pair )
    
                if self.small_angle_tilt :
                    pair = scipy.ndimage.interpolation.rotate(pair,self.tilt_array[qn][i])
    
            # make the array for this quadrant
            quadrant = np.zeros( (self.npix_quad, self.npix_quad), dtype=data3d.dtype )
    
            # insert the 2x1 sections according to
            for sec in range (8):
                nrows, ncols = pairs[sec].shape
    
                # colp,rowp are where the top-left corner of a section should be placed
                rowp = self.npix_quad - self.sec_offset[0] - (self.section_centers[0][qn][sec] + nrows/2)
                colp = self.npix_quad - self.sec_offset[1] - (self.section_centers[1][qn][sec] + ncols/2)
                
                quadrant[rowp:rowp+nrows, colp:colp+ncols] = pairs[sec][0:nrows,0:ncols]
                if (rowp+nrows > self.npix_quad) or (colp+ncols > self.npix_quad) :
                    print "ERROR"
                    print rowp, ":", rowp+nrows, ", ", colp, ":",colp+ncols
    
            return quadrant
    

...