<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><body>
<p>Hello Santiago,<br /><br />you can also try my iFit from http://ifit.mccode.org, and proceed with:<br /><br />>> a = iData('path_to_monitors');<br />>> renormalized = a/10;<br /><br />much more complex stuff can be done. Look at the doc. You can re-export the modified data sets in many formats.<br /><br />Emmanuel.<br /><br />Le 2017-06-01 18:13, Santiago Gómez a écrit :</p>
<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<pre>Dear Emmanuel,
thank for your reply, I will try to implement that. Anyway, I have to
renormalize all my monitor (about 10 or more), so I think the post
processing option mentioned by Andrew is also good, I will explore which
solution is most favorable for the way I am doing the different
simulations.
Best Regards
Santiago
On 2017-06-01 05:44, Emmanuel FARHI wrote:</pre>
<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px">Hello all, there is a way. Detector values are stored into a structure of type MCDETECTOR defined in _lib/share/mccode-r.h_, which can be retrieved e.g. in an instrument SAVE section. Then you can assemble an other data set to be exported as a 'normal' new monitor. TRACE COMPONENT BLAH = Monitor_nD(...) ... SAVE %{ /* get the detector structure */ MCDETECTOR det = MC_GETPAR(BLAH, detector); _/* then use any of: det.(field)_ _ double xmin,xmax; /* min max of axes */_ _ double ymin,ymax;_ _ double zmin,zmax;_ _ double intensity; /* integrated values for data block */_ _ double error;_ _ double events;_ _ double min; /* statistics for data block */_ _ double max;_ _ double mean;_ _ double centerX; /* statistics for axes */_ _ double halfwidthX;_ _ double centerY;_ _ double halfwidthY;_ _ int rank; /* dimensionaly of monitor, e.g. 0 1 2 3 */_ _ long m,n,p; /* dimensions of data block and along axes */_ _ double *p0, *p1, *p2; /* pointers to saved data, NULL when freed */_ _*/_ double NEW_ARRAY = malloc(sizeof(double)*det.m*det.n); _/* do not free the array as it will be wrtten to disk */_ double factor = 10; for (i=0; i<det.n*det.m; i++) { NEW_ARRAY[i] = det.p1[i] * factor; /* in this example we just multiply by factor=10 */ } /* generate new detector, with only the intensity, no sigma nor ncount per pixel */ DETECTOR_OUT_1D(title,xlabel,ylabel, "new_signal",det.xmin,det.xmax,det.m, NULL,&NEW_ARRAY[0],NULL,"filename"); DETECTOR_OUT_2D(title,xlabel,ylabel, det.xmin,det.xmax,det.ymin,det.ymax,det.m,det.n, NULL,&NEW_ARRAY[0],NULL,"filename"); %} END Emmanuel. On 06/01/2017 09:39 AM, Andrew Jackson wrote: Is there any simple way t -- Emmanuel FARHI,<a href="http://www.ill.eu/computing/people/emmanuel-farhi">www.ill.eu/computing/people/emmanuel-farhi</a> [1] |/ ____ |/ CS-Group ILL4/221, Institut Laue-Langevin (ILL) Grenoble ~@-/ oO -@~ 71 av des Martyrs,CS 20156,38042 Grenoble Cedex 9,France /_( __/ )_ Work :Tel (33/0) 4 76 20 71 35. Fax (33/0) 4 76 48 39 06 __U_/ Links: ------ [1] <a href="http://www.ill.eu/computing/people/emmanuel-farhi">http://www.ill.eu/computing/people/emmanuel-farhi</a></blockquote>
</blockquote>
<p> </p>
<div>
<pre>-- <br />FARHI Emmanuel <farhi@ill.fr>
Groupe DS/CS, ILL4/156, Tel (33) 4 76 20 71 35
ILL, Grenoble</pre>
</div>
</body></html>