visualdatatools.com Forum Index visualdatatools.com
Discussion for DataTank and DataGraph
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to subtract data from plotted graph

 
Post new topic   Reply to topic    visualdatatools.com Forum Index -> Getting Started
View previous topic :: View next topic  
Author Message
jessequinn



Joined: 27 Nov 2014
Posts: 49

PostPosted: Tue Jan 24, 2017 9:20 pm    Post subject: How to subtract data from plotted graph Reply with quote

image hosting more than 5mb

How would I select two points on a linear plot and have it subtracted from the graph data to create a flat representation of the data?
Back to top
View user's profile Send private message
jessequinn



Joined: 27 Nov 2014
Posts: 49

PostPosted: Wed Jan 25, 2017 7:08 am    Post subject: Reply with quote

under origin pro this would be

data manipulation - remove straight line
Back to top
View user's profile Send private message
David
Site Admin


Joined: 25 Nov 2006
Posts: 1929
Location: Chapel Hill, NC

PostPosted: Wed Jan 25, 2017 11:08 am    Post subject: Reply with quote

Do you mean take the first and last point (xmin,y(xmin)), (xmax,y(xmax)), take the line between them and subtract it from the data?

If the columns are called x and y, this can be done with an expression column

y-(y(1) + (y(y.length)-y(1))/(x(y.length)-x(1))*(x-x(1)))


One problem with this (apart from the long expression) is that in your data the first and last points are noisy, so it should really be some kind of a least squares fit of the beginning and ending points.

You can do that by using the Fit command and a mask to remove the interior (say "Lies outside" 240,250). Then you can extract the equation of the line (a and b in a+b*x) and use an expression column to subtract that.

If you send me the graph I can tweak it.

I am not against creating a "Remove straight line" type functionality. It would be in the Plot Action column. However I want something where you can set it and forget it. That is, set a rule so that it does the right thing for subsequent data that comes in. I don't want a UI that requires you to manually set something every time you change the data. In order to come up with those rules, I want to have clear use cases and make sure that it is clear what is done.

For example, in this case (and I'm just brainstorming here), you could file this under a "Background subtraction" action, and the method inside that would be "based on start&end portion" and a detail inside that would be a fraction which indicates what percentage of the start/end to take. You might be ok with 5% or less. Inside that Methods menu would be other ways to get the background signal, for example allow you to select a Fit drawing command or a Function command and it would pick up the function from there.

David
Back to top
View user's profile Send private message Send e-mail
jessequinn



Joined: 27 Nov 2014
Posts: 49

PostPosted: Thu Jan 26, 2017 9:51 am    Post subject: Reply with quote

thank you for the fast reply. you hit it on the head. what you suggest would be a great functionality.

find an example of processed data from origin pro vs original

https://www.dropbox.com/s/e7aqctzidjza99w/example.dgraph.zip?dl=0
Back to top
View user's profile Send private message
jessequinn



Joined: 27 Nov 2014
Posts: 49

PostPosted: Sun Feb 12, 2017 9:12 pm    Post subject: Reply with quote

any ETA when something like straight line removal will be implemented?

Thanks
Back to top
View user's profile Send private message
David
Site Admin


Joined: 25 Nov 2006
Posts: 1929
Location: Chapel Hill, NC

PostPosted: Fri Feb 17, 2017 1:15 am    Post subject: Reply with quote

Thanks for reminding me. There was a little bit of code signing drama around 4.2.1, but that should be cleared up now so I can start pushing out new betas.

I added a Subtract method to the Plot Action column. You can select a Fit command and the fit function is subtracted from the y column.

I just uploaded a new beta (4.3).

David
Back to top
View user's profile Send private message Send e-mail
jessequinn



Joined: 27 Nov 2014
Posts: 49

PostPosted: Fri Feb 17, 2017 10:12 pm    Post subject: Reply with quote

yes I just saw. I am excited to try it out!

Thanks
Back to top
View user's profile Send private message
jessequinn



Joined: 27 Nov 2014
Posts: 49

PostPosted: Fri Feb 17, 2017 10:39 pm    Post subject: Reply with quote

works beautifully.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    visualdatatools.com Forum Index -> Getting Started All times are GMT - 3 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group