Skip to content

this program merges/combine data files, each data file contains number of (x,y) pairs. this program sums up y values from all files. if a x value is in file 1 but not in file 2, this program calculates the y value for file 2 using interpolation algorithm.

Notifications You must be signed in to change notification settings

magiccpp1/merge_curves

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

merge_curves 0.1
author:KEN DAI 
xiaodong.ken.dai@gmail.com
Apr 2015


this program merges data files, each data file contains number of (x,y) pairs. this program sums up y values from all files. if a x value is in file 1 but not in file 2, this program calculates the y value for file 2 using interpolation algorithm.

the number of input files is up to 8.

i.e.
dataset1
1.2 5.0
2.3 3.5
3.8 3.0

dataset2
0.8 2.0
1.5 3.0
2.5 4.0

output:
output:
0.8 0.0 2.0      # contribution from 1st array is 0, it is out of x range, from 2nd is 2.0
1.2 5.0 7.57     #5.0 + 2.0 + (1.2-0.8) * (3.0-2.0)/(1.5-0.8) contribution from 1st array is 5.0, from 2nd is 2.57
1.5 4.6 7.6      #3.0 + 5.0 + (1.5 - 1.2) * (3.5 - 5.0) / (2.3 - 1.2)  contribution from 1st array is 4.6, 2nd is 3.0
2.3  ...
2.5  ...
3.8  3.0 0.0     #contribution from 2nd array is 0, it is out of x range.

see https://github.com/magiccpp1/merge_curves/wiki


usage:
merge_curves -o output_file input_file1 input_file2 .... input_filen



About

this program merges/combine data files, each data file contains number of (x,y) pairs. this program sums up y values from all files. if a x value is in file 1 but not in file 2, this program calculates the y value for file 2 using interpolation algorithm.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published