LightTools Enewsletter

May 2014

Quick Tip: Managing Ray Data Source Speed and Size

Ray data sources are sources that emit rays as if they were emitting from an actual source, but without any structural information. Many source vendors provide ray data files for their sources in lieu of providing proprietary geometrical and optical information about their sources. You may also wish to replace a complex source model with a simple ray data file for quicker simulation speeds. Ray data files originate from measured data of actual sources, or from LightTools simulations where rays are recorded on a receiver and exported into a ray data file.

The number of rays in these files typically range from a few thousand rays to millions of rays. For example, the LightTools LED Library (Tools > LED Library) contains ray data files for 5,000 rays for each LED. 5,000 rays is typically insufficient for practical modeling, so it is intended that users will contact their vendor to obtain ray data files with much larger numbers of rays. As with any source, the more rays that are traced during a simulation means that there will be higher accuracy. However, there are trade-offs to consider when using these large ray data files:

  1. The simulation time will be long
  2. The ray data file size will be large

At intermediate steps during the design process, you might wish to sacrifice some accuracy for quicker simulations or smaller file sizes.

Subsampling the Ray Data Source for Faster Simulation Times
When you want to trace a smaller subset of rays from the larger ray data file, go to the ray data source’s Ray Trace tab. Enabling the “Use Subsampling” option will let you tell LightTools how many rays from the ray data file you’d like to use, and LightTools will pick that many rays from the file in a random order and scale the power of the subsampled rays to match the total power of the source.

Subsampling the Ray Data Source

Creating a Smaller Ray Data File
While subsampling can limit the number of rays traced, it uses the original ray data file. Ray Data Files for large sets of data can be tens to hundreds of megabytes in size. There are a couple ways to create ray data files with a smaller subset of rays, and therefore, reduced file size:

  1. Create the complete ray data source in a new LightTools session along with an indicator receiver that collects the rays. Subsample the rays using the method above, run a simulation, and create a new ray data file source using exported rays from the receiver (Analysis > Export Receiver Rays…). 

  2. If the ray data file is in the text format, you can utilize the Ray Data Resampler Utility (Tools > Utility Library > Sources > Ray Data Resampler). This utility will let you create a new ray data file with a smaller number of rays. It also has optional scale factors if you wish to re-size the ray origins.
Smaller Ray Data File

Another way to reduce the ray data file size is to save it in a binary format instead of a text format. If you are creating the ray data file by exporting receiver rays, you have a choice of formats in the Ray Data File Export Options window (Analysis > Export Receiver Rays…). Or if you have an existing ray data file that is in a text format, you can convert it using the 3D Window commandConvertRDF <InputFileName> <OutputFileName>.

While you won’t be able to read the ray data file in the binary format in a text editor like you would a text format, the file size will be smaller. The file format of the ray data source is reported in the Emittance tab in the Ray Data File box.

Once you have the resampled ray data file, you can then replace the larger ray data file with the resampled one from the source’s Emittance Tab.

Emittance Tab

"Color Analysis in LightTools" Webinar Recording Now Available

A recording of the “Color Analysis in LightTools” webinar is now available on demand on the Customer Portal. This webinar presents a review of LightTools’ options for describing color and quantifying color rendering, and includes a comparison of 5 sources to illustrate the metrics.