Skip to content
Snippets Groups Projects

Polarization response

Merged Jakob Roth requested to merge add_polarization_radio_response into master
Files
4
+ 13
2
@@ -19,12 +19,23 @@ def get_binbounds(coordinates):
def convert_polarization(inp, inp_pol, out_pol):
if inp_pol == ("I",):
if inp_pol == ("I", "Q", "U", "V"):
if out_pol == ("RR", "RL", "LR", "LL"):
mat_stokes_to_circular = jnp.array(
[[1, 0, 0, 1], [0, 1, 1, 0], [0, 1j, -1j, 0], [1, 0, 0, -1]]
)
return jnp.tensordot(mat_stokes_to_circular, inp, axes=([0], [0]))
elif out_pol == ("XX", "XY", "YX", "YY"):
mat_stokes_to_linear = jnp.array(
[[1, 1, 0, 0], [1, -1, 0, 0], [0, 0, 1, 1], [0, 0, 1j, -1j]]
)
return jnp.tensordot(mat_stokes_to_linear, inp, axes=([0], [0]))
elif inp_pol == ("I",):
if out_pol == ("LL", "RR") or out_pol == ("XX", "YY"):
new_shp = list(inp.shape)
new_shp[0] = 2
return jnp.broadcast_to(inp, new_shp)
if len(out_pol) == 1 and out_pol[0] in ("I", "RR", "LL", "XX", "yy"):
if len(out_pol) == 1 and out_pol[0] in ("I", "RR", "LL", "XX", "YY"):
return inp
err = f"conversion of polarization {inp_pol} to {out_pol} not implemented. Please implement!"
raise NotImplementedError(err)
Loading