Skip to content

Commit

Permalink
Add subtract of rotationmeasure from rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
drafferty@hs.uni-hamburg.de authored and drafferty@hs.uni-hamburg.de committed Nov 6, 2024
1 parent 0a67206 commit b0e1a17
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions losoto/operations/residuals.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

# Residual operation for LoSoTo

# This operation subtracts/divides two tables or a clock/tec/tec3rd/rm from a phase
# This operation subtracts/divides two tables, or subtracts a clock/tec/tec3rd/rm
# from a phase, or subtracts a rotationmeasure from a rotation.

# Operation is flag-only capable

from losoto.lib_operations import *
Expand All @@ -21,7 +23,9 @@ def _run_parser(soltab, parser, step):

def run( soltab, soltabsToSub, ratio=False ):
"""
Subtract/divide two tables or a clock/tec/tec3rd/rm from a phase.
Subtract/divide two tables of the same type, or subtract a clock/tec/tec3rd/rm
table from a phase table, or subtract a rotationmeasure table from a rotation
table.
Parameters
----------
Expand Down Expand Up @@ -123,6 +127,10 @@ def run( soltab, soltabsToSub, ratio=False ):

vals = np.swapaxes(vals, 0, idxPol)

elif soltabsub.getType() == 'rotationmeasure' and soltab.getType() == 'rotation':
wav = 2.99792458e8 / freq
vals -= wav * wav * valsSub

else:
if ratio:
vals = (vals - valsSub) / valsSub
Expand Down

0 comments on commit b0e1a17

Please sign in to comment.