Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'seed' argument to gaussian_random_field #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions gaussian_random_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def fftind(size):

def gaussian_random_field(alpha = 3.0,
size = 128,
flag_normalize = True):
flag_normalize = True,
seed = None):
""" Returns a numpy array of shifted Fourier coordinates k_x k_y.

Input args:
Expand All @@ -70,7 +71,8 @@ def gaussian_random_field(alpha = 3.0,
example = gaussian_random_field()
plt.imshow(example)
"""

# Set random seed for reproducable results
numpy.random.seed(seed)
# Defines momentum indices
k_idx = fftind(size)

Expand Down