Commit 6e076595 authored by Heller, William T.'s avatar Heller, William T.
Browse files

Replace output.py

parent d5a1dd00
Loading
Loading
Loading
Loading
+20 −5
Original line number Diff line number Diff line
@@ -43,11 +43,17 @@ def outputSingleRes(conf, d, m, mnum, res):
        for i, p in enumerate(lres.params):
            if p.polydispersity is None:
                if p.kind not in ["fixed"]:
                    if p.kind in ["integer"]:
                        buff = "# "+str(p.name)+ " = %6d +/- %6.6f\n" %(p.val, p.unc)
                    else:
                        buff = "# "+str(p.name)+ " = %6.6f +/- %6.6f\n" %(p.val, p.unc)
                else:
                    buff = "# "+str(p.name)+ " = %6.6f; fixed\n" %(p.val)
            else: 
                if p.kind not in ["fixed"]:
                    if p.kind in ["integer"]:
                        buff = "# "+str(p.name)+ " = %6d +/- %6.6f, polydispersity %s = %6.6f +/- %6.6f\n" %(p.val, p.unc, str(p.polydispersity.kind), p.polydispersity.val, p.polydispersity.unc)
                    else:
                        buff = "# "+str(p.name)+ " = %6.6f +/- %6.6f, polydispersity %s = %6.6f +/- %6.6f\n" %(p.val, p.unc, str(p.polydispersity.kind), p.polydispersity.val, p.polydispersity.unc)
                else:
                    # the polydispersity parameter cannot be "fixed" at present
@@ -66,11 +72,17 @@ def outputSingleRes(conf, d, m, mnum, res):
            for i, sqp in enumerate(lres.sq.params):
                if sqp.polydispersity is None:
                    if sqp.kind not in ["fixed"]:
                        if sqp.kind in ["integer"]:
                            buff = "# " + str(sqp.name) + " = %6d +/- %6.6f \n" %(sqp.val, sqp.unc)
                        else:
                            buff = "# " + str(sqp.name) + " = %6.6f +/- %6.6f \n" %(sqp.val, sqp.unc)
                    else:
                        buff = "# " + str(sqp.name) + " = %6.6f; fixed \n" %(sqp.val)
                else: 
                    if sqp.kind not in ["fixed"]:
                        if sqp.kind in ["integer"]:
                            buff = "# " + str(sqp.name) + " = %6d +/- %6.6f, polydispersity %s = %6.6f +/- %6.6f\n" %(sqp.val, sqp.unc, str(sqp.polydispersity.kind), sqp.polydispersity.val, sqp.polydispersity.unc)
                        else:
                            buff = "# " + str(sqp.name) + " = %6.6f +/- %6.6f, polydispersity %s = %6.6f +/- %6.6f\n" %(sqp.val, sqp.unc, str(sqp.polydispersity.kind), sqp.polydispersity.val, sqp.polydispersity.unc)
                    else:
                        # the polydispersity parameter cannot be "fixed" at present
@@ -198,6 +210,9 @@ def outputSetRes(conf, res):
            buff = ""
            buff += "%6.6f\t" %(chisq[i])
            for j in range(0,parms):
                if varkinds[j] in ["integer"]:
                    buff += "%6d\t" %(vals[j][i])
                else:
                    buff += "%6.6f\t" %(vals[j][i])
            buff += "\n"
            f.write(buff)