Changeset 792db7d5 in sasview for park_integration/test/constrainttestpark.py
- Timestamp:
- Jul 8, 2008 9:48:38 AM (16 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 6e0f53a
- Parents:
- 1c94a9f1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
park_integration/test/constrainttestpark.py
rcf3b781 r792db7d5 10 10 11 11 def test2models2dataonconstraint(self): 12 """ test fitting for two set of data and one model with aconstraint"""12 """ test fitting for two set of data and one model with 2 constraint""" 13 13 from sans.fit.Loader import Load 14 14 load= Load() … … 42 42 engine.set_param( model2,"M2", {'A':'M1.A','B':'M1.B'}) 43 43 engine.set_model(model2,2) 44 44 45 engine.set_data(data2,2) 45 46 46 47 47 printengine.fit({'A':2,'B':1},None,None)48 if True:49 import pylab50 x1 = engine.problem[0].data.x51 x2 = engine.problem[1].data.x52 y1 = engine.problem[0].data.y53 y2 = engine.problem[1].data.y54 fx1 = engine.problem[0].data.fx55 fx2 = engine.problem[1].data.fx56 pylab.plot(x1,y1,'xb',x1,fx1,'-b',x2,y2,'xr',x2,fx2,'-r')57 pylab.show()48 chisqr2, out2, cov2= engine.fit({'A':2,'B':1},None,None) 49 print "chisqr2",chisqr2 50 print "out2", out2 51 print " cov2", cov2 52 print chisqr2/len(data1.x) 53 54 self.assert_(math.fabs(out2[1]-2.5)/math.sqrt(cov2[1][1]) < 2) 55 self.assert_(math.fabs(out2[0]-4.0)/math.sqrt(cov2[0][0]) < 2) 56 #self.assert_(chisqr2/len(data1.x) < 2) 57 #self.assert_(chisqr2/len(data2.x) < 2) 58
Note: See TracChangeset
for help on using the changeset viewer.