Navigation: Scripting Reference Manual > Functions & Subroutines > SpectrumCombine

 

SpectrumCombine

 

Contact Us: fredsupport@photonengr.com

 

Description

Sums two spectrum of any type together and creates a new sampled spectrum from the resulting summation.  The following rules apply:

If a sampled spectrum is included in the summation, data points in the new spectrum will include those from the sampled spectrum.

If two spectrum have sample points which are very close together (to precision around 10-4 ), then only one of the sample points is used.

Values outside of a spectrum's wavelength range are considered to be zero.

Values between sampled spectrum points are linearly interpolated in the summation.

If both spectrum used in the summation are sampled spectrum, then the suggested sample count specification is ignored.

 

 

Syntax

spectNode = SpectrumCombine( scale1, spect1, scale2, spect2, suggestedSampleCount )

 

 

Parameters

spectNode (Long)

Node number of the newly created spectrum

 

scale1 As Double

Scale factor for the values in the first spectrum being used in the combination.

 

spect1 As Long

Node number of the first spectrum being used in the combination.

 

scale2 As Double

Scale factor for the values in the second spectrum being used in the combination.

 

spect2 As Long

Node number of the second spectrum being used in the combination.

 

suggestedSampleCount As Long

Number of suggested sample points for the newly created spectrum.  This IS NOT the number of sample points in the resulting spectrum due to the reduction of similar data points (see notes above).  FRED will attempt to set the number of resulting sample points as close to this value as is reasonable.

 

 

Example

The following example creates a Blackbody spectrum, a CIE Y color matching spectrum and combines the two into a new spectrum with 200 suggested sample points.

 

Dim spectNodeBB As Long

Dim spectNodeY As long

Dim spectNodeComb As Long

 

spectNodeBB = SpectrumCreateBlackbody( 5900, 0.3, 0.7 )

spectNodeY = SpectrumCreatePredefinedSampled( 2 )

 

spectNodeComb = SpectrumCombine( 1, spectNodeY, 3, spectNodeBB, 200 )

SpectrumSetName spectNodeComb, "Summed Spectrum"

 

 

See Also

SpectrumComputeArea

SpectrumComputeChromaticity

SpectrumComputeLuminousEfficacy

SpectrumCopy

SpectrumDelete

SpectrumDeleteAllNodes

SpectrumFindName

SpectrumGetDescription

SpectrumGetMaxNodeNum

SpectrumGetName

SpectrumGetNodeCount

SpectrumGetRange

SpectrumGetValue

SpectrumIsValidNode

SpectrumSetDescription

SpectrumSetName

 

 

 

 

 

Copyright © Photon Engineering, LLC