# Set all temperature factors isotropic and equal to @4 for idx in range(1, 5): pf.constrain(pf.u11(idx), '@4') pf.constrain(pf.u22(idx), '@4') pf.constrain(pf.u33(idx), '@4') pf.setpar(4, pf.u11(1)) # Refine --------------------------------------------------------------------- pf.pdfrange(1, 1.5, 19.99) pf.refine() # Save results --------------------------------------------------------------- pf.save_pdf(1, "Ni_refinement.fgr") pf.save_struct(1, "Ni_refinement.rstr") pf.save_res("Ni_refinement.res") # Plot results --------------------------------------------------------------- # pylab is matplotlib interface with MATLAB-like plotting commands import pylab # obtain data from PdfFit calculator object r = pf.getR() Gobs = pf.getpdf_obs() Gfit = pf.getpdf_fit() # calculate difference curve, with pylab arrays it can be done # without for loop Gdiff = pylab.array(Gobs) - pylab.array(Gfit)