de.grogra.imp3d.spectral
Class IrregularSpectralCurve

java.lang.Object
  extended by de.grogra.persistence.ShareableBase
      extended by de.grogra.imp3d.spectral.SpectralCurve
          extended by de.grogra.imp3d.spectral.IrregularSpectralCurve
All Implemented Interfaces:
Manageable, Shareable

public class IrregularSpectralCurve
extends SpectralCurve

This class allows spectral curves to be defined from irregularly sampled data. Note that the wavelength array is assumed to be sorted low to high. Any values beyond the defined range will simply be extended to infinity from the end points. Points inside the valid range will be linearly interpolated between the two nearest samples. No explicit error checking is performed, but this class will run into ArrayIndexOutOfBoundsExceptions if the array lengths don't match.


Nested Class Summary
static class IrregularSpectralCurve.Type
           
 
Field Summary
static IrregularSpectralCurve.Type $TYPE
           
static SCOType.Field amplitudes$FIELD
           
static SCOType.Field wavelengths$FIELD
           
 
Constructor Summary
IrregularSpectralCurve()
           
IrregularSpectralCurve(float[] wavelengths, float[] amplitudes)
          Define an irregular spectral curve from the provided (sorted) wavelengths and amplitude data.
 
Method Summary
 ManageableType getManageableType()
           
 float sample(float lambda)
          This function determines the actual spectral curve data.
 
Methods inherited from class de.grogra.imp3d.spectral.SpectralCurve
toXYZ, toXYZ
 
Methods inherited from class de.grogra.persistence.ShareableBase
addReference, appendReferencesTo, fieldModified, getProvider, getStamp, initProvider, manageableReadResolve, manageableWriteReplace, removeReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

$TYPE

public static final IrregularSpectralCurve.Type $TYPE

amplitudes$FIELD

public static final SCOType.Field amplitudes$FIELD

wavelengths$FIELD

public static final SCOType.Field wavelengths$FIELD
Constructor Detail

IrregularSpectralCurve

public IrregularSpectralCurve()

IrregularSpectralCurve

public IrregularSpectralCurve(float[] wavelengths,
                              float[] amplitudes)
Define an irregular spectral curve from the provided (sorted) wavelengths and amplitude data. The wavelength array is assumed to contain values in nanometers. Array lengths must match.

Parameters:
wavelengths - sampled wavelengths in nm
amplitudes - amplitude of the curve at the sampled points
Method Detail

getManageableType

public ManageableType getManageableType()

sample

public float sample(float lambda)
Description copied from class: SpectralCurve
This function determines the actual spectral curve data. Note that the lambda parameter is assumed to be in nanometers.

Specified by:
sample in class SpectralCurve
Parameters:
lambda - wavelength to sample in nanometers
Returns:
the value of the spectral curve at this point