2014-07-26 198 views
1

我不斷收到以下錯誤運行腳本時保存動畫:FFT運行時錯誤在運行Galsim

RuntimeError: SB Error: fourierDraw() requires an FFT that is too large, 6144 
If you can handle the large FFT, you may update gsparams.maximum_fft_size. 

於是我走進/Galsim/include/galsim/GSparams.h

和我從maximum_fft_size改變以下

maximum_fft_size(16384)(4096)

或2^14從2^12。

我仍然得到和以前一樣的錯誤。我應該重新啓動我的機器嗎?

回答

1

這不是要在哪裏更改maximum_fft_size參數。有關如何使用GSParams對象和更新參數的示例,請參見demo7。 GSObject的文檔字符串中也有一個示例:

>>> gal = galsim.Sersic(n=4, half_light_radius=4.3) 
    >>> psf = galsim.Moffat(beta=3, fwhm=2.85) 
    >>> conv = galsim.Convolve([gal,psf]) 
    >>> im = galsim.Image(1000,1000, scale=0.05)  # Note the very small pixel scale! 
    >>> im = conv.drawImage(image=im)     # This uses the default GSParams. 
    Traceback (most recent call last): 
     File "<stdin>", line 1, in <module> 
     File "galsim/base.py", line 1236, in drawImage 
     image.added_flux = prof.SBProfile.draw(imview.image, gain, wmult) 
    RuntimeError: SB Error: fourierDraw() requires an FFT that is too large, 6144 
    If you can handle the large FFT, you may update gsparams.maximum_fft_size. 
    >>> big_fft_params = galsim.GSParams(maximum_fft_size=10240) 
    >>> conv = galsim.Convolve([gal,psf],gsparams=big_fft_params) 
    >>> im = conv.drawImage(image=im)     # Now it works (but is slow!) 
    >>> im.write('high_res_sersic.fits') 
+0

感謝@Mike Jarvis!應該現在工作。 – alvarezcl