User Tools

Site Tools


ufit:help:tips

This is an old revision of the document!


GUI Tips & Tricks

Change of all scan names

Open iPython console and write commands.

To see temperature in legend of charts:

  for aa in D:
       if hasattr(aa, 'data'):
           aa.data.oldname=aa.data.name
           aa.data.name=aa.data.environment[0]
           

To put some parameter to all scan titles (in this example it is parameter gamma):

  for aa in D:
       if hasattr(aa, 'data'):
           aa.data.oldtitle=aa.data.meta.title
           aa.data.meta.title += ', stt=%0.2f' % aa.data.meta.gamma

Fit curve from the file

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('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.1508753750.txt.gz · Last modified: 2017/10/23 10:15 by pcermak