6e92fe2e535fcd1d9fa8f0e0ea080047c5a73067,acoular/fbeamform.py,PointSpreadFunction,_get_psf,#PointSpreadFunction#,1015

Before Change


        precisionTuple = _precision(self.precision)
        
        // check wether self.freq is part of SteeringVector.f
        freqInSteerObjFreq = isclose(array(self._steer_obj.f), self.freq)
        if freqInSteerObjFreq.any():
            freqInd = flatnonzero(freqInSteerObjFreq)[0]
        else:
            warn("PointSpreadFunction.freq (%s Hz) was appended to PointSpreadFunction._steer_obj.f, "\
                 "as it was not an element of the original list!" % self.freq, Warning, stacklevel = 2)
            self._steer_obj.f.append(self.freq)
            freqInd = int(-1)
        
        // get the cached data, or, if non-existing, create new structure
        if not fr in self.h5f.root:
            if self.calcmode == "readonly":
                raise ValueError("Cannot calculate missing PSF (freq %s) in \"readonly\" mode." % fr)
            
            group = self.h5f.create_group(self.h5f.root, fr) 
            shape = (gs, gs)
            atom = precisionTuple[3]()
            filters = tables.Filters(complevel=5, complib="blosc")
            ac = self.h5f.create_carray(group, "result", atom, shape, filters=filters)
            shape = (gs,)
            atom = tables.BoolAtom()
            gp = self.h5f.create_carray(group, "gridpts", atom, shape, filters=filters)
            
        else:
            ac = self.h5f.get_node("/"+fr, "result")
            gp = self.h5f.get_node("/"+fr, "gridpts")
        
        // are there grid points for which the PSF hasn"t been calculated yet?
        if not gp[:][self.grid_indices].all():

            if self.calcmode == "readonly":
                raise ValueError("Cannot calculate missing PSF (points) in \"readonly\" mode.")

            elif self.calcmode != "full":
                // calc_ind has the form [True, True, False, True], except
                // when it has only 1 entry (value True/1 would be ambiguous)
                if self.grid_indices.size == 1:
                    calc_ind = [0]
                else:
                    calc_ind = invert(gp[:][self.grid_indices])
                
                // get indices which have the value True = not yet calculated
                g_ind_calc = self.grid_indices[calc_ind]
            if self.calcmode == "single":
                for ind in g_ind_calc:
                    ac[:,ind] = self._steer_obj._psfCall(freqInd, [ind], self.precision)[0,:,0]
                    gp[ind] = True
            elif self.calcmode == "full":
                gp[:] = True
                ac[:] = self._steer_obj._psfCall(freqInd, arange(self._steer_obj.grid.size), self.precision)[0,:,:]
            else: // "block"
                hh = self._steer_obj._psfCall(freqInd, g_ind_calc, self.precision)
                indh = 0

After Change


                    gp[ind] = True
            elif self.calcmode == "full": // calculate all psfs in one go
                gp[:] = True
                ac[:] = self._psfCall(arange(gs))
            else: // "block" // calculate selected psfs in one go
                hh = self._psfCall(g_ind_calc)
                indh = 0
                for ind in g_ind_calc:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: acoular/acoular
Commit Name: 6e92fe2e535fcd1d9fa8f0e0ea080047c5a73067
Time: 2018-12-18
Author: gejohe@web.de
File Name: acoular/fbeamform.py
Class Name: PointSpreadFunction
Method Name: _get_psf


Project Name: acoular/acoular
Commit Name: 4b8dec5e7199ad302c52bf9eb6914a170491334c
Time: 2018-05-03
Author: tom.j.gensch@campus.tu-berlin.de
File Name: acoular/fbeamform.py
Class Name: PointSpreadFunction
Method Name: _get_psf


Project Name: acoular/acoular
Commit Name: 276f8fc3fe9a7424bae6585ed4453190e2a70815
Time: 2018-05-02
Author: tom.j.gensch@campus.tu-berlin.de
File Name: acoular/fbeamform.py
Class Name: PointSpreadFunction
Method Name: _get_psf