Ejemplo n.º 1
0
 def test_ampls(self):
     """
     Test calculating amplitudes
     """
     obj = PAZ.from_refgain(1500.,
                            poles=[6.228 + 6.228j, 6.228 - 6.228j],
                            zeros=[0, 0],
                            ref_freq=1.,
                            input_units='m/s',
                            output_units='counts')
     obj_nm = PAZ.from_refgain(9.42e-6,
                               poles=[6.228 + 6.228j, 6.228 - 6.228j],
                               zeros=[0, 0, 0],
                               ref_freq=1.,
                               input_units='nm',
                               output_units='counts')
     self.assertNotEqual(obj, obj_nm)
     self.assertAlmostEqual(obj.norm_factor, 2.205, places=3)
     obj.input_units = 'nm'
     self.assertAlmostEqual(obj.calc_norm_factor(), 0.3509, places=3)
     self.assertEqual(obj, obj_nm)
Ejemplo n.º 2
0
 def test_norm_factor(self):
     """
     Test calculating norm_factor
     """
     obja = PAZ.from_refgain(1500.,
                             poles=[6.228 + 6.228j, 6.228 - 6.228j],
                             zeros=[0, 0],
                             ref_freq=1.,
                             input_units='m/s',
                             output_units='counts')
     self.assertAlmostEqual(obja.norm_factor, 2.205, places=3)
     obja.input_units = 'nm'
     self.assertAlmostEqual(obja.calc_norm_factor(), 0.3509, places=3)