LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating an array to use as graph indeces.

Hello all. 

I am sure this is probably a very basic question.

I am getting an array of length 1340- each value represents an intensity at a given pixel. Each pixel represents a wavelength in a y = mx + b form. So I initially had no problem using an intensity graph and setting the offset and multiplier within the graph's settings.

 

Now, however, I want to calculate the raman shift, which is more involved than the linear fit before:

seanMeredith_1-1753373742948.png

 

I need to: create an array from 1 to 1340

Apply the y = mx + b to go from pixel length to wavelength

apply the above transformation (where lambda_ex is a constant) to each value.

Use these as an x axis to graph against my already acquired y-axis data.

 

Does anyone have any tips?

I did this but this results in an indicator array that I am not really able to further manipulate... Sorry, I am a noob to Labview

seanMeredith_2-1753373972796.png

 

0 Kudos
Message 1 of 4
(148 Views)

You do not need to scale the axes.

Use the LabVIEW Help -->Find Examples... drop down menu to open the LabVIEW Example Finder and search for the "XY Graph Data Types.vi" VI.  It shows multiple ways to graph XY data.

0 Kudos
Message 2 of 4
(139 Views)

Hi sean,

 


@seanMeredith wrote:

I need to: create an array from 1 to 1340

seanMeredith_2-1753373972796.png


This loop will NOT create the desired array of 1…1340 as "i" starts with 0 and will have the value 1339 in the last iteration…

 


@seanMeredith wrote:

Apply the y = mx + b to go from pixel length to wavelength

 

I did this but this results in an indicator array that I am not really able to further manipulate... Sorry, I am a noob to Labview


Why don't you use basic math operations (like multiply and add) on your array? (Ever heard of "polymorphism" with respect to LabVIEW?)

What is "pixel length"?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 4
(120 Views)

@seanMeredith wrote:

Hello all. 

I am sure this is probably a very basic question.

I am getting an array of length 1340- each value represents an intensity at a given pixel. Each pixel represents a wavelength in a y = mx + b form. So I initially had no problem using an intensity graph and setting the offset and multiplier within the graph's settings.

 

Now, however, I want to calculate the raman shift, which is more involved than the linear fit before:

seanMeredith_1-1753373742948.png

 

I need to: create an array from 1 to 1340

Apply the y = mx + b to go from pixel length to wavelength

apply the above transformation (where lambda_ex is a constant) to each value.

Use these as an x axis to graph against my already acquired y-axis data.


 

You seem to have a mix of several ambiguous problem and I cannot make sense of what you are saying.

 

  • An intensity graph is for data with two independent axis (e.g. a 2D array where the indices relate to X and Y and the value is Z.)
  • You talk about an array of length 1340, which is 1D and just requires a plain graph.
  • Pixels are in 2D units, so what is a "pixel" in your world?
  • Once you transform, the axis is no longer linear in lambda.
  • Maybe you could graph a suitable transform?
  • Maybe you could do a linear ramp of Raman shifts and remap by interpolating into your existing data

 

Please attach a simple example containing typical data. Everybody here know how a FOR loop looks like, no need to attach silly pictures.

0 Kudos
Message 4 of 4
(116 Views)