Skip to content
Daniel Hoying edited this page Oct 24, 2019 · 12 revisions

Welcome to the lattice-fitter wiki!

how to run:

clone

then

cd to lattice-fitter/

then, to install, do (with admin priveleges)

python3 setup.py develop

to run, do
latfit <options, try -h for usage info>

to uninstall, do

python3 setup.py develop -u

in the lattice-fitter directory. Alternatively, if you have the dependencies installed, try
python3 -m latfit <input options go here. try -h for usage info>

there's no confirmed device dependent installation file yet. hopefully you have the dependencies already or can get them depending on error message.

Here's what it does (I'm mostly speaking colloquially below; don't take this too literally, I may not be getting my python terminology correct):

Process a whole bunch of files, or just one with a precomputed covariance matrix; then take that covariance matrix and averages and fit the function.

<everything below is out of date>
layout of the source code, in order of the program logic (try feeding -h to the program to see usage info)

format is

<submodules + descriptions>

top level latfit/
main -> main control program
globs -> global constants (needs documentation. try looking in setparams and mkmin for hints about what's going on)
procargs -> do simple error checking on command line inputs and then pass them to the main control, more error checking is done in the next package, errcheck

errcheck latfit/extract/errcheck
this part has the detailed error checking of the command line inputs. there are corresponding modules depending on which parameter the program is trying to extract from the user input. One module to note:
xstep_err -> It process command line input about the step size taken when processing a folder of files. It assumes that the step size is 1 unit if no input is given when the program (latfit) is initially called.

extract latfit/extract
file i/o is here
extract -> the main control part of the extraction tools, gets the covariance matrix and averages from file(s)
simple_proc_file, get_ccovandcoords -> get that stuff from a single file with a precomputed covariance matrix
proc_folder, proc_file -> get that stuff from a folder with a bunch of jackknife block data

checks latfit/checks
check the precomputed covariance matrix (clearly not called in the case of the user feeding in a whole folder with jackknife blocks)
for

  1. positive definiteness
  2. symmetry
  3. if the eigenvalues are too small (below global variable EIGCUT)

minimizer latfit/makemin
setparams -> set the number of initial parameters to feed into the minimizer (user given number)
DOFerrchk -> make sure the user hasn't given the fitter too few (<=0) degrees of freedom (number of plot points minus the number given to setparams
mkmin -> depending on which fit function is requested by the user (currently exponential and modified pade are supported), the program tries to minimize chi^2. it spits something out, which is given to finalout.
it also prints the values for the minimized parameters, as well as reduced chi^2 and DOF

finalout latfit/finalout
printerr -> find and print the errors in the minimized fit parameters
formula is sqrt(2H_ii^-1) where H_ii is the diagonal entry of the hessian of chi^2 where the derivatives are taken with respect to the fit parameters
mkplot -> plot the fitted result (the function of the minimized parameters and the data). save result as "foo.pdf". labels are hard coded at the moment.

Ok, but where are the chi^2 and fit function modules? Good question! They are under
math latfit/mathfun

todo:

  1. get an auditor of this code
  2. change hard codings (jackknife, labels, fit functions, start params) depending on user feedback
    If you read any of this and aren't me, thanks! Submit a pull request and I promise I'll take a look at it when I get the time.
Clone this wiki locally