Scene model (ryscene)

The module provides scene-related models and information

Overview

Download the latest version of Christoph Gohlke’s transformation Python code: (look for the latest version for your version of Python) from http://www.lfd.uci.edu/~gohlke/pythonlibs/

Install the transformations wheel to your Python environment by doing a wheel install.

If you are running Python in an environment, first activate the environment then run the wheel install command.

You can either download the latest version of Gholke’s transformation library or use the one supplied in this directory.

Open a command window in the directory that contains the transformations wheel and execute the command (or whatever the whl filename is)::

wheel install transformations-2015.7.18-cp27-none-win_amd64.whl  
wheel install transformations-2017.2.17-cp35-cp35m-win_amd64.whl  
wheel install transformations-2015.7.18-cp27-none-win_amd64.whl  

From transformations.py:

This module follows the “column vectors on the right” and “row major storage” (C contiguous) conventions. The translation components are in the right column of the transformation matrix, i.e. M[:3, 3]. The transpose of the transformation matrices may have to be used to interface with other graphics systems, e.g. with OpenGL’s glMultMatrixd().

Calculations are carried out with numpy.float64 precision.

Vector, point, quaternion, and matrix function arguments are expected to be “array like”, i.e. tuple, list, or numpy arrays.

Return types are numpy arrays unless specified otherwise.

Angles are in radians unless specified otherwise.

Quaternions w+ix+jy+kz are represented as [w, x, y, z].

See also http://matthew-brett.github.io/transforms3d/reference/transforms3d.euler.html#direction-of-rotation which explains as follows:

You specify conventions for interpreting the sequence of Euler angles with a four character string.

The first character is ‘r’ (rotating == intrinsic), or ‘s’ (static == extrinsic).

The next three characters give the axis (‘x’, ‘y’ or ‘z’) about which to perform the rotation, in the order in which the rotations will be performed.

For example the string ‘szyx’ specifies that the angles should be interpreted relative to extrinsic (static) coordinate axes, and be performed in the order: rotation about z axis; rotation about y axis; rotation about x axis. This is a relatively common convention, with customized implementations in taitbryan in this package.

The string ‘rzxz’ specifies that the angles should be interpreted relative to intrinsic (rotating) coordinate axes, and be performed in the order: rotation about z axis; rotation about the rotated x axis; rotation about the rotated z axis. Wolfram Mathworld claim this is the most common convention : http://mathworld.wolfram.com/EulerAngles.html.

Provides a simple, order of magnitude estimate of the photon flux and electron count in a detector for various sources and scene lighting. All models are based on published information or derived herein, so you can check their relevancy and suitability for your work.

For a detailed theoretical derivation and more examples of use see: http://nbviewer.jupyter.org/github/NelisW/ComputationalRadiometry/blob/master/07-Optical-Sources.ipynb

See the __main__ function for examples of use.

This package was partly developed to provide additional material in support of students and readers of the book Electro-Optical System Analysis and Design: A Radiometry Perspective, Cornelius J. Willers, ISBN 9780819495693, SPIE Monograph Volume PM236, SPIE Press, 2013. http://spie.org/x648.html?product_id=2021423&origin_id=x646

Module classes

class pyradi.ryscene.Scene
interpLocus(ltime)

Given a time, interpolate the direction locus vector.

readLocus(filename)

Read a locus.csv file into data frame.

File must have no spaces and contain data in this format: (time in seconds, x,y,z in metre and azim/elev in degrees):

time,x,y,z,yawDeg,pitchDeg,rollDeg
0,0,0,0,0,0,0
1,0,0,0,30,0,0
2,0,0,0,30,15,0
3,0,0,0,30,15,20
4,0,0,0,0,0,0

The angular values are processed to obtain angles in radians and quaternions.