Navigation: Scripting Reference Manual > Functions & Subroutines > SpectrumCreateSampled

 

SpectrumCreateSampled

 

Contact Us: fredsupport@photonengr.com

 

Description

Creates a sampled spectrum given arrays of wavelengths and weights.

 

Syntax

spectNode = SpectrumCreateSampled( wavelens( ), values( ) )

 

 

Parameters

spectNode (Long)

Node number of the newly created spectrum

 

wavelens() As Double

An array of wavelengths at which the spectrum is sampled.

 

values() As Double

An array of weights corresponding to the sampled wavelengths

 

 

Example

The following example creates a new sampled spectrum at four wavelengths, renames the spectrum and then updates the document.

 

Dim spectNode As Long

Dim wavelens( 3 ) As Double

Dim values( 3 ) As Double

 

wavelens( 0 ) = 0.4 : wavelens( 1 ) = 0.5

wavelens( 2 ) = 0.6 : wavelens( 3  ) = 0.7

 

values( 0 ) = 0.000396 : values ( 1 ) = 0.323

values( 2 ) = 0.631 : values( 3 ) = 0.004102

 

spectNode = SpectrumCreateSampled( wavelens(), values() )

SpectrumSetName spectNode, "Sampled Spectrum"

Update

 

 

See Also

SpectrumSetName

Update

SpectrumCreateBlackbody

SpectrumCreatePredefinedSampled

SpectrumCreateGaussian

 

 

 

 

 

Copyright © Photon Engineering, LLC