Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
Close
From: super zach <zachariah_cano@ya...>  20100128 13:27:56

Hi all I am trying to fit a function that takes data from two files. Is there a way to do this using GNUPLOT? For example: I am trying to fit a lightcurve by considering light coming from two sources, lets call them A & B. I thus have two text files A.dat & B.dat that each contain three columns: time / flux / flux error I have an equation I want to fit to these data files that roughly equates to (though is actually more complicated): total_flux(x) = K*flux_A(x) + L*flux_B(x) where K & L are constants I want to determine by fitting. Is there a way to do this? I have discovered "fit multibranch" but that seems to fit the same equation to two datasets, which is not the same as what I am trying to do here. Many thanks in advance. Best, Zach  View this message in context: http://old.nabble.com/GNUPLOTFittingMultipleTextfilestp27355951p27355951.html Sent from the Gnuplot  User mailing list archive at Nabble.com. 
From: Thomas Sefzick <t.sefzick@fz...>  20100128 16:53:36

the light flux from the two light sources seems to be totally independent, that's what the function > total_flux(x) = K*flux_A(x) + L*flux_B(x) suggests. so there is no need to do a combined fit. just fit the two curves separately. otherwise, if the xvalues are all the same in corresponding lines of both data sets, you may combine the data sets outside of gnuplot and then work with the combined data file. on unixlike system you may use the 'join' command. super zach wrote: > > Hi all > > I am trying to fit a function that takes data from two files. Is there a > way to do this using GNUPLOT? > > For example: > > I am trying to fit a lightcurve by considering light coming from two > sources, lets call them A & B. > > I thus have two text files A.dat & B.dat that each contain three columns: > time / flux / flux error > > I have an equation I want to fit to these data files that roughly equates > to (though is actually more complicated): > > total_flux(x) = K*flux_A(x) + L*flux_B(x) where K & L are > constants I want to determine by fitting. > > Is there a way to do this? I have discovered "fit multibranch" but that > seems to fit the same equation to two datasets, which is not the same as > what I am trying to do here. > > Many thanks in advance. > > Best, > Zach >  View this message in context: http://old.nabble.com/GNUPLOTFittingMultipleTextfilestp27355951p27358534.html Sent from the Gnuplot  User mailing list archive at Nabble.com. 
From: HansBernhard Bröker <HBB<roeker@t...>  20100128 22:23:30

super zach wrote: > Hi all > > I am trying to fit a function that takes data from two files. Is there a > way to do this using GNUPLOT? The request, as written, doesn't make sense. > I am trying to fit a lightcurve by considering light coming from two > sources, lets call them A & B. What do you consider a "light curve"? > I thus have two text files A.dat & B.dat that each contain three columns: > time / flux / flux error > > I have an equation I want to fit to these data files that roughly equates to > (though is actually more complicated): > > total_flux(x) = K*flux_A(x) + L*flux_B(x) where K & L are constants > I want to determine by fitting. And where do you intend total_flux(x) to come from? I don't think your description of what you're trying to do is workable, most likely because you've reduced it too far from what you're actually trying todo. You'll have to show an actual, complete example. What are those functions, what do they have to do with the data files, and what is it you're actually trying to achive? 