
Hi Philipp, You can find an expanded version of your script here: http://cci.lbl.gov/~rwgk/tmp/cctbx_examples/2007_06_17/ Use this command to generate a fake mtz file: iotbx.python random_f_calc.py P31 Then this command: iotbx.python mtz_to_map_and_back.py random_f_calcs.mtz FC1 FC2 This illustrates how to convert a manipulated map back to Fourier coefficients (via .structure_factors_from_map()) and write these out in MTZ format. In the example, the map manipulation is simply squaring the map. You can do anything else with the map from Python. For the FFT back to Fourier coefficients, you need a map over the unit cell. For maps, we don't have continuous asymmetric units (the map code pre-dates the ASU gallery). Instead, we have a "tag 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 symmetry", values >= 0 are the 1D indices of the symmetry-related unique point. See the code near the end of mtz_to_map_and_back.py. It shows a loop over the grid points accessing both the tag_array and the real_map. This loop is slow, of course, since it is in Python. It should be fast enough for prototyping, but I'd expect the final version to be implemented in C++, unless your manipulation can be formulated with existing array algebra, e.g. the flex.pow2() in the example, which already runs at C++ speed. Cheers, Ralf ____________________________________________________________________________________ Yahoo! oneSearch: Finally, mobile search that gives answers, not web links. http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC