Bingjie Wang
Bingjie Wang

Reputation: 75

healpy synfast: how to define the random seed

I'm using healpy.synfast to create maps, but it seems that healpy does not have the "iseed" function (as in here: http://healpix.jpl.nasa.gov/html/facilitiesnode14.htm) which let me define the random seed to be used for the generation of alms from the power spectrum.

Could anyone tell me how to achieve the "iseed" function in healpy? Thanks!

Upvotes: 3

Views: 923

Answers (1)

Andrea Zonca
Andrea Zonca

Reputation: 8773

healpy internally uses np.random.standard_normal to generate the real and imaginary components of the alms, see sphtfunc.py.

Therefore you can use the numpy.random.seed function to set the seed, as:

numpy.random.seed(1234)

before running synfast.

Upvotes: 3

Related Questions