|
Wasatch.NET 2.4.14
.NET application driver for Wasatch Photonics spectrometers
|
A collection of static functions provided to automate common algorithms and post-processing steps in spectroscopy applications. More...
Static Public Member Functions | |
| static double[] | applyBoxcar (uint halfWidth, double[] spectrum) |
| Remove high-frequency noise by averaging "n" (halfWidth) pixels to either side of each measured sample pixel. Note: this implementation does not average any pixels for which the full boxcar can not be computed (leaving noise on both ends of the spectrum). | |
| static double[] | applyRamanCorrection (double[] spectrum, float[] correctionCoeffs, int roiStart, int roiEnd) |
| Performs SRM correction on the given spectrum using the proivided ROI and coefficients. Non-ROI pixels are not corrected. | |
| static double[] | cleanNan (double[] a, double replacement=0) |
| Remove any "not a number" (sqrt(-1)) or "infinity" (1/0) values from an array, replacing them with the specified alternative. | |
| static float[] | cleanNan (float[] a, float replacement=0) |
| static double[] | computeAbsorbance (double[] dark, double[] reference, double[] sample) |
| Given dark, reference and sample spectra, compute the absorbance in AU (Absorbance Units) per Beer's Law. | |
| static double[] | computeAbsorbance (double[] darkCorrectedReference, double[] darkCorrectedSample) |
| Same as computeAbsorbance(dark, reference, sample), but assumes that both reference and sample have been previously dark-corrected. | |
| static double[] | computeTransmission (double[] dark, double[] reference, double[] sample) |
| Given a dark spectrum, a reference spectrum and a sample spectrum, computes the transmission or reflectance spectrum. All arguments must be non-null and of equal length. | |
| static double[] | computeTransmission (double[] darkCorrectedReference, double[] darkCorrectedSample) |
| Same as computeTransmission(dark, reference, sample), but assumes that both reference and sample spectra have already been dark-corrected. | |
| static void | fixOrder< T > (ref T lo, ref T hi) |
| static double[] | generateWavelengths (uint pixels, float[] coeffs) |
| Given a 4th-order wavelength calibration, generates the array of wavelengths. | |
| static byte[] | truncateArray (byte[] src, int len) |
| static bool | validTECCal (Spectrometer spec) |
| static double[] | wavelengthsToWavenumbers (double laserWavelengthNM, double[] wavelengths) |
| Given the center wavelength of a narrowband excitation source such as a laser, converts the passed x-axis of wavelengths (nm) into Raman shifts expressed in wavenumbers (1/cm). | |
Static Private Attributes | |
| static Logger | logger = Logger.getInstance() |
A collection of static functions provided to automate common algorithms and post-processing steps in spectroscopy applications.
|
inlinestatic |
Remove high-frequency noise by averaging "n" (halfWidth) pixels to either side of each measured sample pixel. Note: this implementation does not average any pixels for which the full boxcar can not be computed (leaving noise on both ends of the spectrum).
| halfWidth | How many pixels to average to either side of each sample pixel; higher values yield increased smoothing with commensurate loss of detail (zero disables) |
| spectrum | Input spectrum (unmodified) |
|
inlinestatic |
Performs SRM correction on the given spectrum using the proivided ROI and coefficients. Non-ROI pixels are not corrected.
This is kind of ridiculously inefficient...we should generate and cache the scaling factors when we first load the EEPROM.
|
inlinestatic |
Remove any "not a number" (sqrt(-1)) or "infinity" (1/0) values from an array, replacing them with the specified alternative.
| spectrum | input array |
| replacement | value to replace any NaN/INF entries (default zero) |
|
inlinestatic |
|
inlinestatic |
Given dark, reference and sample spectra, compute the absorbance in AU (Absorbance Units) per Beer's Law.
| dark | collected with the light source disabled or blocked by shutter |
| reference | collected with the light source shining through the reference medium (e.g. cuvette filled with air or water) |
| sample | collected with the light source shining through the sample |
https://en.wikipedia.org/wiki/Beer–Lambert_law
|
inlinestatic |
Same as computeAbsorbance(dark, reference, sample), but assumes that both reference and sample have been previously dark-corrected.
| darkCorrectedReference | dark-corrected reference spectrum of the light source shining through the reference medium (e.g. cuvette filled with air or water) |
| darkCorrectedSample | dark-corrected sample spectrum light source shining through the sample |
https://en.wikipedia.org/wiki/Beer–Lambert_law
|
inlinestatic |
Given a dark spectrum, a reference spectrum and a sample spectrum, computes the transmission or reflectance spectrum. All arguments must be non-null and of equal length.
| dark | collected with the light source disabled or blocked by shutter |
| reference | a direct spectrum of the light source (transmission) or of the illuminated reference medium (reflectance) |
| sample | collected with the light source passing through the sample (transmission) or reflected directly from the sample (reflectance) |
|
inlinestatic |
Same as computeTransmission(dark, reference, sample), but assumes that both reference and sample spectra have already been dark-corrected.
| darkCorrectedReference | dark-corrected reference spectrum |
| darkCorrectedSample | dark-corrected sample spectrum |
|
inlinestatic |
| T | : | IComparable |
|
inlinestatic |
Given a 4th-order wavelength calibration, generates the array of wavelengths.
| pixels | Number of wavelengths to generate |
| coeffs | 4th-order polynomial coefficients (offset, x^1, x^2 and x^3) |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Given the center wavelength of a narrowband excitation source such as a laser, converts the passed x-axis of wavelengths (nm) into Raman shifts expressed in wavenumbers (1/cm).
| laserWavelengthNM | center wavelength of the excitation laser (nm) |
| wavelengths | array of calibrated wavelength values for each pixel |
|
staticprivate |