Collection of scripts and small programs used by the EVN Support Scientists at JIVE during the regular data processing of EVN observations.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

42 lines
1.3 KiB

  1. #!/usr/bin/env python3
  2. import sys
  3. import argparse
  4. import subprocess
  5. import pathlib
  6. usage = "%(prog)s [-h] <idifiles> <msfile>"
  7. description = """Converts a set of FITS IDI files into a single MS file by using the 'importfitsidi()'
  8. function from CASA, with the standard parameters expected for EVN data.
  9. Arguments:
  10. <<<<<<< HEAD
  11. - idifiles : str
  12. A single word referring to the FITS IDI files to be read (using wildcards). Must start/end with quotes.
  13. =======
  14. >>>>>>> 81c1de29e2bf61290ed797878b6577bbd4a8e475
  15. - msfile : str
  16. Name of the MS file to be created.
  17. - idifiles : str
  18. FITS IDI files to be read (either a space-separated list or a single word using wildcards).
  19. """
  20. help_idifiles = "FITS IDI files to be read. Allows wildcards (then it nees to be passed with '..')."
  21. parser = argparse.ArgumentParser(description=description, prog='import_idi2ms.py', usage=usage)
  22. parser.add_argument('msfile', type=str, help='Name of the MS file to be created.')
  23. parser.add_argument('idifiles', type=str, help=help_idifiles)
  24. args = parser.parse_args()
  25. subprocess.call(f"casa --nogui -c {pathlib.Path(__file__).parent.absolute()}/_import_idi2ms.py ",
  26. # subprocess.call(f"casa --nogui -c {pathlib.Path(__file__).parent.absolute()}/_import_idi2ms.py {args.msfile} {args.idifiles}",
  27. stdout=subprocess.PIPE, stderr=subprocess.STDOUT)