diff --git a/montblanc/impl/rime/tensorflow/RimeSolver.py b/montblanc/impl/rime/tensorflow/RimeSolver.py index 2084d7998..72a92711a 100644 --- a/montblanc/impl/rime/tensorflow/RimeSolver.py +++ b/montblanc/impl/rime/tensorflow/RimeSolver.py @@ -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): @@ -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] diff --git a/montblanc/impl/rime/tensorflow/config.py b/montblanc/impl/rime/tensorflow/config.py index afd5d78ee..719168fb1 100644 --- a/montblanc/impl/rime/tensorflow/config.py +++ b/montblanc/impl/rime/tensorflow/config.py @@ -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 @@ -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)