#! /usr/bin/env python3
"""snaphu_interp — alias for `snaphu THRESH DEFOMAX 1 [REGION]`.

The Python utils/snaphu script unifies snaphu.csh and snaphu_interp.csh
via a 3rd `interp` flag argument. This thin alias preserves the legacy
snaphu_interp CLI for backward compatibility:

  snaphu_interp.csh THRESH DEFOMAX [REGION]   (legacy)
  snaphu_interp     THRESH DEFOMAX [REGION]   (this alias)
                                ==
  snaphu            THRESH DEFOMAX 1 [REGION] (canonical Python)

Reference: gmtsar/csh/snaphu_interp.csh (152 lines, now superseded).
"""
import os
import sys


def main():
    args = sys.argv[1:]
    if len(args) < 2:
        sys.exit(
            "Usage: snaphu_interp correlation_threshold maximum_discontinuity "
            "[<rng0>/<rngf>/<azi0>/<azif>]"
        )
    # Insert interp=1 after the first two args.
    new_args = args[:2] + ["1"] + args[2:]
    os.execvp("snaphu.py", ["snaphu.py"] + new_args)


if __name__ == "__main__":
    main()
