User Tools

Site Tools


ufit:help:tips

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('MyBg', 'scale', "(lambda data: scipy.interpolate.interp1d(data[0], data[1], kind='cubic')(x) * scale)(numpy.loadtxt('C:\bg.txt').T)")

Replace C:\bg.txt with path to your ASCII file. MyBg can be also changed - this is just name of your model.

ufit/help/tips.txt · Last modified: 2017/10/24 07:28 by pcermak