def sanity_gyroAgeBarnes(self):
     """
   Check Gyro age of Barnes 2007
 """
     # Eq 17, 18 (B-V, period, relative error)
     dat = [[0.5, 7, 20], [0.65, 12, 15], [1.0, 20, 13], [1.5, 30, 13]]
     for d in dat:
         a, e = pyasl.gyroAgeBarnes(d[1], d[0])
         self.assertAlmostEqual(e/a*100., d[2], delta=1.0, \
                                msg="Relative errors of Barnes 2007 cannot be reproduced.")
Example #2
0
 def sanity_gyroAgeBarnes(self):
   """
     Check Gyro age of Barnes 2007
   """
   # Eq 17, 18 (B-V, period, relative error)
   dat = [[0.5, 7, 20], [0.65, 12, 15], [1.0, 20, 13], [1.5, 30, 13]]
   for d in dat:
     a, e = pyasl.gyroAgeBarnes(d[1], d[0])
     self.assertAlmostEqual(e/a*100., d[2], delta=1.0, \
                            msg="Relative errors of Barnes 2007 cannot be reproduced.")
Example #3
0
    def sanity_sanity_gyroAgeBarnesExample(self):
        """
        Example gyro age (Barnes 2007)
        """
        from PyAstronomy import pyasl

        # Parameters of the Sun (Barnes 2007, p 1174)
        bv = 0.642
        p = 26.09

        # Obtain solar age ...
        age = pyasl.gyroAgeBarnes(p, bv)
        # ... and print it
        print("Solar age: {0:4.2f} +/- {1:4.2f} Ga".format(*age))
Example #4
0
 def sanity_sanity_gyroAgeBarnesExample(self):
   """
     Example gyro age (Barnes 2007)
   """
   from PyAstronomy import pyasl
 
   # Parameters of the Sun (Barnes 2007, p 1174)
   bv = 0.642
   p = 26.09
   
   # Obtain solar age ...
   age = pyasl.gyroAgeBarnes(p, bv)
   # ... and print it
   print "Solar age: {0:4.2f} +/- {1:4.2f} Ga".format(*age)