Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 16, 2024
1 parent 4d258c3 commit 43b04b6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
12 changes: 7 additions & 5 deletions src/py21cmsense/observatory.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,12 @@ def from_profile(cls, profile: str, frequency: tp.Frequency | None = None, **kwa

@classmethod
def from_ska(
cls, subarray_type: str, array_type: str ="low", Trcv: tp.Temperature | Callable = 100 * un.K,
frequency: tp.Frequency | None = 150.0 * un.MHz, **kwargs
cls,
subarray_type: str,
array_type: str = "low",
Trcv: tp.Temperature | Callable = 100 * un.K,
frequency: tp.Frequency | None = 150.0 * un.MHz,
**kwargs,
) -> Observatory:
"""Instantiate an SKA Observatory.
Expand Down Expand Up @@ -265,9 +269,7 @@ def from_ska(
else:
raise ValueError("array_type must be 'low' or 'mid'.")
antpos = subarray.array_config.xyz.data * un.m
_beam = beam.GaussianBeam(
frequency=frequency, dish_size=35.0 * un.m
)
_beam = beam.GaussianBeam(frequency=frequency, dish_size=35.0 * un.m)
lat = subarray.array_config.location.lat.rad * un.rad
return cls(antpos=antpos, beam=_beam, latitude=lat, Trcv=Trcv)

Expand Down
18 changes: 9 additions & 9 deletions tests/test_observatory.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,16 +216,16 @@ def test_from_ska():
low_aa4 = LowSubArray(subarray_type="AA4")
assert obs.antpos.shape == low_aa4.array_config.xyz.data.shape
obs = Observatory.from_ska(
subarray_type="custom",
array_type="low",
Trcv=100.0 * un.K,
frequency=150.0 * un.MHz,
custom_stations="C*,E1-*",
exclude_stations="C1,C2",
)
subarray_type="custom",
array_type="low",
Trcv=100.0 * un.K,
frequency=150.0 * un.MHz,
custom_stations="C*,E1-*",
exclude_stations="C1,C2",
)
low_custom = LowSubArray(
subarray_type="custom", custom_stations="C*,E1-*", exclude_stations="C1,C2"
) # selects all core stations and 6 stations in the E1 cluster and exclude core stations C1 and C2
subarray_type="custom", custom_stations="C*,E1-*", exclude_stations="C1,C2"
) # selects all core stations and 6 stations in the E1 cluster and exclude core stations C1 and C2
assert obs.antpos.shape == low_custom.array_config.xyz.data.shape


Expand Down

0 comments on commit 43b04b6

Please sign in to comment.