Changeset 007f9b3 in sasview for pr_inversion
- Timestamp:
- Nov 22, 2011 2:18:22 PM (13 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:
- 641166b
- Parents:
- d404f19
- Location:
- pr_inversion
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pr_inversion/src/sans/pr/c_extensions/Cinvertor.c
rc04cbd7 r007f9b3 700 700 if (!PyArg_ParseTuple(args, "OOd", &data_obj, &err_obj, &r)) return NULL; 701 701 OUTVECTOR(data_obj,pars,npars); 702 OUTVECTOR(err_obj,pars_err,npars2); 703 704 pr_err(pars, pars_err, self->params.d_max, npars, r, &pr_value, &pr_err_value); 702 703 if (err_obj == Py_None) { 704 pr_value = pr(pars, self->params.d_max, npars, r); 705 pr_err_value = 0.0; 706 } else { 707 OUTVECTOR(err_obj,pars_err,npars2); 708 pr_err(pars, pars_err, self->params.d_max, npars, r, &pr_value, &pr_err_value); 709 } 705 710 return Py_BuildValue("ff", pr_value, pr_err_value); 706 711 } -
pr_inversion/src/sans/pr/invertor.py
r8c44b2c r007f9b3 319 319 t_0 = time.time() 320 320 out, cov_x, _, _, _ = optimize.leastsq(self.residuals, 321 p, full_output=1, 322 warning=True) 321 p, full_output=1) 323 322 324 323 # Compute chi^2 … … 333 332 self.elapsed = time.time() - t_0 334 333 334 if cov_x is None: 335 cov_x = numpy.ones([nfunc,nfunc]) 336 cov_x *= math.fabs(chisqr) 335 337 return out, cov_x 336 338 … … 353 355 t_0 = time.time() 354 356 out, cov_x, info, mesg, success = optimize.leastsq(self.pr_residuals, p, 355 full_output=1, 356 warning=True) 357 full_output=1) 357 358 358 359 # Compute chi^2 -
pr_inversion/test/utest_invertor.py
r97d69d9 r007f9b3 481 481 self.invertor.err = err 482 482 # Perform inversion 483 self.assertRaises( ValueError, self.invertor.invert, 10)483 self.assertRaises(numpy.linalg.LinAlgError, self.invertor.invert, 10) 484 484 485 485
Note: See TracChangeset
for help on using the changeset viewer.