LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping pixels to wavelength

We are doing a spectrosopy experiment using a laser source and linescan camera. The data we get from the camera gives intesity on the y axis and pixel number on the x axis.

We have a reference compound that we will use to calibrate the experiment (peaks are at known wavelength)

Does anyone know how i can map the wavelength data of the known compund onto the pixel numbers of the unknown? Is there a VI that can do this?

Thanks for your help

Jack
0 Kudos
Message 1 of 18
(7,778 Views)
So far as I know, there is no generic VI to do all of this, probably because the specific details vary from instrument to instrument.  However, it is fairly easy to write one.  The following procedure assumes that your system is linear.  This is not necessarily a good assumption, depending on how wavelength is generated (scanned laser, grating, ???), but there are variants to the basic procedure which can deal with that issue.
  1. Generate a set of data with known peak locations.
  2. Find the peaks.  This is probably easiest with Peak Detector.vi, but there are many ways to do it.
  3. Use a linear fit (Linear Fit.vi) to find the relations between wavelength and pixel position.
  4. Use the linear fit to convert pixel position to wavelength.
If your fit is not linear, there are a plethora of other fitting routines available, as well (e.g. Levenberg-Marquardt, downhill-simplex minimization, splines).  If you are using the base version of LabVIEW, some of the above items are not included.  You can either upgrade or write them yourself (the two above are not hard).  If you wish to write them yourself, Numerical Recipes in C, by Press et. al. is available in most libraries and contains complete descriptions of everything I have mentioned in this reply.
0 Kudos
Message 2 of 18
(7,755 Views)

Hi,

I know this is a very old post but I was working on a 4th year project where we have a very similar problem. We have a graph where we have x-axis as pixels (0-512) and y-axis is power intensity. The question is how can I directly map pixels into wavelength? Is there any way, I can do that.

 

Any help is appreciated!

 

Thank You

Shivank Gupta 

0 Kudos
Message 3 of 18
(6,935 Views)

Did you try what Dr. Gray suggested? As has been pointed out, you need to do some kind of calibration with a known spectrum.

 

Lynn

0 Kudos
Message 4 of 18
(6,927 Views)

Yes I tried his way but did not had any success with that as of now. We are trying a simple approach if we can, so is there any way we can directly multiply a constant with x-axis directly so that it is converted?

 

Regards

0 Kudos
Message 5 of 18
(6,917 Views)

Are you just trying to change the scale of the X-axis? You can use property nodes: X Scale: Offset and Multiplier. If you want something else, please give a more detailed description. Post what you have tried and explain what it does not do that you want it to do.

 

Lynn

0 Kudos
Message 6 of 18
(6,907 Views)
0 Kudos
Message 7 of 18
(6,891 Views)

i actually have pixels on my x axis, and want to change it to wavelength. I know the formula for this conversion but dont actually know how to use it in labview. i need an array of values of x axis after conversion too but all it gives me after using the multiplier function is the maximum value converted from pixels to wavelength rather than showing me all the converted values. The formula is attached below.

 

Thanks

0 Kudos
Message 8 of 18
(6,855 Views)

Attach your VI so we can see how you are doing it now.  Then we can tell you how to fix it.

0 Kudos
Message 9 of 18
(6,844 Views)

I have attached my VI below. the problem that we are having now is we should get 512 according values of wavelength, but what the VI does is picks the highest value of them all. How can we correct that?

 

0 Kudos
Message 10 of 18
(6,821 Views)