# Camera lens properties camFocalLength = 10 camSensorShape = (900, 1600) # (Rows, Columns) camSensorSize = (9, 16) # (Height, Width) # Set black hole spin universe.spin = .0000000000000001 universe.accretionDisk.innerRadius = 2 universe.accretionDisk.outerRadius = 1 # Create a camera camera = Camera(camR, camTheta, camPhi, camFocalLength, camSensorShape, camSensorSize) sphere = "../../Data/Textures/milkyWay.png" disk = "../../Data/Textures/adisk.png" suffix = 0 amp = 1 suffix = 0 amp = 1 for angle in np.arange(0, 2*np.pi, 0.05): suffix += 1 camera.phi = angle texturedImage, _ = camera.shoot(diskPath=disk, spherePath=sphere) texturedImage.save("pruebita" + "%03d" % suffix + ".png")
# plot3D.plot() # # disk = '../../Data/Textures/patchdisk.png' # sphere = '../../Data/Textures/milkyWay.png' # camera1.sensorShape = (3000, 3000) # texturedImage, _ = camera1.shoot(diskPath=disk, spherePath=sphere) # texturedImage.plot() # # Plot only one geodesic, indexing it with the pixel row,col # plot3D.geodesic(2, 4).plot() # # You can even plot a snapshot, which may be not that interesting, though... # plot3D.snapshot(1).plot() # # # Make a proper photography! camera2.yaw = -0.06 photo, _ = camera2.shoot() photo.plot() # # # Load the textures # disk = '../../Data/Textures/adisk.png' # sphere = '../../Data/Textures/milkyWay.png' # texturedImage, _ = camera2.shoot(diskPath=disk, spherePath=sphere) # texturedImage.plot() # suffix = 0 # # for pitch in np.arange(-np.pi/2, np.pi/2, 0.05): # suffix += 1 # camera2.pitch = pitch
# Create a camera camera = Camera(camR, camTheta, camPhi, camFocalLength, camSensorShape, camSensorSize) if len(sys.argv) < 5: print("Usage: python benchmarkGPU.py outputPath minSide maxSide step") sys.exit() # Benchmark parameters outputPath = sys.argv[1] start = int(sys.argv[2]) stop = int(sys.argv[3]) step = int(sys.argv[4]) output = open(outputPath, 'w') # Print CSV header print("Number of pixels, GPU time", file=output) # Run the benchmark! for side in range(start, stop, step): # Change the camera sensor camera.sensorShape = (side, side) # (Rows, Columns) _, time = camera.shoot(finalTime=-150) # Print results both to the CSV file and to the standard output currentData = "{}, {:.10f}".format(side*side, time) print(currentData, file=output)
# Camera position camR = 20 camTheta = 1.511 camPhi = 0 # Camera lens properties camFocalLength = 5 camSensorShape = (900, 1600) # (Rows, Columns) camSensorSize = (9, 16) # (Height, Width) # Set black hole spin universe.spin = .0000001 universe.accretionDisk.innerRadius = 8 universe.accretionDisk.outerRadius = 7 # Create a camera camera = Camera(camR, camTheta, camPhi, camFocalLength, camSensorShape, camSensorSize) sphere = "../../Data/Textures/milkyWay.png" disk = "../../Data/Textures/adisk.png" suffix = 0 amp = 1 camera.speed = 0 texturedImage, _ = camera.shoot() texturedImage.plot() texturedImage.save("complete00.png")