Yes, that&#39;s true, the padded arrays are a permanent struggle. A few days ago Nat changed the fft_map.real_map_unpadded() method to do the unpadding in place by default, to avoid memory overhead. That&#39;s probably the way to go in most situations.<div>
Ralf<br><br><div class="gmail_quote">On Tue, Oct 18, 2011 at 4:20 AM, Monarin Uervirojnangkoorn <span dir="ltr">&lt;<a href="mailto:monarin@biochem.uni-luebeck.de">monarin@biochem.uni-luebeck.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word">Thanks!. very useful. although doesn&#39;t really work with padded array (as in the case of real_map object). but found my way round.<div><br></div><div>best</div><div>mona<div><div></div>
<div class="h5"><br><div><div>On Oct 18, 2011, at 11:17 AM, Ralf Grosse-Kunstleve wrote:</div><br><blockquote type="cite">Hi Mona,<div><br></div><div>Try this:</div><div><br></div><div><div><font face="&#39;courier new&#39;, monospace">from scitbx.array_family import flex</font></div>
<div><font face="&#39;courier new&#39;, monospace">a=flex.double([1,4,5,7,5,6,6,1])</font></div>
<div><font face="&#39;courier new&#39;, monospace">a.set_selected(a &gt; 5, 5)</font></div><div><font face="&#39;courier new&#39;, monospace">print list(a)</font></div><div>
<br></div><div>Or in smaller steps:</div><div><br></div><div><div><font face="&#39;courier new&#39;, monospace">bool_selection = a &gt; 5</font></div><div><font face="&#39;courier new&#39;, monospace">assert bool_selection.size() == a.size()</font></div>

<div><font face="&#39;courier new&#39;, monospace">print list(bool_selection)</font></div><div><font face="&#39;courier new&#39;, monospace">a.set_selected(bool_selection, 5)</font></div>
<div><font face="&#39;courier new&#39;, monospace">print list(a)</font></div></div><div><br></div><div>You can also call <font face="&#39;courier new&#39;, monospace">a.set_selected(bool_selection, b)</font></div>
<div>where <font face="&#39;courier new&#39;, monospace">b</font> is an array with as many elements as you have <font face="&#39;courier new&#39;, monospace">True</font> in the <font face="&#39;courier new&#39;, monospace">bool_selection</font>.</div>

<div><br></div><div>This kind of working with selections is very typical within cctbx/phenix.</div><div>If you look through our sources you&#39;ll find a lot of examples; in passing, we have two types of selections, bool selections as above, and integer selections. The latter are useful for permutations, e.g. to sort array elements, or if you know you select only a small number of elements from a large array. Let me know if you have more questions about selections and I&#39;ll be happy to explain.�(I guess one day I should write a &quot;Working with selections&quot; tutorial.)</div>

<div><br></div><div>Ralf</div><div><br></div><div class="gmail_quote">On Tue, Oct 18, 2011 at 2:54 AM, Monarin Uervirojnangkoorn <span dir="ltr">&lt;<a href="mailto:monarin@biochem.uni-luebeck.de" target="_blank">monarin@biochem.uni-luebeck.de</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi,<div><br></div><div>I&#39;m using flex and &#39;d like to get an access to elements fall beyond/ below certain value. eg.</div>

<div>a=[1,4,5,7,5,6,6,1]</div><div>anything beyond 5 should be set to 5. (in matlab then a(a&gt;5)=5;)</div><div>if you could tell me how to do this quickly for flex, that would be great. for now i use loop and that is... pretty slow.</div>

<div><br></div><div>many thanks.</div><div>mona</div><div><br></div><div><br></div><div><br><div>
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><div style="word-wrap:break-word">

<div>^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^</div><div>Institute of Biochemistry,<br>Institut f�r Neuro- und Bioinformatik,<br>Graduate School for Computing in Medicine and Life Sciences<br>University of L�beck,<br>

Ratzeburger Allee 160<br>L�beck 23538<br>Germany<br>Tel: <a href="tel:%2B49451-5004072" value="+494515004072" target="_blank">+49451-5004072</a><br>Fax: <a href="tel:%2B49451-5004068" value="+494515004068" target="_blank">+49451-5004068</a></div>

<div><br></div></div></span><br></span><br>
</div>
<br></div></div><br>_______________________________________________<br>
cctbxbb mailing list<br>
<a href="mailto:cctbxbb@phenix-online.org" target="_blank">cctbxbb@phenix-online.org</a><br>
<a href="http://phenix-online.org/mailman/listinfo/cctbxbb" target="_blank">http://phenix-online.org/mailman/listinfo/cctbxbb</a><br>
<br></blockquote></div><br></div>
_______________________________________________<br>cctbxbb mailing list<br><a href="mailto:cctbxbb@phenix-online.org" target="_blank">cctbxbb@phenix-online.org</a><br><a href="http://phenix-online.org/mailman/listinfo/cctbxbb" target="_blank">http://phenix-online.org/mailman/listinfo/cctbxbb</a><br>
</blockquote></div><br><div>
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><div style="word-wrap:break-word">
<div>^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^</div><div>Institute of Biochemistry,<br>Institut f�r Neuro- und Bioinformatik,<br>Graduate School for Computing in Medicine and Life Sciences<br>University of L�beck,<br>
Ratzeburger Allee 160<br>L�beck 23538<br>Germany<br>Tel: <a href="tel:%2B49451-5004072" value="+494515004072" target="_blank">+49451-5004072</a><br>Fax: <a href="tel:%2B49451-5004068" value="+494515004068" target="_blank">+49451-5004068</a></div>
<div><br></div></div></span><br></span><br>
</div>
<br></div></div></div></div><br>_______________________________________________<br>
cctbxbb mailing list<br>
<a href="mailto:cctbxbb@phenix-online.org">cctbxbb@phenix-online.org</a><br>
<a href="http://phenix-online.org/mailman/listinfo/cctbxbb" target="_blank">http://phenix-online.org/mailman/listinfo/cctbxbb</a><br>
<br></blockquote></div><br></div>