Last active
January 3, 2016 20:29
-
-
Save ejdanderson/8515105 to your computer and use it in GitHub Desktop.
IGOR Functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add a value to a specific range of points of a wave | |
Function addToWaveRange(wname, startPoint, endPoint, addition) | |
wave wname | |
variable startPoint | |
variable endPoint | |
variable addition | |
variable ii | |
for ( ii=0; ii< (endPoint-startPoint); ii += 1 ) | |
wname[startPoint + ii] += addition | |
endfor | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adds a value to every point in a wave | |
Function addToWave(wname, amount) | |
wave wname | |
variable amount | |
wname=wname + amount | |
return 0 | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// normalize a wave against its largest value | |
// possible improvement: create new wave instead of modifying original data | |
Function normalizeWave(wname) | |
wave wname | |
WaveStats/Q wname | |
wname/=V_max | |
return 0 | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Normalize a wave to have values between 0 and 1 | |
Function Normalize1To0(wname) | |
wave wname | |
WaveStats/Q wname | |
wname=(wname-V_min)/(V_max - V_min) | |
return 0 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ModifyGraph userticks(bottom)={xval2,xlabel}