Loadwave function issue
Hi
I am trying to write a program that gives you the possibility to select manually traces from
a 2D wave and display a movie of the selected one.
Each frame should be divided in an upper and lower graph in which a row from a 2D matrix is plotted.
Before the introduction of the movie option the program was working fine.
Now, the first time I run it it gives me the error "Error: while executing Display, the following error occured: expected wave name".
if I do browse wave I can see trace_matrix in the root even though I delete it at the end of the program.
The second time I run it the program works partially and then it gives me the error
"While executing Rename, the following error occurred: name already exists as a wave".
- there are a number of Display commands - which one fails? Maybe you can add some sample data.
- if KillWaves is not successful (maybe the wave is still displayed somewhere?), then this explains why the Rename command fails on the second run
Note, that it might be easier to extract a row from a 2D wave using MatrixOP and the row keyword, instead of using a loop.
November 11, 2014 at 05:20 am - Permalink
This breaks down your larger project to smaller steps ...
(write a "save to movie" plug-in)
* load the data file
* select (and create a copy of) the waves you want for the movie
* display that selection of waves on a graph
* call up the Scroll Traces panel
* run the panel in automatic mode to create the movie
http://www.igorexchange.com/project/ScrollTracesPanel
I would be glad to help you complete the plug-in. Let me know.
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
November 11, 2014 at 08:39 am - Permalink
Thank you for the possible solutions, I will try them today. I have attached a file containing traces
as an example so that you can understand better which are the bugs.
Also, concerning the rename error. I agree with you that is related to a problem with the killwave option
but I do not understand why the first time I run the procedure it does not even display the first graph:
//create the graph that will be shown for trace selection
display/N=name0 trace_matrix[][ii]
ModifyGraph axThick=2
Label bottom "time, s"
Label left "intensity a.u."
ModifyGraph lsize=0.1
ModifyGraph/W=name0 expand=3
DoUpdate/W=name0
It seems like the matrix is not loaded in the time scale of the experiment.
Thanks again :)
November 12, 2014 at 12:53 am - Permalink
DisplayHelpTopic "The debugger",
to see what's happening in each line of code.
November 12, 2014 at 02:14 am - Permalink
I am also doing different plug-ins, it helped to solve the first problem.
Do you know a way to directly give a name to the loaded wave without using
duplicate or rename?
Still, I have problems with the movie.
November 12, 2014 at 04:52 am - Permalink
Use the LoadWave /B flag.
November 12, 2014 at 09:45 am - Permalink
Hi,
I wrote the plug in versions as suggested. Now, if I run them one by one they
work as expected but If I call the functions in sequence using MAIN_trace_selection_AB
it gives me an error, I already used the debugger and it tells me that the problem is
in the function Select_traces_algorithm1() of the file trace_selection.
I guess I need some help to complete the plug-in.
November 13, 2014 at 04:47 am - Permalink
Would you package your files and a representative data file in a ZIP archive and email that to me directly. Just use the Contact part of the IgorExchange link that shows when you view my profile information.
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
November 13, 2014 at 07:19 am - Permalink
I will attach here the .zip file.
November 16, 2014 at 02:17 am - Permalink