# Path: concert/quantities.py

# 
# Path: concert/devices/cameras/dummy.py
# class Base(base.Camera):
# 
#     exposure_time = Quantity(q.s)
#     sensor_pixel_width = Quantity(q.micrometer)
#     sensor_pixel_height = Quantity(q.micrometer)
#     roi_x0 = Quantity(q.pixel)
#     roi_y0 = Quantity(q.pixel)
#     roi_width = Quantity(q.pixel)
#     roi_height = Quantity(q.pixel)
# 
#     def __init__(self):
#         super(Base, self).__init__()
#         self._frame_rate = 1000 / q.s
#         self._trigger_source = self.trigger_sources.AUTO
#         self._exposure_time = 1 * q.ms
#         self._roi_x0 = 0 * q.pixel
#         self._roi_y0 = 0 * q.pixel
#         self._roi_width = 640 * q.pixel
#         self._roi_height = 480 * q.pixel
# 
#     async def _get_sensor_pixel_width(self):
#         return 5 * q.micrometer
# 
#     async def _get_sensor_pixel_height(self):
#         return 5 * q.micrometer
# 
#     async def _get_roi_x0(self):
#         return self._roi_x0
# 
#     async def _set_roi_x0(self, x0):
#         self._roi_x0 = x0
# 
#     async def _get_roi_y0(self):
#         return self._roi_y0
# 
#     async def _set_roi_y0(self, y0):
#         self._roi_y0 = y0
# 
#     async def _get_roi_width(self):
#         return self._roi_width
# 
#     async def _set_roi_width(self, roi):
#         self._roi_width = roi
# 
#     async def _get_roi_height(self):
#         return self._roi_height
# 
#     async def _set_roi_height(self, roi):
#         self._roi_height = roi
# 
#     async def _get_exposure_time(self):
#         return self._exposure_time
# 
#     async def _set_exposure_time(self, value):
#         self._exposure_time = value
# 
#     async def _get_frame_rate(self):
#         return self._frame_rate
# 
#     async def _set_frame_rate(self, frame_rate):
#         self._frame_rate = frame_rate
# 
#     async def _get_trigger_source(self):
#         return self._trigger_source
# 
#     async def _set_trigger_source(self, source):
#         self._trigger_source = source
# 
#     @transition(target='recording')
#     async def _record_real(self):
#         pass
# 
#     @transition(target='standby')
#     async def _stop_real(self):
#         pass
# 
#     async def _trigger_real(self):
#         pass


import numpy as np
from concert.quantities import q
from concert.devices.cameras.dummy import Base as DummyBaseCamera
    """3D translation."""
    matrix[0, -1] += vec[0]
    matrix[1, -1] += vec[1]
    matrix[2, -1] += vec[2]

    return matrix


def sphere(size, radius, mat):
    """Create a sphere with radius *radius* in an image with size *size* and
    use transformation matrix *mat* to adjust the sphere position and size.
    """
    y_0, x_0 = np.mgrid[-size // 2:size // 2, -size // 2:size // 2][:, ::-1]

    k_x = x_0 * mat[0, 0] + y_0 * mat[0, 1] + mat[0, 3]
    k_y = x_0 * mat[1, 0] + y_0 * mat[1, 1] + mat[1, 3]
    k_z = x_0 * mat[2, 0] + y_0 * mat[2, 1] + mat[2, 3]

    quadr_coeffs = mat[0, 2] ** 2 + mat[1, 2] ** 2 + mat[2, 2] ** 2, \
        2 * k_x * mat[0, 2] + 2 * k_y * mat[1, 2] + 2 * k_z * mat[2, 2], \
        k_x ** 2 + k_y ** 2 + k_z ** 2 - radius ** 2

    thickness = quadr_coeffs[1] ** 2 - 4 * quadr_coeffs[0] * quadr_coeffs[2]
    thickness[thickness < 0] = 0

    return np.abs(np.sqrt(thickness) / quadr_coeffs[0])


def transfer(thickness, ref_index, lam):
    lam = lam.to(thickness.units)

# Path: concert/quantities.py

# 
# Path: concert/devices/cameras/dummy.py
# class Base(base.Camera):
# 
#     exposure_time = Quantity(q.s)
#     sensor_pixel_width = Quantity(q.micrometer)
#     sensor_pixel_height = Quantity(q.micrometer)
#     roi_x0 = Quantity(q.pixel)
#     roi_y0 = Quantity(q.pixel)
#     roi_width = Quantity(q.pixel)
#     roi_height = Quantity(q.pixel)
# 
#     def __init__(self):
#         super(Base, self).__init__()
#         self._frame_rate = 1000 / q.s
#         self._trigger_source = self.trigger_sources.AUTO
#         self._exposure_time = 1 * q.ms
#         self._roi_x0 = 0 * q.pixel
#         self._roi_y0 = 0 * q.pixel
#         self._roi_width = 640 * q.pixel
#         self._roi_height = 480 * q.pixel
# 
#     async def _get_sensor_pixel_width(self):
#         return 5 * q.micrometer
# 
#     async def _get_sensor_pixel_height(self):
#         return 5 * q.micrometer
# 
#     async def _get_roi_x0(self):
#         return self._roi_x0
# 
#     async def _set_roi_x0(self, x0):
#         self._roi_x0 = x0
# 
#     async def _get_roi_y0(self):
#         return self._roi_y0
# 
#     async def _set_roi_y0(self, y0):
#         self._roi_y0 = y0
# 
#     async def _get_roi_width(self):
#         return self._roi_width
# 
#     async def _set_roi_width(self, roi):
#         self._roi_width = roi
# 
#     async def _get_roi_height(self):
#         return self._roi_height
# 
#     async def _set_roi_height(self, roi):
#         self._roi_height = roi
# 
#     async def _get_exposure_time(self):
#         return self._exposure_time
# 
#     async def _set_exposure_time(self, value):
#         self._exposure_time = value
# 
#     async def _get_frame_rate(self):
#         return self._frame_rate
# 
#     async def _set_frame_rate(self, frame_rate):
#         self._frame_rate = frame_rate
# 
#     async def _get_trigger_source(self):
#         return self._trigger_source
# 
#     async def _set_trigger_source(self, source):
#         self._trigger_source = source
# 
#     @transition(target='recording')
#     async def _record_real(self):
#         pass
# 
#     @transition(target='standby')
#     async def _stop_real(self):
#         pass
# 
#     async def _trigger_real(self):
#         pass


# Path: concert/tests/util/rotationaxis.py
import numpy as np
from concert.quantities import q
from concert.devices.cameras.dummy import Base as DummyBaseCamera

    """3D translation."""
    matrix[0, -1] += vec[0]
    matrix[1, -1] += vec[1]
    matrix[2, -1] += vec[2]

    return matrix


def sphere(size, radius, mat):
    """Create a sphere with radius *radius* in an image with size *size* and
    use transformation matrix *mat* to adjust the sphere position and size.
    """
    y_0, x_0 = np.mgrid[-size // 2:size // 2, -size // 2:size // 2][:, ::-1]

    k_x = x_0 * mat[0, 0] + y_0 * mat[0, 1] + mat[0, 3]
    k_y = x_0 * mat[1, 0] + y_0 * mat[1, 1] + mat[1, 3]
    k_z = x_0 * mat[2, 0] + y_0 * mat[2, 1] + mat[2, 3]

    quadr_coeffs = mat[0, 2] ** 2 + mat[1, 2] ** 2 + mat[2, 2] ** 2, \
        2 * k_x * mat[0, 2] + 2 * k_y * mat[1, 2] + 2 * k_z * mat[2, 2], \
        k_x ** 2 + k_y ** 2 + k_z ** 2 - radius ** 2

    thickness = quadr_coeffs[1] ** 2 - 4 * quadr_coeffs[0] * quadr_coeffs[2]
    thickness[thickness < 0] = 0

    return np.abs(np.sqrt(thickness) / quadr_coeffs[0])


def transfer(thickness, ref_index, lam):
    lam = lam.to(thickness.units)

    mju = 4 * q.dimensionless * np.pi * ref_index.imag / lam