@@ -10,7 +10,7 @@ def ntheta(L: int = None, sampling: str = "mw", nside: int = None) -> int:
1010 Defaults to None.
1111
1212 sampling (str, optional): Sampling scheme. Supported sampling schemes include
13- {"mw", "mwss", "dh", "healpix"}. Defaults to "mw".
13+ {"mw", "mwss", "dh", "gl", " healpix"}. Defaults to "mw".
1414
1515 nside (int, optional): HEALPix Nside resolution parameter. Only required
1616 if sampling="healpix". Defaults to None.
@@ -31,7 +31,7 @@ def ntheta(L: int = None, sampling: str = "mw", nside: int = None) -> int:
3131 f"Sampling scheme sampling={ sampling } with L={ L } not supported"
3232 )
3333
34- if sampling .lower () == "mw" :
34+ if sampling .lower () in [ "mw" , "gl" ] :
3535 return L
3636
3737 elif sampling .lower () == "mwss" :
@@ -93,7 +93,7 @@ def nphi_equiang(L: int, sampling: str = "mw") -> int:
9393 L (int): Harmonic band-limit.
9494
9595 sampling (str, optional): Sampling scheme. Supported sampling schemes include
96- {"mw", "mwss", "dh"}. Defaults to "mw".
96+ {"mw", "mwss", "dh", "gl" }. Defaults to "mw".
9797
9898 Raises:
9999 ValueError: HEALPix sampling scheme.
@@ -104,7 +104,7 @@ def nphi_equiang(L: int, sampling: str = "mw") -> int:
104104 int: Number of :math:`\phi` samples.
105105 """
106106
107- if sampling .lower () == "mw" :
107+ if sampling .lower () in [ "mw" , "gl" ] :
108108 return 2 * L - 1
109109
110110 elif sampling .lower () == "mwss" :
@@ -129,7 +129,7 @@ def ftm_shape(L: int, sampling: str = "mw", nside: int = None) -> Tuple[int, int
129129 L (int): Harmonic band-limit.
130130
131131 sampling (str, optional): Sampling scheme. Supported sampling schemes include
132- {"mw", "mwss", "dh", "healpix"}. Defaults to "mw".
132+ {"mw", "mwss", "dh", "gl", " healpix"}. Defaults to "mw".
133133
134134 nside (int, optional): HEALPix Nside resolution parameter.
135135
@@ -144,7 +144,7 @@ def ftm_shape(L: int, sampling: str = "mw", nside: int = None) -> Tuple[int, int
144144 if sampling .lower () in ["mwss" , "healpix" ]:
145145 return ntheta (L , sampling , nside ), 2 * L
146146
147- elif sampling .lower () in ["mw" , "dh" ]:
147+ elif sampling .lower () in ["mw" , "dh" , "gl" ]:
148148 return ntheta (L , sampling , nside ), 2 * L - 1
149149
150150 else :
@@ -203,14 +203,17 @@ def thetas(L: int = None, sampling: str = "mw", nside: int = None) -> np.ndarray
203203 Defaults to None.
204204
205205 sampling (str, optional): Sampling scheme. Supported sampling schemes include
206- {"mw", "mwss", "dh", "healpix"}. Defaults to "mw".
206+ {"mw", "mwss", "dh", "gl", " healpix"}. Defaults to "mw".
207207
208208 nside (int, optional): HEALPix Nside resolution parameter. Only required
209209 if sampling="healpix". Defaults to None.
210210
211211 Returns:
212212 np.ndarray: Array of :math:`\theta` samples for given sampling scheme.
213213 """
214+ if sampling .lower () == "gl" :
215+ return np .flip (np .arccos (np .polynomial .legendre .leggauss (L )[0 ]))
216+
214217 t = np .arange (0 , ntheta (L = L , sampling = sampling , nside = nside )).astype (np .float64 )
215218
216219 return t2theta (t , L , sampling , nside )
@@ -228,7 +231,7 @@ def t2theta(
228231 Defaults to None.
229232
230233 sampling (str, optional): Sampling scheme. Supported sampling schemes include
231- {"mw", "mwss", "dh", "healpix"}. Defaults to "mw".
234+ {"mw", "mwss", "dh", "gl", " healpix"}. Defaults to "mw".
232235
233236 nside (int, optional): HEALPix Nside resolution parameter. Only required
234237 if sampling="healpix". Defaults to None.
@@ -346,7 +349,7 @@ def phis_equiang(L: int, sampling: str = "mw") -> np.ndarray:
346349 L (int, optional): Harmonic band-limit.
347350
348351 sampling (str, optional): Sampling scheme. Supported equiangular sampling
349- schemes include {"mw", "mwss", "dh"}. Defaults to "mw".
352+ schemes include {"mw", "mwss", "dh", "gl" }. Defaults to "mw".
350353
351354 Returns:
352355 np.ndarray: Array of :math:`\phi` samples for given sampling scheme.
@@ -365,7 +368,7 @@ def p2phi_equiang(L: int, p: int, sampling: str = "mw") -> np.ndarray:
365368 p (int): :math:`\phi` index.
366369
367370 sampling (str, optional): Sampling scheme. Supported equiangular sampling
368- schemes include {"mw", "mwss", "dh"}. Defaults to "mw".
371+ schemes include {"mw", "mwss", "dh", "gl" }. Defaults to "mw".
369372
370373 Raises:
371374 ValueError: HEALPix sampling not support (only equiangular schemes supported).
@@ -376,7 +379,7 @@ def p2phi_equiang(L: int, p: int, sampling: str = "mw") -> np.ndarray:
376379 np.ndarray: :math:`\phi` sample(s) for given sampling scheme.
377380 """
378381
379- if sampling .lower () == "mw" :
382+ if sampling .lower () in [ "mw" , "gl" ] :
380383 return 2 * p * np .pi / (2 * L - 1 )
381384
382385 elif sampling .lower () == "mwss" :
@@ -431,7 +434,7 @@ def f_shape(L: int = None, sampling: str = "mw", nside: int = None) -> Tuple[int
431434 L (int, optional): Harmonic band-limit.
432435
433436 sampling (str, optional): Sampling scheme. Supported sampling schemes include
434- {"mw", "mwss", "dh", "healpix"}. Defaults to "mw".
437+ {"mw", "mwss", "dh", "gl", " healpix"}. Defaults to "mw".
435438
436439 nside (int, optional): HEALPix Nside resolution parameter. Only required
437440 if sampling="healpix". Defaults to None.
0 commit comments