Skip to content

Commit

Permalink
style: rename zenith_coord to phase_center_coord
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielaBreitman committed Jan 8, 2025
1 parent a97dbfa commit 3a84ca8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/py21cmsense/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,34 +81,34 @@ def phase_past_zenith(
jd = 2454600
tm = Time(jd, format="jd")

zenith_coord = SkyCoord(
phase_center_coord = SkyCoord(
alt=90 * un.deg,
az=0 * un.deg,
obstime=tm,
frame="altaz",
location=telescope_location,
)
zenith_coord = zenith_coord.transform_to("icrs")
phase_center_coord = phase_center_coord.transform_to("icrs")

if phase_center_dec is not None:
zenith_coord = SkyCoord(
ra=zenith_coord.ra,
phase_center_coord = SkyCoord(
ra=phase_center_coord.ra,
dec=phase_center_dec,
obstime=tm,
frame="icrs",
location=telescope_location,
)

obstimes = zenith_coord.obstime + time_past_zenith
obstimes = phase_center_coord.obstime + time_past_zenith
lsts = obstimes.sidereal_time("apparent", longitude=0.0).rad

if not hasattr(lsts, "__len__"):
lsts = np.array([lsts])

if use_apparent:
app_ra, app_dec = uvutils.phasing.calc_app_coords(
lon_coord=zenith_coord.ra.to_value("rad"),
lat_coord=zenith_coord.dec.to_value("rad"),
lon_coord=phase_center_coord.ra.to_value("rad"),
lat_coord=phase_center_coord.dec.to_value("rad"),
time_array=obstimes.utc.jd,
telescope_loc=telescope_location,
)
Expand All @@ -117,8 +117,8 @@ def phase_past_zenith(
app_dec = np.tile(app_dec, len(bls_enu))

else:
app_ra = zenith_coord.ra.to_value("rad") * np.ones(len(bls_enu) * len(lsts))
app_dec = zenith_coord.dec.to_value("rad") * np.ones(len(bls_enu) * len(lsts))
app_ra = phase_center_coord.ra.to_value("rad") * np.ones(len(bls_enu) * len(lsts))
app_dec = phase_center_coord.dec.to_value("rad") * np.ones(len(bls_enu) * len(lsts))

# Now make everything nbls * ntimes big.
_lsts = np.tile(lsts, len(bls_enu))
Expand Down

0 comments on commit 3a84ca8

Please sign in to comment.