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

re.response: formatting

parent dcf61f6e
Branches
Tags
1 merge request!48Polarization response
Pipeline #205293 passed
...@@ -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], mat_stokes_to_circular = jnp.array(
[0,1,1j,0], [[1, 0, 0, 1], [0, 1, 1j, 0], [0, 1, -1j, 0], [1, 0, 0, -1]]
[0,1,-1j,0], )
[1,0,0,-1]]) mat_stokes_to_linear = jnp.array(
mat_stokes_to_linear = jnp.array([[1,1,0,0], [[1, 1, 0, 0], [1, -1, 0, 0], [0, 0, 1, 1j], [0, 0, 1, -1j]]
[1,-1,0,0], )
[0,0,1,1j], if set(inp_pol) == {"I", "Q", "U", "V"}:
[0,0,1,-1j]]) if set(out_pol) == {"RR", "RL", "LR", "LL"}:
if set(inp_pol) == {'I', 'Q', 'U', 'V'}:
if set(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 set(out_pol) == {'XX', 'XY', 'YX', 'YY'}: elif set(out_pol) == {"XX", "XY", "YX", "YY"}:
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