Navigation: Sources > Ray Positions > Read Rays From a File and Generate Dynamically

 

Read Rays From a File and Generate Dynamically

 

Contact Us: fredsupport@photonengr.com

 

 

 

Description


This feature offers the most efficient and robust method of utilizing pre-existing raysets. Unlike the User-defined ray positions type, which stores ray data directly in the FRED document, this imported ray file source type simply references a file on disk where the rays are stored.  Rayfile sizes are limited to 2^31 bytes (~2.15 GB).  The user can also choose how wavelengths for the source are specified; either using spectral content from the rayfile itself or from within FRED using the Wavelengths tab of the source dialog.

 

 

Navigation


This command can be accessed by selecting Read rays from a file and generate dynamically as the ray position type on the Positions/Directions tab of a detailed source dialog box.

 

 

Controls


Control

Inputs / Description

Defaults

Filename

Name of ray file.

 

File Info

Ray count and File type

No file selected

Ray Usage

Selects all rays or a subset of the rays.

All Rays

Wavelengths

Determines how wavelengths for the source are generated.  When "From file" is toggled, wavelengths will be read directly from the ray file.  When "Specified on Wavelengths Tab" is toggled, wavelengths are generated according to the specification on the wavelengths tab of the source dialog.

Specified on Wavelengths Tab

 

OK

Accept settings and close dialog box.

 

Cancel

Discard settings and close dialog box.

 

Apply

Apply settings and keep dialog box open.

 

Help

Access this Help page.

 

 

 

Application Notes


The imported ray file

The Imported Source type reads FCR and ASCII rayfile types.  This source cannot read the FRBS file type.  The dialog box contains a pointer to the rayfile being used in the source definition.  If this file is not found at the path shown in the dialog box, FRED will attempt to locate the file in your current working directory and a message will be printed to the Output Window under this condition.  If the file cannot be found, FRED does not report an error; it simply creates the source with zero rays.

 

Pro Source

When importing rays from ProSource, FRED will reject any rayfiles which are exported using the single Tristimulus wavelength options.  Only rayfiles generated using the Spectral or Tris Color options will be accepted (use the Generic binary format for Tris Color).  FRED's internal ray power units are always radiometric and there is no accurate algorithm for converting from Lumens (ProSource) to Watts using a single Tristimulus spectra.  If the spectrum of the source has not been attached to the ProSource database file (*.rsx), then the user will need to supply a spectrum when they generate the ray file (see the ProSource documentation for proper formatting).  Typically, the spectrum can be digitized from the source specification sheet or provided by the vendor directly.

 

Source power

When a rayset is imported, FRED sets the power of the source equal to the power contained in the rays.  No information is set regarding the units of power.  This value can be changed from the Power tab of the detailed source dialog if necessary.

 

 

Ray subsets

When using the subset option, the specified number of rays will be randomly selected from the rayfile for creation.  The algorithm used to select rays from the file is the following:

 

nSub = number of rays chosen as the subset

nRet = number of rays selected so far

nTot = total number of rays in the file

nChecked = number of rays in the file checked so far

 

The probability of a ray getting selected is (nSub - nRet)/(nTot - nChecked)

The ray is selected when a random number roll is less than or equal to the current probability

 

For a ray file with 200 rays and a subset selection of 10, the first ray in the file has probability 10/200 of getting selected.  If it is not selected, the second ray in the file would have probability of 10/199.  If the first ray was selected, the second ray in the file would have a probability of 9/199.  This method guarantees both randomness and that the exact number of specified subset rays are selected.

 

 

Related Topics


Ray Positions - Bitmap

Ray Positions - Grid Plane

Ray Positions - Hexagonal Plane

Ray Positions - Read rays from a file

Ray Positions - Random Plane

Ray Positions - Random String

Ray Positions - Random Volume

Ray Positions - User-defined Rays

Rayfile Formats

 

 

 

 

 

 

Copyright © Photon Engineering, LLC