Esempio n. 1
0
camR = 12
camTheta = 1.511
camPhi = 0

# 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
Esempio n. 2
0
# Camera position
camR = 10
camTheta = np.pi/2
camPhi = 0

# Camera lens properties
camFocalLength = 1
camSensorShape = (4, 10)  # (Rows, Columns)
camSensorSize = (1, 1)   # (Height, Width)

# Set black hole spin
universe.spin = .9999
universe.accretionDisk.innerRadius = 8
universe.accretionDisk.outerRadius = 18

# 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.slicedShoot(slicesNum=50000)
texturedImage.plot()
camTheta = np.pi/2
camPhi = 0

# Camera lens properties
camFocalLength = 5
camSensorShape = (900, 1600)  # (Rows, Columns)
camSensorSize = (9, 16)   # (Height, Width)

# Set black hole spin
universe.spin = .9999

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

for distance in np.arange(40, universe.horizonRadius, -0.5):
    suffix += 1

    camera.r = distance

    texturedImage, _ = camera.shoot(diskPath=disk, spherePath=sphere)
    texturedImage.save("pruebita" + "%03d" % suffix + ".png")
Esempio n. 4
0
    camR = 40
    camTheta = 1.511
    camPhi = 0

    # Camera lens properties
    camFocalLength = 3
    camSensorSize = (2, 2)       # (Height, Width)
    camSensorShape = (1000, 1000)  # (Rows, Columns)

    # Set black hole spin
    universe.spin = .999
    universe.accretionDisk.innerRadius = 9
    universe.accretionDisk.outerRadius = 20

    # 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)
# Camera position
camR = 40
camTheta = 0.705493850862
camPhi = 0

# Camera lens properties
camFocalLength = 10
camSensorShape = (900, 1600)  # (Rows, Columns)
camSensorSize = (9, 16)   # (Height, Width)

# Set black hole spin
universe.spin = .999

# 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

for angle in np.arange(0, 2 * np.pi, 0.05):
    suffix += 1

    camera.phi = angle
    camera.theta = (np.sin(angle)/2 + 0.5) * (np.pi - 2 * amp) + amp

    print(camera.phi, camera.theta)
Esempio n. 6
0
# Camera lens properties
camFocalLength = 20
camSensorShape = (10, 10)  # (Rows, Columns)
camSensorSize = (6, 6)   # (Height, Width)

# Set black hole spin
universe.spin = .999
universe.accretionDisk.innerRadius = 7
universe.accretionDisk.outerRadius = 20
# Create a camera
camera1 = Camera(camR, camTheta, camPhi, camFocalLength, camSensorShape,
                 camSensorSize)

# Create another camera
camera2 = Camera(camR, camTheta, camPhi, camFocalLength, (4000, 4000),
                 camSensorSize)

# # Make an sliced shoot; i.e., store all the intermediate steps in order to
# # plot a 3D scene
# plot3D = camera1.slicedShoot(finalTime=-60, slicesNum=10000)
# 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...
Esempio n. 7
0
# 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")
Esempio n. 8
0
import numpy as np
import sys
sys.path.append('../')

from Raytracer import universe, Camera

# Camera position
camR = 40
camTheta = 0.705493850862
camPhi = 0

# Camera lens properties
camFocalLength = 10
camSensorShape = (1, 1)  # (Rows, Columns)
camSensorSize = (1, 1)   # (Height, Width)

# Set black hole spin
universe.spin = .999

# Create a camera
camera = Camera(camR, camTheta, camPhi, camFocalLength, camSensorShape,
                camSensorSize)

camera.slicedShoot().plot()
# Camera position
camR = 40
camTheta = 1.7
camPhi = 0

# Camera lens properties
camFocalLength = 5
camSensorShape = (900, 1600)  # (Rows, Columns)
camSensorSize = (9, 16)   # (Height, Width)

# Set black hole spin
universe.spin = .999

# 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

for angle in np.arange(0, np.pi, 0.05):
    suffix += 1

    camera.phi = angle
    camera.yaw = -angle / 2
    camera.r = 45 - 38*(angle / (np.pi))

    print(camera.phi, camera.theta)
Esempio n. 10
0
camR = 12
camTheta = 1.511
camPhi = 0

# 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(-np.pi+0.1, np.pi-0.1, 0.1):
    suffix += 1

    camera.theta = angle
    camera.speed = 0