对称生成随机场的简单封装。
项目描述
FyeldGenerator 存储库
该软件包提供了一种快速生成具有指定功率谱的随机场的方法。
例子
from FyeldGenerator import generate_field
import matplotlib.pyplot as plt
import numpy as np
# Helper that generates power-law power spectrum
def Pkgen(n):
def Pk(k):
return np.power(k, -n)
return Pk
# Draw samples from a normal distribution
def distrib(shape):
a = np.random.normal(loc=0, scale=1, size=shape)
b = np.random.normal(loc=0, scale=1, size=shape)
return a + 1j * b
shape = (512, 512)
field = generate_field(distrib, Pkgen(2), shape)
plt.imshow(field, cmap="seismic")
安装
它现在在 pypi 上!对于“官方”版本,请使用:
pip install FyeldGenerator
对于最新版本:
pip install -e git+https://github.com/cphyc/FyeldGenerator.git#egg=FyeldGenerator
执照
本作品在 CC-BY-SA 许可下获得许可。只要您保留许可证,您就可以复制、修改和分发它。在 LICENSE 文件中查看更多信息。
项目详情
关
FyeldGenerator -0.1.7.tar.gz 的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 7f7bf86469006c8f41b96f070a6f196ed59ea488bab9daf495da358ea2146c19 |
|
| MD5 | 020558f74d08fcec572fee01b63d8122 |
|
| 布莱克2-256 | 145719d19ecb4750b68eca303f6a2561d37988b282203a3843f68d7e0c0cb578 |
关
FyeldGenerator -0.1.7-py3-none-any.whl 的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 166e5a5f537de07c341e23b9c08553e5334860127f05ae99da12677442aa9126 |
|
| MD5 | 0de039c2fa1fa6249aed42032b7b0176 |
|
| 布莱克2-256 | 01dfc356d5b38a890f845261d6395df8f343194e4049df90cf05e9bef4157b0a |