|
7 | 7 | from ..systematics import IdentityFunctionMOR, TopHatSelectionFunction |
8 | 8 |
|
9 | 9 |
|
10 | | -__all__ = ['WLSource', 'NumberCountsSource', 'ClusterSource'] |
| 10 | +__all__ = ['WLSource', 'NumberCountsSource', 'ClusterSource', 'CMBLSource'] |
11 | 11 |
|
12 | 12 |
|
13 | 13 | class WLSource(Source): |
@@ -374,3 +374,72 @@ def render(self, cosmo, params, systematics=None): |
374 | 374 | systematics[systematic].apply(cosmo, params, self) |
375 | 375 |
|
376 | 376 | self.dndz_interp_ = Akima1DInterpolator(self.z_, self.dndz_) |
| 377 | + |
| 378 | + |
| 379 | +class CMBLSource(Source): |
| 380 | + """A CCL CMB Lensing Source. |
| 381 | +
|
| 382 | + Parameters |
| 383 | + ---------- |
| 384 | + sacc_tracer : str |
| 385 | + The name of the tracer in the SACC file. |
| 386 | + scale : float, optional |
| 387 | + The default scale for this source. Usually the default of 1.0 is |
| 388 | + correct. |
| 389 | + systematics : list of str, optional |
| 390 | + A list of the source-level systematics to apply to the source. The |
| 391 | + default of `None` implies no systematics. |
| 392 | +
|
| 393 | + Attributes |
| 394 | + ---------- |
| 395 | + scale_ : float |
| 396 | + The overall scale associated with the source. Set after a call to |
| 397 | + `render`. |
| 398 | + tracer_ : `pyccl.CMBLensingTracer` |
| 399 | + The CCL tracer associated with this source. Set after a call to |
| 400 | + `render`. |
| 401 | +
|
| 402 | + Methods |
| 403 | + ------- |
| 404 | + render : apply systematics to this source and build the |
| 405 | + `pyccl.CMBLSource` |
| 406 | + """ |
| 407 | + def __init__(self, *, sacc_tracer, scale=1.0, systematics=None): |
| 408 | + self.sacc_tracer = sacc_tracer |
| 409 | + self.scale = scale |
| 410 | + self.systematics = systematics or [] |
| 411 | + |
| 412 | + def read(self, sacc_data): |
| 413 | + """ |
| 414 | + Read the data for this source from the SACC file. |
| 415 | +
|
| 416 | + Parameters |
| 417 | + ---------- |
| 418 | + sacc_data : sacc.Sacc |
| 419 | + The data in the sacc format. |
| 420 | + """ |
| 421 | + pass |
| 422 | + |
| 423 | + def render(self, cosmo, params, systematics=None): |
| 424 | + """ |
| 425 | + Render a source by applying systematics. |
| 426 | +
|
| 427 | + Parameters |
| 428 | + ---------- |
| 429 | + cosmo : pyccl.Cosmology |
| 430 | + A pyccl.Cosmology object. |
| 431 | + params : dict |
| 432 | + A dictionary mapping parameter names to their current values. |
| 433 | + systematics : dict |
| 434 | + A dictionary mapping systematic names to their objects. The |
| 435 | + default of `None` corresponds to no systematics. |
| 436 | + """ |
| 437 | + systematics = systematics or {} |
| 438 | + |
| 439 | + self.scale_ = self.scale |
| 440 | + |
| 441 | + for systematic in self.systematics: |
| 442 | + systematics[systematic].apply(cosmo, params, self) |
| 443 | + |
| 444 | + tracer = ccl.CMBLensingTracer(cosmo, 1100.) |
| 445 | + self.tracer_ = tracer |
0 commit comments