<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hello all,</p>
<p><br>
</p>
<p>there is a way. Detector values are stored into a structure of
type MCDETECTOR defined in <i>lib/share/mccode-r.h</i>, 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.<br>
</p>
<p><font color="#3366ff"><tt>TRACE</tt></font></p>
<blockquote>
<p><tt>COMPONENT </tt><tt><b>blah</b></tt><tt> = Monitor_nD(...)</tt></p>
<p><tt>...<br>
</tt></p>
</blockquote>
<p><tt><font color="#3366ff">SAVE</font> %{</tt></p>
<blockquote>
<p><tt><font color="#33cc00">/* get the detector structure */</font><br>
</tt></p>
<p><tt>MCDETECTOR det = <b>MC_GETPAR</b>(</tt><tt><b>blah</b></tt><tt>,
detector);</tt></p>
<p><font color="#33cc00"><i><tt>/* then use any of: det.(field)</tt></i><i><tt><br>
</tt></i></font></p>
<p><font color="#33cc00"><i><tt> double
xmin,xmax; /* min max of axes */</tt></i><i><tt><br>
</tt></i><i><tt> double ymin,ymax;</tt></i><i><tt><br>
</tt></i><i><tt> double zmin,zmax;</tt></i><i><tt><br>
</tt></i><i><tt> double intensity; /*
integrated values for data block */</tt></i><i><tt><br>
</tt></i><i><tt> double error;</tt></i><i><tt><br>
</tt></i><i><tt> double events;</tt></i><i><tt><br>
</tt></i><i><tt> double min; /*
statistics for data block */</tt></i><i><tt><br>
</tt></i><i><tt> double max;</tt></i><i><tt><br>
</tt></i><i><tt> double mean;</tt></i><i><tt><br>
</tt></i><i><tt> double centerX; /*
statistics for axes */</tt></i><i><tt><br>
</tt></i><i><tt> double halfwidthX;</tt></i><i><tt><br>
</tt></i><i><tt> double centerY;</tt></i><i><tt><br>
</tt></i><i><tt> double halfwidthY;</tt></i><i><tt><br>
</tt></i><i><tt> int rank; /*
dimensionaly of monitor, e.g. 0 1 2 3 */</tt></i><i><tt><br>
</tt></i><i><tt><br>
</tt></i><i><tt> long m,n,p; /*
dimensions of data block and along axes */</tt></i><i><tt><br>
</tt></i><i><tt><br>
</tt></i><i><tt> double *p0, *p1, *p2; /*
pointers to saved data, NULL when freed */</tt></i></font></p>
<p><tt><font color="#33cc00"><i>*/</i></font><br>
</tt></p>
<p><tt>double <b>new_array</b> =
malloc(sizeof(double)*det.m*det.n);</tt><tt> <font
color="#33cc00"><i>/* do not free the array as it will be
wrtten to disk */</i></font></tt></p>
<p><tt>double factor = 10;</tt></p>
<p><tt>for (i=0; i<det.n*det.m; i++) {</tt></p>
<blockquote>
<p><tt><b>new_array</b>[i] = det.p1[i] * factor;</tt><tt> <font
color="#33cc00">/* in this example we just multiply by
factor=10 */</font><br>
</tt></p>
</blockquote>
<p><tt>}</tt><tt><br>
</tt></p>
<p><tt><font color="#33cc00">/* generate new detector, with only
the intensity, no sigma nor ncount per pixel */</font><br>
</tt></p>
<p><tt><b>DETECTOR_OUT_1D</b>(title,xlabel,ylabel,</tt></p>
<blockquote>
<p><tt><font color="#cc33cc">"new_signal"</font>,det.xmin,det.xmax,det.m,</tt></p>
<p><tt>NULL,</tt><tt><tt>&<b>new_array</b>[0]</tt>,NULL,<font
color="#cc33cc">"filename"</font>);</tt></p>
</blockquote>
<p><tt><br>
</tt></p>
<p><tt><b>DETECTOR_OUT_2D</b>(title,xlabel,ylabel,</tt></p>
<blockquote>
<p><tt>det.xmin,det.xmax,det.ymin,det.ymax,det.m,det.n,</tt></p>
<p><tt><tt>NULL,</tt><tt><tt>&<b>new_array</b>[0]</tt>,NULL,<font
color="#cc33cc">"filename"</font></tt>);</tt><tt><br>
</tt></p>
</blockquote>
</blockquote>
<p><tt>%}</tt></p>
<p><font color="#3366ff"><tt>END</tt></font><br>
</p>
<p><br>
</p>
<p>Emmanuel.<br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 06/01/2017 09:39 AM, Andrew Jackson
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:54A3E5E58388EE43.8DE24AF6-436F-450A-906F-3F22E724DEA2@mail.outlook.com">
<pre>Is there any simple way t</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Emmanuel FARHI,<a class="moz-txt-link-abbreviated" href="http://www.ill.eu/computing/people/emmanuel-farhi">www.ill.eu/computing/people/emmanuel-farhi</a> \|/ ____ \|/
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_/
</pre>
</body>
</html>