Ejemplo n.º 1
0
 def test_christoffel(self):
     gg = gyoto.Metric('KerrBL')
     tt = gg.christoffel((0, 6, 3.14, 0), 0, 0, 0)
     self.assertAlmostEqual(tt, 0)
     dst = numpy.zeros((4, 4, 4), float)
     gg.christoffel(dst, (0, 6, 3.14, 0))
     self.assertEqual(tt, dst[0, 0, 0])
     dst2 = gg.christoffel((0, 6, 3.14, 0))
     self.assertEqual(tt, dst2[0, 0, 0])
Ejemplo n.º 2
0
 def test_gmunu(self):
     gg = gyoto.Metric('KerrBL')
     tt = gg.gmunu((0, 6, 3.14, 0), 0, 0)
     self.assertAlmostEqual(tt, -0.6666666666666667)
     dst = numpy.zeros((4, 4), float)
     gg.gmunu(dst, (0, 6, 3.14, 0))
     self.assertEqual(tt, dst[0, 0])
     dst2 = gg.gmunu((0, 6, 3.14, 0))
     self.assertEqual(tt, dst2[0, 0])
Ejemplo n.º 3
0
 def test_circularVelocity(self):
     gg = gyoto.Metric('KerrBL')
     vel = numpy.zeros(4, float)
     vel2 = numpy.zeros(4, float)
     pos_list = [0, 6, numpy.pi * 0.5, 0]
     pos_numpy = numpy.asarray(pos_list)
     gg.circularVelocity(pos_numpy, vel)
     gg.circularVelocity(pos_list, vel2)
     vel3 = gg.circularVelocity(pos_list)
     self.assertTrue((vel == vel2).all())
     self.assertTrue((vel == vel3).all())
Ejemplo n.º 4
0
ii = gyoto.Range(1, res, 1)
jj = gyoto.Range(1, res, 1)
grid = gyoto.Grid(ii, jj, "\rj = ")

aop = gyoto.AstrobjProperties()
aop.spectrum = gyoto.array_double.fromnumpy3(spectrum)
aop.offset = res * res

sc.rayTrace(grid, aop)

plt.imshow(spectrum[1, :, :])
plt.show()

# Another Scenery, with impact coords, created from within Python

met = gyoto.Metric("KerrBL")
met.mass(4e6, "sunmass")
ao = gyoto.Astrobj("PageThorneDisk")
ao.metric(met)
ao.opticallyThin(False)
ao.rMax(100)
screen = gyoto.Screen()
screen.distance(8, "kpc")
screen.time(8, "kpc")
screen.resolution(64)
screen.inclination(numpy.pi / 4)
screen.PALN(numpy.pi)
screen.time(8, "kpc")
screen.fieldOfView(100, "µas")
sc = gyoto.Scenery()
sc.metric(met)
Ejemplo n.º 5
0
 def test_isStopCondition(self):
     gg = gyoto.Metric('KerrBL')
     self.assertFalse(gg.isStopCondition((0, 6, 3.14, 0, 0, 0, 0, 0)))
     self.assertTrue(gg.isStopCondition((0, 0, 3.14, 0, 0, 0, 0, 0)))
Ejemplo n.º 6
0
 def test_SysPrimeToTdot(self):
     gg = gyoto.Metric('KerrBL')
     self.assertAlmostEqual(
         gg.SysPrimeToTdot([0, 6, numpy.pi / 2, 0], (0, 0, 0.1)),
         1.8057877962865378)