Skip to content
Snippets Groups Projects
Commit fd0d949f authored by Jakob Roth's avatar Jakob Roth
Browse files

response: formatting

parent c40db512
Branches
No related tags found
1 merge request!48Polarization response
...@@ -19,18 +19,16 @@ def get_binbounds(coordinates): ...@@ -19,18 +19,16 @@ def get_binbounds(coordinates):
def convert_polarization(inp, inp_pol, out_pol): def convert_polarization(inp, inp_pol, out_pol):
mat_stokes_to_circular = jnp.array([[1,0,0,1], if inp_pol == ("I", "Q", "U", "V"):
[0,1,1,0], if out_pol == ("RR", "RL", "LR", "LL"):
[0,1j,-1j,0], mat_stokes_to_circular = jnp.array(
[1,0,0,-1]]) [[1, 0, 0, 1], [0, 1, 1, 0], [0, 1j, -1j, 0], [1, 0, 0, -1]]
mat_stokes_to_linear = jnp.array([[1,1,0,0], )
[1,-1,0,0],
[0,0,1,1],
[0,0,1j,-1j]])
if inp_pol == ('I', 'Q', 'U', 'V'):
if out_pol == ('RR', 'RL', 'LR', 'LL'):
return jnp.tensordot(mat_stokes_to_circular, inp, axes=([0], [0])) return jnp.tensordot(mat_stokes_to_circular, inp, axes=([0], [0]))
elif out_pol == ('XX', 'XY', 'YX', 'YY'): 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])) return jnp.tensordot(mat_stokes_to_linear, inp, axes=([0], [0]))
elif inp_pol == ("I",): elif inp_pol == ("I",):
if out_pol == ("LL", "RR") or out_pol == ("XX", "YY"): if out_pol == ("LL", "RR") or out_pol == ("XX", "YY"):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment