- Timestamp:
- May 7, 2014 4:50:18 PM (11 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:
- e544c84
- Parents:
- f121904
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
test/park_integration/test/utest_fit_cylinder.py
rda5d8e8 rfb7180c 100 100 fitter.set_data(self.data1,1) 101 101 fitter.set_model(self.model1, 1, ['length','radius','scale']) 102 102 103 103 fitter.set_data(self.data2,2) 104 104 fitter.set_model(self.model2, 2, ['radius','scale']) … … 110 110 def test_park2(self): 111 111 """ Simultaneous cylinder model fit (park) """ 112 raise NotImplementedError() 113 result1,= self._fit('park') 112 result1, result2 = self._fit('park') 114 113 self.assert_(result1) 115 self.assertTrue(len(result1.pvec)>=0 ) 116 self.assertTrue(len(result1.stderr)>= 0) 117 118 for par in result1.parameters: 119 if par.name=='C1.length': 120 print par.name, par.value 121 self.assertTrue( math.fabs(par.value-400.0)/3.0 < par.stderr ) 122 elif par.name=='C1.radius': 123 print par.name, par.value 124 self.assertTrue( math.fabs(par.value-20.0)/3.0 < par.stderr ) 125 elif par.name=='C2.radius': 126 print par.name, par.value 127 self.assertTrue( math.fabs(par.value-40.0)/3.0 < par.stderr ) 128 elif par.name=='C1.scale': 129 print par.name, par.value 130 self.assertTrue( math.fabs(par.value-1.0)/3.0 < par.stderr ) 131 elif par.name=='C2.scale': 132 print par.name, par.value 133 self.assertTrue( math.fabs(par.value-1.0)/3.0 < par.stderr ) 134 114 self.assertTrue(len(result1.pvec)>0) 115 self.assertTrue(len(result1.stderr)>0) 116 117 for n, v, dv in zip(result1.param_list, result1.pvec, result1.stderr): 118 print "M1.%s = %s +/- %s"%(n,v,dv) 119 if n == "length": 120 self.assertTrue( math.fabs(v-400.0)/3.0 < dv ) 121 elif n=='radius': 122 self.assertTrue( math.fabs(v-20.0)/3.0 < dv ) 123 elif n=='scale': 124 self.assertTrue( math.fabs(v-1.0)/3.0 < dv ) 125 for n, v, dv in zip(result2.param_list, result2.pvec, result2.stderr): 126 print "M2.%s = %s +/- %s"%(n,v,dv) 127 if n=='radius': 128 self.assertTrue( math.fabs(v-40.0)/3.0 < dv ) 129 elif n=='scale': 130 self.assertTrue( math.fabs(v-1.0)/3.0 < dv ) 131 135 132 136 133 if __name__ == '__main__':
Note: See TracChangeset
for help on using the changeset viewer.