def test_airgap_induction2(): testPath = os.path.join(os.path.split(__file__)[0], 'data') if len(testPath) == 0: testPath = os.path.join(os.path.abspath('.'), 'data') r = ag.read(os.path.join(testPath, 'bag2.dat')) np.testing.assert_almost_equal(r['Bamp'], 0.9272, 3) assert r['npoles'] == 32 harms = [nue for nue, amp in zip(r['nue'], r['B_nue']) if amp > 1e-2] assert harms == [16, 48, 80, 112, 144, 176, 208, 272]
def test_airgap_induction(): testPath = os.path.join(os.path.split(__file__)[0], 'data') if len(testPath) == 0: testPath = os.path.join(os.path.abspath('.'), 'data') r = ag.read(os.path.join(testPath, 'bag.dat')) np.testing.assert_almost_equal(r['Bamp'], 1.26914, 3) assert r['npoles'] == 8 harms = [nue for nue, amp in zip(r['nue'], r['B_nue']) if amp > 1e-2] assert harms == [4, 12, 20, 28, 36, 44, 52, 60, 68]
def test_airgap_induction(): testPath = os.path.join(os.path.split(__file__)[0], 'data') if len(testPath) == 0: testPath = os.path.join(os.path.abspath('.'), 'data') r = ag.read(os.path.join(testPath, 'bag.dat')) np.testing.assert_almost_equal(r['Bamp'], 1.271, 3)
def read_airgap_induction(self): """read airgap induction""" return ag.read(os.path.join(self.workdir, 'bag.dat'))
def read_airgap_induction(self, modelname='', offset=0): """read airgap induction""" # we need to figure out the number of poles in model bch = self.read_bch(modelname, offset) return ag.read(os.path.join(self.workdir, 'bag.dat'), bch.machine['p_sim'])