User Tools

Site Tools


ufit:help:tips

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
ufit:help:tips [2017/10/23 10:12] pcermakufit:help:tips [2017/10/23 10:14] – [Fit background from the file] pcermak
Line 25: Line 25:
 It is possible to have a spectrum/background stored as a xy points in ASCII datafile. This command will load that file, interpolate between the loaded values and then fit the scale of such model. Just add this line to the **Model definition**: It is possible to have a spectrum/background stored as a xy points in ASCII datafile. This command will load that file, interpolate between the loaded values and then fit the scale of such model. Just add this line to the **Model definition**:
            
-     Custom('MyBg', 'scale', "scipy.interpolate.interp1d(numpy.loadtxt('I:\Documents\Playground\sinus.txt').T[0], numpy.loadtxt('I:\Documents\Playground\sinus.txt').T[1], kind='cubic')(x) * scale")+     Custom('MyBackground', 'scale', "scipy.interpolate.interp1d(numpy.loadtxt('C:\bg.txt').T[0], numpy.loadtxt('C:\bg.txt').T[1], kind='cubic')(x) * scale") 
 + 
 +Replace **both** 'C:\bg.txt' with path to your ASCII file. 
ufit/help/tips.txt · Last modified: 2017/10/24 07:28 by pcermak