LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Nonlinear mapping for intensity graph scales

Hi,

 

I've been searching on these boards and google and can't seem to find a viable solution to my problem.

 

Basically I'm controlling a system that collects reflected light from a sample at various angles of incidence. I receive 2048 data points from the spectrometer at each angle of incidence. At the moment I plot this data on both an XY graph for the current angle, and progressively on an intensity graph with angle of incidence along the X-axis, pixel number (from 0 to 2047) along the Y-axis, and the Z-axis corresponding to the reflected light intensity.

 

I would like to map different labels to the X and Y-axis so I can plot it as wavelength vs. angle, instead of the indices of the arrays. I can easily do this for the angle of incidence using the XScale.Offset and XScale.Multiplier properties since we have a linear spacing for the measured angles. However, the relationship between pixel number and wavelength is non-linear (lambda = a0+a1*p+a2*p^2+a3*p^3 where p is pixel number and aN are calibration coefficients). Is there any way to do this? I've found several others trying to do the same thing but with no luck e.g.

 

http://forums.ni.com/t5/LabVIEW/Axes-scaling-and-Intensity-Graph/m-p/136891/highlight/true#M82251

http://forums.ni.com/t5/LabVIEW/XY-graph-combined-with-intensity-graph/td-p/540576

http://forums.ni.com/t5/LabVIEW/Myself-values-on-XY-axes-markers-in-intensity-graph-How-to/td-p/3143...

http://forums.ni.com/t5/LabVIEW/How-to-draw-an-Intensity-graph-which-x-y-coordinates-do-not/m-p/1322...

 

The only potential solution out of these posts is to interpolate the measured data using a linearly spaced wavelength vector, but I expect that could be quite time consuming and we need the system to be fast. In fact, it is for reasons of speed that we can't use the 3D Surface Plot VI. Although this allows plotting a 2D matrix of Z values against arbitrary X/Y vectors it is just far too slow for real-time acquisition. Of course, if you know of a way to massively speed up 3D surface plotting then that could be a solution to the problem at hand.

 

Any ideas would be appreciated!

 

Thanks,

Mike

 

Using LabView 2012 Professional

 

 

 

 

0 Kudos
Message 1 of 3
(2,919 Views)

Interpolation would be quite fast, especially since you only do it along one dimension. How big are the arrays and what are the time constraints? Can you show us an example?

 

(While we are at it, have a look at my old idea here that would allow you to simply create nonlinearly spaced axis markers)

Message 2 of 3
(2,900 Views)

Thanks for the quick response! The arrays are 2048 points for the wavelength/pixel number axis (the one I'd have to interpolate along) and are typically about 600 wide (we generally measure from 0 to 60 degrees with a 0.1 degree resolution). Our full measurements include both measuring angle of incidence and in-plane rotation of our samples so a full high resolution scan of our samples at the moment can take up to 48 hours! That's why we're loathe to do anything that slows down the system since even a small delay per measured spectrum accumulates to a big overall delay! (e.g. our largest scans are 0:0.1:60 for angle of incidence and 0:0.1:90 for azimuthal angle for a total of 541501 spectra)

 

I'll give the interpolation a try to see if there is a significant time penalty. However, there may be additional issues since the dips we look for in our spectra are very sharp, often being just a couple of pixels wide, so interpolation may reduce the visibility of these dips. I'll see if I can chop out a bit of the VI as an example (it's quite large and makes use of loads of custom sub-VIs).

 

What I'm trying to do is exactly what is mentioned in the idea you linked to; in my case just a cosmetic change of the labels to arbitrary values would be sufficient. I noticed the idea was dated 3 years ago though so I'm guessing this feature won't be added anytime soon!

0 Kudos
Message 3 of 3
(2,897 Views)