6.03.x

Simple Spectral Analysis Functions

Average rating
(0 votes)

#pragma rtGlobals=1		// Use modern global access method.
 
 
Function CrossPower(srcX, srcY, bw_res)
	WAVE srcX, srcY
	Variable bw_res // Desired spectral resolution, Hz
 
	Variable retval
	retval = CrossPowerDensity(srcX, srcY, bw_res)
	if(retval < 0)
		return -1 // Error!
	endif
 
	WAVE/C G_XY
 
	Duplicate/C/O G_XY P_XY
	Redimension/R P_XY
	WAVE pxy = P_XY
	// Cross-power is modulus of G_XY
	pxy = cabs(G_XY) 
 
	// Set units correctly; should be (srcUnits)^2 / Hz
	SetScale d, 0, 0, "(" + WaveUnits(srcX, 1) + ")^2/Hz", pxy
 
	KillWaves/Z G_XY
End

Highlight a data point on all graphs

Average rating
(0 votes)

Using the code below, you will be able to Shift-click on specified graph windows to have the data point on the trace under the mouse pointer (if there is one) be highlighted with a tag on all other graphs on which that same wave is displayed. This currently will probably not work on traces displayed using XY pairs, and may not work on images or more complicated graphs.

Cluster a correlation matrix

Average rating
(1 vote)

This code demonstrates how you can cluster data using the correlation matrix.

// Create a correlation matrix from fake data, in this case with 2 embedded patterns and 
// relative noise of 0.25.  
FakeCorrelationMatrix(2,0.25)
 
// Cluster the correlation matrix with 2 expected patterns.  
// Picks starting cluster guesses randomly and for high values of noise it might give a poor 
// result.   The /SEED=(ticks) flag makes it give random initial guesses on each run.  
CorrelationClustering(2,Fake_Corr_Matrix)

Set Igor Sleep Meter

Average rating
(0 votes)

// Igor Sleep Meter
//
// Creates a slider that can be used to adjust the relative attention level given to Igor
// This procedure only has use under MacOS, not Windows
// Higher values of sleep mean Igor spends less time looking for something to do
// A value of ZERO gives full time to Igor as a foreground application
 
#pragma rtGlobals=1
 
Function SetIgorSleep()
	if (WinType("IgorSleep")==0)
		NewPanel/W=(150,50,217,171)/K=1/N=IgorPower as "IgorSleep"
		Slider Power,pos={7,21},size={47,80},proc=SleepNumber,limits={0,20,1},value= 1
	endif
	SetProcessSleep 1
End

A filtered list of all controls in a window, including subwindows

Average rating
(0 votes)

This might be interesting for you if you are programming Igor Pro user interfaces.

If you have ever tried to make your functions aware of subwindows, you might have missed a function that returns a list of all controls in a window, regardless of whether they are in the main window or in a subwindow. The function given below is highly configurable (you can filter by match strings and/or control types, recurse through child windows...), please consult the comments in the snippet.

SubWindowList

Average rating
(0 votes)

This might be interesting for you if you are programming Igor Pro user interfaces.

If you have ever tried to make your functions aware of subwindows, you might have missed a function that returns a list of all child windows of a (sub)window with full host specs. The built-in function ChildWindowList only returns "immediate subwindow window names", and does not include the full "host spec path".

print SubWindowList("graph0") prints something like graph0;graph0#G0;graph0#P0;graph0#P0#G0;graph0#P1
whereas print ChildWindowList("graph0") would print G0;P0;P1;

Interactive Dartboard IGOR.6.03.x-1.0-1

in
Downloaded 1217 times
Download: DrawDartBoard_2.ipf
Size: 13.8 KB
md5_file hash: c9c719efb9e8d762d555312e4f569773
First released: February 18, 2009 - 13:47

patched bad conditional compilation condition to
#if NumberByKey("IGORVERS", IgorInfo(0)) < 6.1
DoUpdate // general update (prior to IP6.1)
#else
DoUpdate /W=$DBwin // update this graph only (/W flag is new in IP6.1)
#endif

Interactive Dartboard IGOR.6.03.x-1.0

in
Downloaded 279 times
Download: DrawDartBoard_1.ipf
Size: 13.8 KB
md5_file hash: 331d00812b208600b6264497b407f289
First released: February 15, 2009 - 14:14

The first fully functional release.

The coordinate system issue has been resolved, now both "relative" and "absolute" coordinates are ok.

Not tested on Mac, but I'm waiting to hear complaints...

Interactive Dartboard IGOR.6.03.x-0.99-a

in
Downloaded 540 times
Download: DrawDartBoard_0.ipf
Size: 12.93 KB
md5_file hash: 09f6381f78c6b062675ba26411e79246
First released: February 14, 2009 - 16:32

This is the first release. A minor issue about coordinate systems persists, so the version number is 0.99a.
Tested on IP6.03(Win). May not work on Macs due to the outstanding minor issue.

Minor issue: Problem translating mouse coordinates (pixels) to window coordinates (points).
Current workaround: hard-wired the dartboard to be centered in its window.

DrawArcWedge

Average rating
(0 votes)
Two ArcWedges drawn with DrawArcWedge

DrawArcWedge draws an "arced" wedge, i.e. a polygon delimited by two concentric arcs. A more elaborate example that uses DrawArcWedge can be found in my project Interactive Dartboard. Note: This was designed and tested in IP6.03 on Win, but should also work in Igor 5.x, and on Mac.

Syndicate content

Back to top