Poster Abstract

P9.10 Bob Eldering (JIVE)

Theme: Evolution of software development and management

Refactoring SCHED from FORTAN to Python step-by-step.

SCHED is a program written in FORTRAN, developed by NRAO. Its purpose is to help schedule VLBI experiments. Technical developments at EVN radio telescopes have contributed to the decision for JIVE to take a leading role in maintaining and developing SCHED.

In the process of developing SCHED, we are refactoring the FORTRAN code into Python. We did not start from scratch in Python, instead we refactored the FORTRAN code step-by-step. The parts of the code we work on, we rewrite in Python and we re-use the other parts by creating an interface from Python to FORTRAN.

To create the interface between Python and FORTRAN, we use the F2PY, a NumPy package. With only minimal annotations to the FORTRAN subroutines, F2PY generates corresponding Python callables and also a Python mapping to the FORTRAN COMMON blocks.

These Python bindings to the FORTRAN code have allowed us to develop new features quickly, while remaining compatible with the original version of SCHED. Using this strategy, we have been able to use standard Python packages to implement new features. For example: PyQt and Matplotlib to replace the PGPLOT plotting functions, Astropy to do coordinate transformations, Bottle to enable mixing Python code into the input to SCHED and NumPy itself to do processing on arrays.