Skip to content

Commit

Permalink
Merge pull request #209 from HERA-Team/fix_beam_norm
Browse files Browse the repository at this point in the history
fix: set normalize_beams in ModelData.from_config
  • Loading branch information
steven-murray authored Jan 19, 2022
2 parents eddbf1a + 15e35fe commit 3ebed9d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
Changelog
=========

v2.3.1 [2022.01.19]
===================

Fixed
-----
- Using the ``normalize_beams`` option is now possible with the ``from_config``
class method.

v2.3.0 [2022.01.19]
===================

Expand Down
5 changes: 4 additions & 1 deletion hera_sim/visibilities/simulators.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ def _validate_beam_ids(self, beam_ids, beams):
)

@classmethod
def from_config(cls, config_file: str | Path) -> ModelData:
def from_config(
cls, config_file: str | Path, normalize_beams: bool = False
) -> ModelData:
"""Initialize the :class:`ModelData` from a pyuvsim-compatible config."""
uvdata, beams, beam_ids = initialize_uvdata_from_params(config_file)
catalog = initialize_catalog_from_params(config_file, return_recarray=False)[0]
Expand All @@ -178,6 +180,7 @@ def from_config(cls, config_file: str | Path) -> ModelData:
beams=beams,
beam_ids=beam_ids,
sky_model=catalog,
normalize_beams=normalize_beams,
)

@cached_property
Expand Down

0 comments on commit 3ebed9d

Please sign in to comment.