Ejemplo n.º 1
0
    def radialMaxLevel(self, rmin, rmax, Nbin):
        "Compute the maximum (absolute) level for the image and return the array of radius (arcsec) and values"

        dr = (rmax - rmin) / Nbin
        radius = np.arange(Nbin) * dr + rmin
        radMaxLevel = np.zeros(Nbin)

        ## loop over the pixels

        ia.open(self.beamImage)

        for i in range(self.Nx):
            for j in range(self.Ny):
                xx = (i - self.refx) * self.dx
                yy = (j - self.refy) * self.dy
                rr = sqrt(xx * xx + yy * yy)
                indexR = floor((rr - rmin) / dr)

                if indexR >= 0 and indexR < Nbin:
                    val = ia.pixelvalue([i, j])['value']['value']
                    if abs(val) > abs(radMaxLevel[indexR]):
                        radMaxLevel[indexR] = val

        ia.close()

        return (radius, radMaxLevel)
Ejemplo n.º 2
0
 def radialMaxLevel(self,rmin,rmax,Nbin):
     "Compute the maximum (absolute) level for the image and return the array of radius (arcsec) and values"
     
     dr=(rmax-rmin)/Nbin
     radius=np.arange(Nbin)*dr+rmin
     radMaxLevel=np.zeros(Nbin)
    
     
     
     ## loop over the pixels
     
     ia.open(self.beamImage)
     
     for i in range(self.Nx):
         for j in range(self.Ny):
             xx=(i-self.refx)*self.dx
             yy=(j-self.refy)*self.dy
             rr=sqrt(xx*xx+yy*yy)
             indexR=floor((rr-rmin)/dr)
             
             if indexR >=0 and indexR < Nbin:
                 val=ia.pixelvalue([i,j])['value']['value']
                 if abs(val) > abs(radMaxLevel[indexR]):
                     radMaxLevel[indexR]=val
     
     ia.close()
     
     return(radius,radMaxLevel)