本文整理匯總了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"
)