Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(41)  |  Call(41)  |  Derive(0)  |  Import(0)

src/e/o/eofs-HEAD/lib/eofs/tests/test_tools.py   eofs(Download)
    def test_covariance_map(self):
        # covariance maps should match reference EOFs as covariance
        pcs = self.solver.pcs(npcs=self.neofs, pcscaling=1)
        cov = self.tools['covariance'](pcs, self.solution['sst'])
        eofs = self._tomasked(self.solver.eofs(neofs=self.neofs))
        reofs = self._tomasked(self.solution['eofs'])
        cov = self._tomasked(cov) * sign_adjustments(eofs, reofs)
    def test_correlation_map(self):
        # correlation maps should match reference EOFs as correlation
        pcs = self.solver.pcs(npcs=self.neofs, pcscaling=1)
        cor = self.tools['correlation'](pcs, self.solution['sst'])
        eofs = self._tomasked(self.solver.eofs(neofs=self.neofs))
        reofs = self._tomasked(self.solution['eofs'])

src/e/o/eofs-HEAD/lib/eofs/tests/test_solution.py   eofs(Download)
    def check_eofs(self, eofscaling):
        # EOFs should match the (possibly scaled) reference solution
        eofs = self._tomasked(self.solver.eofs(neofs=self.neofs,
                                               eofscaling=eofscaling))
        reofs = self._tomasked(self.solution['eofs']).copy()
        eofs *= sign_adjustments(eofs, reofs)
        reigs = self._tomasked(self.solution['eigenvalues'])
    def check_eofs_orthogonal(self, eofscaling):
        # EOFs should be mutually orthogonal
        eofs = self._tomasked(self.solver.eofs(neofs=self.neofs,
                                               eofscaling=eofscaling))
        eofs = eofs.compressed()
    def test_eofsAsCovariance(self):
        # EOFs as covariance between PCs and input field should match the
        # reference solution
        eofs = self._tomasked(self.solver.eofsAsCovariance(neofs=self.neofs,
                                                           pcscaling=1))
        reofs = self._tomasked(self.solution['eofscov'])

src/e/o/eofs-HEAD/lib/eofs/tests/test_multivariate_solution.py   eofs(Download)
                    self.solution['eofs'])
        eofs = [e * sign_adjustments(e, r) for e, r in zip(eofs, reofs)]
        reigs = self._tomasked(self.solution['eigenvalues'])
        if eofscaling == 1:
            reofs = [r / np.sqrt(reigs)[:, np.newaxis, np.newaxis] for r in reofs]
    def check_pcs(self, pcscaling):
        # PCs should match the (possibly scaled) reference solution
        pcs = self._tomasked(self.solver.pcs(npcs=self.neofs,
                                             pcscaling=pcscaling))
        rpcs = self._tomasked(self.solution['pcs']).copy()
        pcs *= sign_adjustments(pcs.transpose(), rpcs.transpose()).transpose()
        reigs = self._tomasked(self.solution['eigenvalues'])
    def check_pcs_uncorrelated(self, pcscaling):
        # PCs should be uncorrelated in time
        pcs = self._tomasked(self.solver.pcs(npcs=self.neofs,
                                             pcscaling=pcscaling))
        correlation = np.corrcoef(pcs.transpose())
    def test_variance(self):
        # variance explained as a percentage should match the reference
        # solution
        variance = self._tomasked(
            self.solver.varianceFraction(neigs=self.neofs)) * 100.