Wed, 01/25/2012 - 07:00 am
I am extremely new to Igor, in fact trying to determine whether to purchase it. In excel I can easily take one column of time series data and bin it according to another column of data. For example having wind speed bins with corresponding power production data. (If wind speed is from 2-4 m/s what is the power produced?) Can this be done in Igor and how?
Thank you.
David
I'm not sure I understand the question but . . .
My interpretation is that you want sum the values of powerProduction where windSpeed is between 2 and 4.
How you would do this depends on whether your windSpeed data is waveform data (evenly-spaced) or XY data. If XY data, it also depends on whether your X wave is sorted or not.
If you're not familiar with the concept of a waveform versus XY, execute this and read the corresponding help:
It's much easier if it is waveform data. Here is an example:
SetScale/P x 0, 0.2, "mph", power // X units in wind speed, miles-per-hour, measured every 0.2 mph
power = 100* x // Sample data
Display power
ModifyGraph mode=8, marker=19
ShowInfo; Cursor A, power, 5; Cursor B power, 10
Edit power.id
Print sum(power, 1.0, 2.0) * 0.2 // Area under curve from windspeed=1.0 to windspeed=2.0, inclusive
Print (100 + 120 + 140 + 160 + 180 + 200) * .2 // Same thing but done manually
Note that sum converts its x parameters to point numbers by rounding and then returns an inclusive sum. So if you execute:
you get a sum from point 5 (x=1.0) up to and including point 10 (x=2.0).
You would get the same sum from:
Print sum(power, 1.0, 1.91) // Point 10 included in sum
but a smaller sum from
Print sum(power, 1.0, 1.89) // Point 10 excluded from sum
Now create a wave of binned powers:
SetScale/P x, 0, 1.0, "mph", binnedPower
AppendToTable binnedPower.id
binnedPower = sum(power, x, x+4*0.2) * 0.2
Display binnedPower
ModifyGraph mode=5
SetAxis left 0,940
If your data is XY and sorted, you can use the areaXY or faverageXY function instead of sum which assumes waveform.
I highly recommend that you go through the first half of the Guided Tour of Igor (choose Help->Getting Started). It's an essential introduction to Igor.
If you prefer videos: http://www.wavemetrics.com/products/igorpro/videotutorials.htm
January 26, 2012 at 01:46 pm - Permalink
DisplayHelpTopic "Histogram"
You need to scroll down to the Details section for the discussion and helpful diagram of what it means.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
January 27, 2012 at 08:53 am - Permalink