NAME

flat - BPipe code which traces photons to an arbitrarily oriented flat optic.


PARAMETERS

flat uses the standard parameter interface

input file
filename as output by genphot.

output file
name of BPipe output file.

x0 double
x-coordinate of flat center.

y0 double
y-coordinate of flat center.

z0 double
z-coordinate of flat center.

normx double
x-component of normal vector.

normy double
y-component of normal vector.

normz double
z-component of normal vector.

height double
dimension of the flat parallel to the global x-axis.

width double
dimension of the flat parallel to the global y-axis.

rotation double
rotation of the flat about its center, relative to the axis in the flat system parallel to the global xy-plane.

surf_no integer
surface number of the flat.

debug string
If equal to verify, print calculated number of rays transmitted.

version boolean
If equal to yes, print version number then die.


DESCRIPTION

Photons generated by genphot are incident on a flat, rectangular optic in an arbitrary orientation. A photon which misses the flat has its position retained at its point of origin, and the surface missed flag is set in the appropriate field in the bpipe output. A photon which hits the flat has its position updated to the intersection location, and the surface missed flag is not set. In both cases the direction of the photon is unchanged. The BPipe format output contains the header fields of number of photons and surface number, and the data fields of direction, energy, position, surface missed flag, surface normal, and weight.

The flat is specified by the components of its normal vector, the location of its center, its dimensions (height and width), and the rotation of the optic about its center. The height is specified to be the dimension of the flat parallel to the x-axis of the (global) genphot coordinate system when the rotation of the flat is 0. Similarly, the width is specified to be the dimension of the flat parallel to the y-axis of the global system.

The coordinate system associated with the flat is defined such that its origin is located at the center of the flat, its z-axis is in the direction of the normal of the flat, and its x-axis is parallel to the xy-plane of the global system. In the case of the normal being specified as parallel to the global z-axis, this prescription is insufficient as there is a degeneracy in the specification of the flat system's x-axis, as any axis perpendicular to the flat system z-axis would be parallel to the global xy-plane. In this instance, the x-axis of the flat system is specified as anti-parallel to the global y-axis, and the y-axis of the flat system is parallel to the global x-axis.

A series of tests has been conducted in which each of the parameters describing the flat orientation is separately varied. In each of 4 tests, incident rays are read from a file photin i, where i=1,2,3, or 4, corresponding to test 1, 2, 3, or 4. For each value of the parameter varied, the number of transmitted rays is calculated and compared to previously calculated results in the appropriate verification file. In all cases the center of the flat is located at (0,0,1000) and, unless specified otherwise, the rotation of the flat about its center is 0. The tests scripts, photon input files, and verification files are in the directory tests.

In the first test, the flat is centered on the z-axis, and tilted about either the flat system's x-axis or y-axis; this is done by varying either the x- or y-component of the normal, while the z-component is fixed at 1.0. In the second test, the flat is oriented parallel to the global xy-plane; the flat is incrementally displaced parallel to the flat's x-axis (until it no longer obstructs the beam), while remaining parallel to the xy-plane and having the center y-coordinate in the global system equal to 0. In the third test, the flat is centered on the z-axis and is oriented parallel to the global xy-plane; either the height or width of the flat is varied until the flat extends beyond the extent of the beam. In the fourth test, the flat is centered on the z-axis and is oriented parallel to the global xy-plane. As the flat is rotated about its center, the number of transmitted rays increases as the flat obstructs a smaller fraction of the beam.

For each test, the test number and results of each subtest are displayed to the screen. If there is a discrepancy between the number of transmitted photons calculated and the number in the verification file, an error message is displayed.


COPYRIGHT & LICENSE

Copyright 2006 Smithsonian Astrophysical Observatory

This software is released under the GNU General Public License. You may find a copy at

          http://www.fsf.org/copyleft/gpl.html


VERSION

This documents version 1.0.1 of flat.


AUTHOR

D. Grumm