<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div style="font-family: courier,monaco,monospace,sans-serif; font-size: 12pt;">Hi Philipp,<br><br>You can find an expanded version of your script here:<br><br><span>&nbsp; <a target="_blank" href="http://cci.lbl.gov/%7Erwgk/tmp/cctbx_examples/2007_06_17/">http://cci.lbl.gov/~rwgk/tmp/cctbx_examples/2007_06_17/</a></span><br><br>Use this command to generate a fake mtz file:<br><br>&nbsp; iotbx.python random_f_calc.py P31<br><br>Then this command:<br><br>&nbsp; iotbx.python mtz_to_map_and_back.py random_f_calcs.mtz FC1 FC2<br><br>This illustrates how to convert a manipulated map back to Fourier<br>coefficients (via .structure_factors_from_map()) and write these<br>out in MTZ format.<br><br>In the example, the map manipulation is simply squaring the map.<br>You can do anything else with the map from Python.<br><br>For
 the FFT back to Fourier coefficients, you need a map over the<br>unit cell. For maps, we don't have continuous asymmetric units<br>(the map code pre-dates the ASU gallery). Instead, we have a "tag<br>array" of integer values with the same gridding as the data map. An integer value less than 0 means "this grid point is unique under<br>symmetry", values &gt;= 0 are the 1D indices of the symmetry-related<br>unique point. See the code near the end of mtz_to_map_and_back.py.<br>It shows a loop over the grid points accessing both the tag_array and<br>the real_map. This loop is slow, of course, since it is in Python. It<br>should be fast enough for prototyping, but I'd expect the final<br>version to be implemented in C++, unless your manipulation can<br>be formulated with existing array algebra, e.g. the flex.pow2()<br>in the example, which already runs at C++ speed.<br><br>Cheers,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ralf<br><br></div></div><br>
      <hr size=1><a href="http://us.rd.yahoo.com/evt=48250/*http://searchmarketing.yahoo.com/arp/sponsoredsearch_v9.php?o=US2226&cmp=Yahoo&ctv=AprNI&s=Y&s2=EM&b=50">Pinpoint customers </a>who are looking for what you sell. 

</body></html>