I am confused about grid sizes of maps. When i specify a grid size for an fft_map but then pull the numpy array out for direct manimpulation, it's always 2 larger in the last dimension. Why is it not the same size? Any help appreciated. George y# Now make initial (smoothed) map using random phases with Fobs f_obs_B = f_obs1.apply_debye_waller_factors( b_iso=biso_init) phases = f_obs_B.random_phases_compatible_with_phase_restrictions(deg=False) phases_data = phases.data() e_map_coeff = f_obs_B.phase_transfer(phase_source = phases_data) e_map = e_map_coeff.fft_map(crystal_gridding = crystal_gridding, symmetry_flags = maptbx.use_space_group_symmetry) print("cgridding", crystal_gridding.n_real()) # pick initial envelope e_map_array = e_map.real_map().as_numpy_array() print("e_map", e_map_array.shape) cgridding (90, 90, 80) e_map (90, 90, 82) George N. Phillips, Jr., Ph.D. Professor Emeritus University of Wisconsin-Madison 433 Babcock Dr. Madison, Wi 53706 Phone 713 348 6951 (Houston)
Hi George, map gridding is automatically defined such so it is compatible with FFT requirements. Instead of e_map_array = e_map.real_map() try e_map_array = e_map.real_map_unpadded() Pavel On 2/13/20 13:41, GEORGE N PHILLIPS wrote:
I am confused about grid sizes of maps.
When i specify a grid size for an fft_map but then pull the numpy array out for direct manimpulation, it's always 2 larger in the last dimension.
Why is it not the same size? Any help appreciated.
George
y# Now make initial (smoothed) map using random phases with Fobs f_obs_B = f_obs1.apply_debye_waller_factors( b_iso=biso_init) phases = f_obs_B.random_phases_compatible_with_phase_restrictions(deg=False) phases_data = phases.data() e_map_coeff = f_obs_B.phase_transfer(phase_source = phases_data) e_map = e_map_coeff.fft_map(crystal_gridding = crystal_gridding, symmetry_flags = maptbx.use_space_group_symmetry) print("cgridding", crystal_gridding.n_real()) # pick initial envelope e_map_array = e_map.real_map().as_numpy_array() print("e_map", e_map_array.shape)
cgridding (90, 90, 80) e_map (90, 90, 82)
George N. Phillips, Jr., Ph.D. Professor Emeritus University of Wisconsin-Madison 433 Babcock Dr. Madison, Wi 53706 Phone 713 348 6951 (Houston)
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
Possibly because the "Fast" aspect of the "FFT" requires the map size to
have a prime factorization of small factors, generally combinations of
powers of 2, 3, 5, 7, and 11, in order for the algorithm to work. Here's
some basic documentation from the web:
http://www.fftw.org/fftw2_doc/fftw_3.html
Nick
Nicholas K. Sauter, Ph. D.
Senior Scientist, Molecular Biophysics & Integrated Bioimaging Division
Lawrence Berkeley National Laboratory
1 Cyclotron Rd., Bldg. 33R0345
Berkeley, CA 94720
(510) 486-5713
On Tue, Feb 18, 2020 at 9:43 AM GEORGE N PHILLIPS
I am confused about grid sizes of maps.
When i specify a grid size for an fft_map but then pull the numpy array out for direct manimpulation, it's always 2 larger in the last dimension.
Why is it not the same size? Any help appreciated.
George
y# Now make initial (smoothed) map using random phases with Fobs f_obs_B = f_obs1.apply_debye_waller_factors( b_iso=biso_init) phases = f_obs_B.random_phases_compatible_with_phase_restrictions(deg=False) phases_data = phases.data() e_map_coeff = f_obs_B.phase_transfer(phase_source = phases_data) e_map = e_map_coeff.fft_map(crystal_gridding = crystal_gridding, symmetry_flags = maptbx.use_space_group_symmetry) print("cgridding", crystal_gridding.n_real()) # pick initial envelope e_map_array = e_map.real_map().as_numpy_array() print("e_map", e_map_array.shape)
cgridding (90, 90, 80) e_map (90, 90, 82)
George N. Phillips, Jr., Ph.D. Professor Emeritus University of Wisconsin-Madison 433 Babcock Dr. Madison, Wi 53706 Phone 713 348 6951 (Houston)
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
FFT's require as many small prime factors as possible (which one of two reasons powers of two are preferred), but another factor is that the Hermitian symmetry of the electron density map (F(h,k,l) = F*(-h,-k,-l)) means not only that the F(0) term is real, but also (if there are an even number of points) the F(N/2) term is real, since we are dealing with finite discrete transforms rather than integral continuous transforms. This give the implementor a choice -- either pack the extra real number in the imaginary part of the F(0) term, or create an extra scratch location at the end of the (complex) array. In the first case you have to do some special case code, and in the second case you have to burn some memory.
Back in the 1960's and 1970's when I wrote my FFT routines for crystallography memory was VERY expensive so I optimized memory use. It is easier to stick the extra location at the end of the row, but you have to account for it in the indexing calculations.
Lynn Ten Eyck
________________________________________
From: [email protected]
participants (4)
-
GEORGE N PHILLIPS
-
Nicholas Sauter
-
Pavel Afonine
-
Ten Eyck, Lynn