예제 #1
0
    def __init__(self, filename):

        with open(path.join(path.dirname(__file__), "data", filename + ".json")) as f:
            data = json.load(f)

        wavelength = array(data['wavelength'])
        index = InterpolatedSF(wavelength, array(data['index']))
        extinction = InterpolatedSF(wavelength, array(data['extinction']))

        super().__init__(index, extinction)
예제 #2
0
from matplotlib.pyplot import *
from numpy import array

from raysect.primitive import Sphere, Box, Cylinder, Union, Intersect, Subtract

from raysect.optical import World, translate, rotate, Point3D, d65_white, InterpolatedSF
from raysect.optical.observer import OrthographicCamera
from raysect.optical.material.emitter import UniformSurfaceEmitter, Checkerboard
from raysect.optical.material.dielectric import Dielectric, Sellmeier
from raysect.optical.library import schott

red_glass = Dielectric(
    index=Sellmeier(1.03961212, 0.231792344, 1.01046945, 6.00069867e-3,
                    2.00179144e-2, 1.03560653e2),
    transmission=InterpolatedSF([300, 490, 510, 590, 610, 800],
                                array([0.0, 0.0, 0.0, 0.0, 1.0, 1.0]) * 0.7))

green_glass = Dielectric(
    index=Sellmeier(1.03961212, 0.231792344, 1.01046945, 6.00069867e-3,
                    2.00179144e-2, 1.03560653e2),
    transmission=InterpolatedSF([300, 490, 510, 590, 610, 800],
                                array([0.0, 0.0, 1.0, 1.0, 0.0, 0.0]) * 0.7))

blue_glass = Dielectric(
    index=Sellmeier(1.03961212, 0.231792344, 1.01046945, 6.00069867e-3,
                    2.00179144e-2, 1.03560653e2),
    transmission=InterpolatedSF([300, 490, 510, 590, 610, 800],
                                array([1.0, 1.0, 0.0, 0.0, 0.0, 0.0]) * 0.7))

world = World()
예제 #3
0
from raysect.optical.observer import PinholeCamera
from raysect.optical.material.emitter import UniformSurfaceEmitter
from raysect.optical.material.dielectric import Dielectric

world = World()

wavelengths = array([300, 490, 510, 590, 610, 800])
red_attn = array([0.0, 0.0, 0.0, 0.0, 1.0, 1.0]) * 0.98
green_attn = array([0.0, 0.0, 1.0, 1.0, 0.0, 0.0]) * 0.85
blue_attn = array([1.0, 1.0, 0.0, 0.0, 0.0, 0.0]) * 0.98
yellow_attn = array([0.0, 0.0, 1.0, 1.0, 1.0, 1.0]) * 0.85
cyan_attn = array([1.0, 1.0, 1.0, 1.0, 0.0, 0.0]) * 0.85
purple_attn = array([1.0, 1.0, 0.0, 0.0, 1.0, 1.0]) * 0.95

red_glass = Dielectric(index=ConstantSF(1.4),
                       transmission=InterpolatedSF(wavelengths, red_attn))
green_glass = Dielectric(index=ConstantSF(1.4),
                         transmission=InterpolatedSF(wavelengths, green_attn))
blue_glass = Dielectric(index=ConstantSF(1.4),
                        transmission=InterpolatedSF(wavelengths, blue_attn))
yellow_glass = Dielectric(index=ConstantSF(1.4),
                          transmission=InterpolatedSF(wavelengths,
                                                      yellow_attn))
cyan_glass = Dielectric(index=ConstantSF(1.4),
                        transmission=InterpolatedSF(wavelengths, cyan_attn))
purple_glass = Dielectric(index=ConstantSF(1.4),
                          transmission=InterpolatedSF(wavelengths,
                                                      purple_attn))

Sphere(1000, world, material=UniformSurfaceEmitter(d65_white, 1.0))