Author |
Topic |
|
hanskloss
USA
Posts |
Posted - 12/05/2008 : 4:36:34 PM
|
Origin Ver. and SR (Select Help-->About Origin): 8 Pro, SR4 Operating System: Windows XP
Hi I would like to use Origin to provide "live" view of neutron scattering data while it is being collected.
I have a set of classes (in C#) that control and receive data from our Data Acquisition System (DAS) - which are histograms of one or two independent variables. They would qualify, I guess, in Origin language as 2-D or 3-D data sets.
Now we would like to plot them and periodically update the plots with fresh data (say every 1-2 seconds while the data are being taken).
As I am not [yet :)] an Origin expert - I am a quite proficient developer - I would like to ask what would be the most optimal way to attack this problem?
1) Create an OPJ project with origin, let my COM app load it, and then send fresh data? 2) Use Lab Talk commands to do the job? 3) Something else?
Again, I do not want to reinvent the wheel and I think that Origin does a pretty good job in presenting the data. All I would like to do is to send the data that is ready for presentation to Origin
Thanks for you help
Piotr
|
|
cpyang
USA
1406 Posts |
|
hanskloss
USA
Posts |
Posted - 12/05/2008 : 5:30:59 PM
|
How much slower? |
|
|
cpyang
USA
1406 Posts |
Posted - 12/05/2008 : 6:36:52 PM
|
Our test shows that Origin graph (line plots) can be refreshed quite well a dozen times a second. It does not really matter what the buffer size is. So optimally, you would buffer your data so that you send them over to Origin no more then 10 times a second.
CP
|
|
|
hanskloss
USA
Posts |
Posted - 12/06/2008 : 8:34:38 PM
|
What would be max frequency for 3-D plots? |
|
|
cpyang
USA
1406 Posts |
Posted - 12/07/2008 : 07:18:38 AM
|
3D surface plot will be much slower. We will need to create an example and do some test.
I assume then that you are sending over data as a matrix? The fastest would be to set the matrix as Image view and directly visualize the image on the matrix. Or to make an image plot, that is pretty much the same in terms of refresh speed. You may also consider a contour plot, which is still much faster then a 3D surface plot.
CP
|
|
|
hanskloss
USA
Posts |
Posted - 12/08/2008 : 10:46:52 AM
|
Yes the data is a matrix (essentially an image).
All I need is an image display with a given color map. I do not need the ability to rotate all the unnecessary 3-D stuff. Basically I need something similar to Matlab imshow() |
|
|
cpyang
USA
1406 Posts |
Posted - 12/08/2008 : 4:08:20 PM
|
We will add an example in C# to use a timer to send a matrix over to Origin and see the image update.
CP
|
|
|
hanskloss
USA
Posts |
Posted - 12/08/2008 : 5:36:25 PM
|
I am anxiously waiting for the examples. |
|
|
cpyang
USA
1406 Posts |
|
hanskloss
USA
Posts |
Posted - 12/09/2008 : 10:52:02 AM
|
Shouldn't your nMax in timer1_Tick be
int nMax = NUM_ROWS*NUM_COLS - 1; ?
You have:
int nMax = (NUM_ROWS - 1) + (NUM_COLS - 1);
|
|
|
cpyang
USA
1406 Posts |
Posted - 12/09/2008 : 11:41:51 AM
|
quote: int nMax = NUM_ROWS*NUM_COLS - 1;
It is just the max value put into the matrix as a demo. I was using
nc + nr
so that was why.
We found that matrix image view does not support user supplied colormap, so we will need to use an image plot to allow a colormap to be used. We will show an example of image plot with colormap shortly.
CP
|
|
|
cpyang
USA
1406 Posts |
Posted - 12/15/2008 : 7:10:33 PM
|
quote: For a matrix of 640x480, updating 2 times a second allow rather comfortable continue usage of Origin with the live update. 3 Times a second seems to shows some delay.
We have made some improvement on sending matrix data to Origin, so with the above, refreshing 5 times a second is quite comfortable in the upcoming SR5.
CP
|
|
|
hanskloss
USA
Posts |
Posted - 12/16/2008 : 3:06:47 PM
|
What about the example with colormap? |
|
|
cpyang
USA
1406 Posts |
|
hanskloss
USA
Posts |
Posted - 12/17/2008 : 9:13:50 PM
|
Can one perhaps issue a bunch of LabTalk commands? |
|
|
cpyang
USA
1406 Posts |
Posted - 12/17/2008 : 10:20:04 PM
|
We have decided to add Colormap class to COM, so better just use default gray image for now and wait a couple of weeks for SR5, where the colormap can be applied to the Image in the matrix itself, without having to use a separate plot and can be configured with two arrays, array of levels and array of RGB.
CP
|
|
|
hanskloss
USA
Posts |
Posted - 02/03/2009 : 1:20:20 PM
|
Is the SR5 coming soon? |
|
|
greg
USA
1378 Posts |
|
long123
China
9 Posts |
Posted - 06/18/2015 : 02:36:34 AM
|
We found that matrix image view does not support user supplied colormap, so we will need to use an image plot to allow a colormap to be used. We will show an example of image plot with colormap shortly.
sbvdxfnbghm |
|
|
lindseynicole010
Canada
2 Posts |
Posted - 11/12/2016 : 05:22:41 AM
|
thanks |
|
|
|
Topic |
|