本文整理汇总了Python中pyfftw.FFTW属性的典型用法代码示例。如果您正苦于以下问题:Python pyfftw.FFTW属性的具体用法?Python pyfftw.FFTW怎么用?Python pyfftw.FFTW使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类pyfftw
的用法示例。
在下文中一共展示了pyfftw.FFTW属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _pyfftw_destroys_input
# 需要导入模块: import pyfftw [as 别名]
# 或者: from pyfftw import FFTW [as 别名]
def _pyfftw_destroys_input(flags, direction, halfcomplex, ndim):
"""Return ``True`` if FFTW destroys an input array, ``False`` otherwise."""
if any(flag in flags or _flag_pyfftw_to_odl(flag) in flags
for flag in ('FFTW_MEASURE', 'FFTW_PATIENT', 'FFTW_EXHAUSTIVE',
'FFTW_DESTROY_INPUT')):
return True
elif (direction in ('backward', 'FFTW_BACKWARD') and halfcomplex and
ndim != 1):
return True
else:
return False
示例2: initFFTs
# 需要导入模块: import pyfftw [as 别名]
# 或者: from pyfftw import FFTW [as 别名]
def initFFTs(self):
"""
Initialise the FFT Objects required for running the WFS
Initialised various FFT objects which are used through the WFS,
these include FFTs to calculate focal planes, and to convolve LGS
PSFs with the focal planes
"""
#Calculate the FFT padding to use
self.subapFFTPadding = self.nx_subap_pixels_oversize * self.config.fftOversamp
if self.subapFFTPadding < self.nx_subap_interp:
while self.subapFFTPadding<self.nx_subap_interp:
self.config.fftOversamp+=1
self.subapFFTPadding\
=self.nx_subap_pixels_oversize*self.config.fftOversamp
logger.warning("requested WFS FFT Padding less than FOV size... Setting oversampling to: %d"%self.config.fftOversamp)
#Init the FFT to the focal plane
# self.FFT = AOFFT.FFT(
# inputSize=(
# self.n_subaps, self.subapFFTPadding, self.subapFFTPadding),
# axes=(-2,-1), mode="pyfftw",dtype=CDTYPE,
# THREADS=self.threads,
# fftw_FLAGS=(self.config.fftwFlag,"FFTW_DESTROY_INPUT"))
self.fft_input_data = pyfftw.empty_aligned(
(self.n_subaps, self.subapFFTPadding, self.subapFFTPadding), dtype=CDTYPE)
self.fft_output_data = pyfftw.empty_aligned(
(self.n_subaps, self.subapFFTPadding, self.subapFFTPadding), dtype=CDTYPE)
self.FFT = pyfftw.FFTW(
self.fft_input_data, self.fft_output_data, axes=(-2, -1),
threads=self.threads, flags=(self.config.fftwFlag, "FFTW_DESTROY_INPUT")
)
# If LGS uplink, init FFTs to conovolve LGS PSF and WFS PSF(s)
# This works even if no lgsConfig.uplink as ``and`` short circuits
if self.lgsConfig and self.lgsConfig.uplink:
self.ifft_input_data = pyfftw.empty_aligned(
(self.n_subaps, self.subapFFTPadding, self.subapFFTPadding), dtype=CDTYPE)
self.ifft_output_data = pyfftw.empty_aligned(
(self.n_subaps, self.subapFFTPadding, self.subapFFTPadding), dtype=CDTYPE)
self.iFFT = pyfftw.FFTW(
self.ifft_input_data, self.ifft_output_data, axes=(-2, -1),
threads=self.threads, flags=(self.config.fftwFlag, "FFTW_DESTROY_INPUT"),
direction="FFTW_BACKWARD"
)
self.lgs_ifft_input_data = pyfftw.empty_aligned(
(self.subapFFTPadding, self.subapFFTPadding), dtype=CDTYPE)
self.lgs_ifft_output_data = pyfftw.empty_aligned(
(self.subapFFTPadding, self.subapFFTPadding), dtype=CDTYPE)
self.lgs_iFFT = pyfftw.FFTW(
self.lgs_ifft_input_data, self.lgs_ifft_output_data, axes=(0, 1),
threads=self.threads, flags=(self.config.fftwFlag, "FFTW_DESTROY_INPUT"),
direction="FFTW_BACKWARD"
)