Esempio n. 1
0
 def _srcFct(self, obsLoc, coordinates="cartesian"):
     if getattr(self, '_loop', None) is None:
         self._loop = CircularLoopWholeSpace(mu=self.mu,
                                             location=self.loc,
                                             orientation=self.orientation,
                                             radius=self.radius,
                                             current=self.current)
     return self._loop.vector_potential(obsLoc, coordinates)
Esempio n. 2
0
    def _srcFct(self, obsLoc, coordinates="cartesian"):
        # return MagneticLoopVectorPotential(
        #     self.loc, obsLoc, component, mu=self.mu, radius=self.radius
        # )

        if getattr(self, "_loop", None) is None:
            self._loop = CircularLoopWholeSpace(
                mu=self.mu,
                location=self.loc,
                orientation=self.orientation,
                radius=self.radius,
                current=self.current,
            )
        return self._loop.vector_potential(obsLoc, coordinates)
Esempio n. 3
0
    def test_frequency_loop(self):
        frequencies = np.logspace(-3, 6, 25)
        radius = 50
        hz_total = f_hz_loop(frequencies, sigma=1E-2, radius=radius, secondary=False)
        # test 0 frequency limit
        np.testing.assert_allclose(hz_total[0].real, 1/(2 * radius))

        hz_secondary = f_hz_loop(frequencies, sigma=1E-2, radius=radius)

        h_p = hz_total - hz_secondary
        loop = CircularLoopWholeSpace(radius=radius)
        h_p2 = loop.magnetic_field(np.array([[0, 0, 0]]))[0, 0]
        np.testing.assert_allclose(h_p, h_p2)

        bz_secondary = f_bz_loop(frequencies, sigma=1E-2, radius=radius)
        np.testing.assert_equal(mu_0 * hz_secondary, bz_secondary)