


// Script function: Demonstrate "cos", and ImageSetIntensityOrigin and ImageSetIntensityScale commands



// Unless named starting with GlobalSino, EM, My, Self, the function commands are defined 
//by Gatan DM, please see at link: http://www.globalsino.com/EM/page2597.html


Number N = 360
image GlobalSinoCosine := RealImage("Cosine Plot at GlobalSino", 8, N, 1) // The bytes parameter can be 4 or 8; however, here it is 8.
GlobalSinoCosine = cos(2*pi()*(icol/N))
setDisplayType(GlobalSinoCosine, 4)
GlobalSinoCosine.ImageSetDimensionUnitString(0, "Angle (degree)" )

// Just for your practice here: for intensity: subtract 100 from value, 
// then multiply by 10, and then gives the number of Amplitude.

GlobalSinoCosine.ImageSetIntensityOrigin( 100 ) 
GlobalSinoCosine.ImageSetIntensityScale( 10 ) 
GlobalSinoCosine.ImageSetIntensityUnitString("Amplitude" )
linePlotImageDisplay EMPlot = GlobalSinoCosine.imageGetImageDisplay(0)
EMPlot.linePlotImageDisplaySetDoAutoSurvey(0,0)
showImage(GlobalSinoCosine)
