Skip to content

Commit

Permalink
Adding support for NumberCounts factories including RSD.
Browse files Browse the repository at this point in the history
  • Loading branch information
vitenti committed Sep 11, 2024
1 parent 4eef092 commit 42ce85a
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 71 deletions.
9 changes: 7 additions & 2 deletions firecrown/likelihood/number_counts.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,7 @@ class NumberCountsFactory(BaseModel):

per_bin_systematics: Sequence[NumberCountsSystematicFactory]
global_systematics: Sequence[NumberCountsSystematicFactory]
include_rsd: bool = False

def model_post_init(self, _) -> None:
"""Initialize the NumberCountsFactory.
Expand Down Expand Up @@ -674,7 +675,9 @@ def create(self, inferred_zdist: InferredGalaxyZDist) -> NumberCounts:
]
systematics.extend(self._global_systematics_instances)

nc = NumberCounts.create_ready(inferred_zdist, systematics=systematics)
nc = NumberCounts.create_ready(
inferred_zdist, systematics=systematics, has_rsd=self.include_rsd
)
self._cache[inferred_zdist_id] = nc

return nc
Expand All @@ -697,7 +700,9 @@ def create_from_metadata_only(
]
systematics.extend(self._global_systematics_instances)

nc = NumberCounts(sacc_tracer=sacc_tracer, systematics=systematics)
nc = NumberCounts(
sacc_tracer=sacc_tracer, systematics=systematics, has_rsd=self.include_rsd
)
self._cache[sacc_tracer_id] = nc

return nc
Loading

0 comments on commit 42ce85a

Please sign in to comment.