id summary reporter owner description type status priority milestone component resolution keywords cc workpackage 1171 Expose volume calculation in SasModels toqduj pkienzle "McSAS relies on the ability to weigh the contributions based on their volume in its optimisation routine. This means that we need to be able to get a volume for a given contribution from SasModels. At the moment, the kernel can be queried for the volume of the last-calculated iteration: {{{ kernel.result[kernel.q_input.nq] }}} Paul Kienzle commented on this a while back: "" For your case (without dispersion) the form_volume is already computed by the kernel and returned as the final element in the result. You should be able to grab it using kernel.result[kernel.q_input.nq] after calculating the kernel. This is a side-effect of the current implementation and not part of the formal interface; it will not work for pure python models, but should work for C models run as dll or as OpenCL. [...] If we were to make this a formal interface, we would need to generalize it to the case of dispersion-weighted volume average by additionally accumulating the sum of the weights in result[nq+1], then defining self.average_volume = result[nq]/result[nq+1]. Something similar could be done in the python kernel loop. "" " enhancement new major SasView 5.0.0 sasmodels sasmodels, mcsas pkienzle McSAS Integration Project