【发布时间】:2022-08-03 21:47:37
【问题描述】:
我正在 Igor 上运行一个程序,我想创建一个函数,该函数可以制作以顺序方式绘制的轨迹电影。该程序生成一个在 x 轴和 y 轴之间交换的波表,例如,
| Point | Time0 | Data0 | Time1 | Data1 |
|---|---|---|---|---|
| 1 | 5.3860002 | 14518253 | 5.3829999 | 15511268 |
| 2 | 5.4910002 | 13881730 | 5.487 | 15299764 |
该程序允许我为尽可能多的波浪创建此图表/表格。目前,我通过调用制作电影
\'\'\'
NewMovie
AddMovie Frame
//Make a new graph
AddMovie Frame
//Make a new graph
AddMovie Frame
//Make a new graph
//etc etc
CloseMovie
\'\'\'
这显然非常乏味,所以我正在尝试制作它,这样我就可以制作一个包含许多波浪的图表/表格,然后用每个波浪更新一个新图表并循环 NewMovie 直到它完成。
下面的代码是为类似的东西制作的,但我不能让它适用于双浮点数据集,这就是我所拥有的——不是矩阵。我也无法弄清楚如何以上表所示的方式(即每隔一个)调用波浪。任何帮助或提示都可以接受。 \'\'\'
Function MakeMovie(matrix,xWave)
Wave matrix,xWave
variable i //loop variable
//make a dummy wave to accept individual rows
Make/O/N=(dimsize(matrix,1)) framewave
//create the first frame of the movie in a Graph windows called \"FrameGraph\"
Display/N=FrameGraph framewave vs xWave
Label/W=FrameGraph left \"Intensity (a.u.)\"
Label/W=FrameGraph bottom \"Wavelength (nm)\"
WaveStats/Q matrix //Get statistics of matrix
//set axis to a constant to prevent autoscaling
SetAxis left V_min,1.1*V_max
//Name the movie after the original wave
String movieName = NameofWave(matrix) + \".mov\"
//create a new movie with the original wave\'s name
NewMovie /F=30/L/I/O as movieName
//start loop to add frames to movie
for (i = 0; i < dimsize(matrix,0);i += 1)
framewave=matrix[i][p] //advance to the next trace in the sequence
DoUpdate //update the graph with the next trace in the sequence
AddMovieFrame //add a frame to the movie
endfor
CloseMovie //Close the movie file and save it to disk.
Killwindow FrameGraph //clean up
Killwaves framewave //clean up
End
\'\'\'
标签: igor