@@ -165,24 +165,24 @@ def lognormal_gls(cls, shift=1., *, lmax=None, ncorr=None, nside=None):
165
165
return transform_cls (gls , 'lognormal' , (shift ,))
166
166
167
167
168
- def generate_gaussian (cls , nside , * , ncorr = None , rng = None ):
168
+ def generate_gaussian (gls , nside , * , ncorr = None , rng = None ):
169
169
'''Iteratively sample Gaussian random fields from Cls.
170
170
171
171
A generator that iteratively samples HEALPix maps of Gaussian random fields
172
- with the given angular power spectra ``cls `` and resolution parameter
172
+ with the given angular power spectra ``gls `` and resolution parameter
173
173
``nside``.
174
174
175
175
The optional argument ``ncorr`` can be used to artificially limit now many
176
176
realised fields are correlated. This saves memory, as only `ncorr` previous
177
177
fields need to be kept.
178
178
179
- The ``cls `` array must contain the auto-correlation of each new field
179
+ The ``gls `` array must contain the auto-correlation of each new field
180
180
followed by the cross-correlations with all previous fields in reverse
181
181
order::
182
182
183
- cls = [cl_00 ,
184
- cl_11, cl_10 ,
185
- cl_22, cl_21, cl_20 ,
183
+ gls = [gl_00 ,
184
+ gl_11, gl_10 ,
185
+ gl_22, gl_21, gl_20 ,
186
186
...]
187
187
188
188
Missing entries can be set to ``None``.
@@ -193,21 +193,21 @@ def generate_gaussian(cls, nside, *, ncorr=None, rng=None):
193
193
if rng is None :
194
194
rng = np .random .default_rng ()
195
195
196
- # number of cls and number of fields
197
- ncls = len (cls )
198
- ngrf = int ((2 * ncls )** 0.5 )
196
+ # number of gls and number of fields
197
+ ngls = len (gls )
198
+ ngrf = int ((2 * ngls )** 0.5 )
199
199
200
200
# number of correlated fields if not specified
201
201
if ncorr is None :
202
202
ncorr = ngrf - 1
203
203
204
204
# number of modes
205
- n = max ((len (cl ) for cl in cls if cl is not None ), default = 0 )
205
+ n = max ((len (gl ) for gl in gls if gl is not None ), default = 0 )
206
206
if n == 0 :
207
- raise ValueError ('all cls are empty' )
207
+ raise ValueError ('all gls are empty' )
208
208
209
209
# generates the covariance matrix for the iterative sampler
210
- cov = cls2cov (cls , n , ngrf , ncorr )
210
+ cov = cls2cov (gls , n , ngrf , ncorr )
211
211
212
212
# working arrays for the iterative sampling
213
213
z = np .zeros (n * (n + 1 )// 2 , dtype = np .complex128 )
@@ -247,9 +247,9 @@ def generate_lognormal(gls, nside, shift=1., *, ncorr=None, rng=None):
247
247
'''Iterative sample lognormal random fields from Gaussian Cls.'''
248
248
for i , m in enumerate (generate_gaussian (gls , nside , ncorr = ncorr , rng = rng )):
249
249
# compute the variance of the auto-correlation
250
- cl = gls [i * (i + 1 )// 2 ]
251
- ell = np .arange (len (cl ))
252
- var = np .sum ((2 * ell + 1 )* cl )/ (4 * np .pi )
250
+ gl = gls [i * (i + 1 )// 2 ]
251
+ ell = np .arange (len (gl ))
252
+ var = np .sum ((2 * ell + 1 )* gl )/ (4 * np .pi )
253
253
254
254
# fix mean of the Gaussian random field for lognormal transformation
255
255
m -= var / 2
0 commit comments