Beispiel #1
0
 def test_Lbol(self):
     expected = luminosity.calc_Fbol(self.color_value, self.color_err,
                                       self.color_type,
                                       self.v_magnitude,
                                       self.v_magnitude_err)[0] \
                * luminosity.calc_4piDsquared(self.distance,
                                            self.distance_err)[0]
     result = luminosity.calc_Lbol(self.color_value, self.color_err,
                                   self.color_type, self.v_magnitude,
                                   self.v_magnitude_err, self.distance,
                                   self.distance_err)[0]
     self.assertAlmostEqual(expected, result)
Beispiel #2
0
 def test_Lbol(self):
     expected = luminosity.calc_Fbol(self.color_value, self.color_err, 
                                       self.color_type,
                                       self.v_magnitude,
                                       self.v_magnitude_err)[0] \
                * luminosity.calc_4piDsquared(self.distance, 
                                            self.distance_err)[0]
     result = luminosity.calc_Lbol(self.color_value, self.color_err,
                                       self.color_type,
                                       self.v_magnitude, 
                                       self.v_magnitude_err,
                                       self.distance,
                                       self.distance_err)[0]
     self.assertAlmostEqual(expected, result)
Beispiel #3
0
    def test_Lbol_uncertainty(self):
        Fbol, Fbol_err = luminosity.calc_Fbol(self.color_value, self.color_err,
                                              self.color_type,
                                              self.v_magnitude,
                                              self.v_magnitude_err)
        dist, dist_err = luminosity.calc_4piDsquared(self.distance,
                                                     self.distance_err)

        expected = math.sqrt((dist * Fbol_err)**2 + (Fbol * dist_err)**2)
        result = luminosity.calc_Lbol(self.color_value, self.color_err,
                                      self.color_type, self.v_magnitude,
                                      self.v_magnitude_err, self.distance,
                                      self.distance_err)[1]
        self.assertEqual(expected, result)
Beispiel #4
0
    def test_Lbol_uncertainty(self):
        Fbol, Fbol_err = luminosity.calc_Fbol(self.color_value, 
                                              self.color_err, 
                                              self.color_type,
                                              self.v_magnitude,
                                              self.v_magnitude_err)
        dist, dist_err = luminosity.calc_4piDsquared(self.distance,
                                                 self.distance_err)


        expected = math.sqrt((dist * Fbol_err)**2 + (Fbol * dist_err)**2)
        result = luminosity.calc_Lbol(self.color_value, self.color_err,
                                          self.color_type,
                                          self.v_magnitude, 
                                          self.v_magnitude_err,
                                          self.distance,
                                          self.distance_err)[1]
        self.assertEqual(expected, result)
Beispiel #5
0
 def test_4piDsquared_uncertainty(self):
     expected = 8.0 * math.pi * self.distance * self.distance_err
     result = luminosity.calc_4piDsquared(self.distance,
                                              self.distance_err)[1]
     self.assertAlmostEqual(expected, result)
Beispiel #6
0
 def test_4piDsquared_calculation(self):
     expected = 4.0 * math.pi * self.distance**2.0
     result = luminosity.calc_4piDsquared(self.distance, 
                                              self.distance_err)[0]
     self.assertEqual(expected, result)
Beispiel #7
0
 def test_4piDsquared_uncertainty(self):
     expected = 8.0 * math.pi * self.distance * self.distance_err
     result = luminosity.calc_4piDsquared(self.distance,
                                          self.distance_err)[1]
     self.assertAlmostEqual(expected, result)
Beispiel #8
0
 def test_4piDsquared_calculation(self):
     expected = 4.0 * math.pi * self.distance**2.0
     result = luminosity.calc_4piDsquared(self.distance,
                                          self.distance_err)[0]
     self.assertEqual(expected, result)