Skip to content

Commit

Permalink
Add feed angle to parallactic angle in feed rotation matrix (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjperkins authored Jan 25, 2019
1 parent 069a189 commit 8a2e742
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
14 changes: 11 additions & 3 deletions montblanc/impl/rime/tensorflow/RimeSolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -946,9 +946,17 @@ def _construct_tensorflow_expression(slvr_cfg, feed_data, device, shard):
FT, CT = D.uvw.dtype, D.model_vis.dtype

# Compute sine and cosine of parallactic angles
pa_sin, pa_cos = rime.parallactic_angle_sin_cos(D.parallactic_angles)
# for the beam
beam_sin, beam_cos = rime.parallactic_angle_sin_cos(
D.parallactic_angles)

# Compute sine and cosine of feed rotation angle
feed_sin, feed_cos = rime.parallactic_angle_sin_cos(
D.parallactic_angles[:, :] +
D.feed_angles[None, :])

# Compute feed rotation
feed_rotation = rime.feed_rotation(pa_sin, pa_cos, CT=CT,
feed_rotation = rime.feed_rotation(feed_sin, feed_cos, CT=CT,
feed_type=polarisation_type)

def antenna_jones(lm, stokes, alpha, ref_freq):
Expand Down Expand Up @@ -989,7 +997,7 @@ def antenna_jones(lm, stokes, alpha, ref_freq):
# Compute the direction dependent effects from the beam
ejones = rime.e_beam(lm, D.frequency,
D.pointing_errors, D.antenna_scaling,
pa_sin, pa_cos,
beam_sin, beam_cos,
D.beam_extents, D.beam_freq_map, D.ebeam)

deps = [phase_real, phase_imag, bsqrt_real, bsqrt_imag]
Expand Down
24 changes: 17 additions & 7 deletions montblanc/impl/rime/tensorflow/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,23 @@ def test_sersic_shape(self, context):
"are stacked on top of each other. ",
units = HERTZ),

# Feed angles for each antenna
array_dict('feed_angles', ('na',), 'ft',
default = lambda s, c: np.zeros(c.shape, c.dtype),
test = lambda s, c: rf(c.shape, c.dtype)*np.pi,
tags = "input, constant",
description = "Feed angles for each antenna.",
units = RADIANS),


# Parallactic angles at each timestep for each antenna
array_dict('parallactic_angles', ('ntime', 'na'), 'ft',
default = lambda s, c: np.zeros(c.shape, c.dtype),
test = lambda s, c: rf(c.shape, c.dtype)*np.pi,
tags = "input, constant",
description = "Parallactic angles for each antenna.",
units = RADIANS),

# Holographic Beam

# Pointing errors
Expand All @@ -309,13 +326,6 @@ def test_sersic_shape(self, context):
"The components express a scale in the (l,m) plane.",
units = DIMENSIONLESS),

# Parallactic angles at each timestep for each antenna
array_dict('parallactic_angles', ('ntime', 'na'), 'ft',
default = lambda s, c: np.zeros(c.shape, c.dtype),
test = lambda s, c: rf(c.shape, c.dtype)*np.pi,
tags = "input, constant",
description = "Parallactic angles for each antenna.",
units = RADIANS),

# Extents of the beam.
# First 3 values are lower coordinate for (l, m, frequency)
Expand Down

0 comments on commit 8a2e742

Please sign in to comment.