PyCPL: The ESO Common Pipeline Library in Python v1.0

Mrunmayi S. Deshpande,Nuria P. F. Lorente,Anthony Horton,Brent Miszalski,Ralf Palsa,Lars Lundin,Anthony Heng,Aidan Farrell
2024-04-02
Abstract:PyCPL provides full access to ESO's Common Pipeline Library ( CPL) for astronomical data reduction within a Python environment. Not only does it offer a Python interface to the robust CPL library, but it also lets users and developers fully utilise the rest of the scientific Python ecosystem. We have written a C++ layer to CPL and with pybind11 (a third-party library) created a Pythonic API to CPL. Since CPL has been around for so long, it has been thoroughly tested and understood. In 2003 it was developed in C due to its efficiency and speed of execution. With the community however moving away from C/C++ programming and embracing Python for data processing tasks, there is a need to provide access to the CPL utilities within a Python environment. With the latest version being released users can now install PyCPL to run existing CPL recipes (written in C) and access the results from Python. It also provides the ability to create new recipes in Python using the functionality provided by CPL.
Instrumentation and Methods for Astrophysics
What problem does this paper attempt to address?
The problem that this paper attempts to solve is to provide a more user - friendly and powerful Python interface for astronomical data processing to access the Common Pipeline Library (CPL) of the European Southern Observatory (ESO). Specifically, the main problems include: 1. **Requirement for language migration**: As the science and engineering communities gradually shift from C/C++ to Python for data - processing tasks, a method is needed to enable researchers to use the functions of CPL in a Python environment. Since its release in 2003, CPL has been written in C. Although it is very efficient and stable, its use threshold is relatively high, especially in the context of the increasing popularity of Python. 2. **Improving accessibility and flexibility**: In order to enable more scientific researchers to utilize the powerful functions of CPL and combine with the rich Python ecosystem (such as libraries like Astropy), a Python interface needs to be created to simplify the invocation of CPL and allow users to directly write new data - processing recipes in Python. 3. **Maintaining compatibility with existing systems**: Ensure that the newly - developed Python interface can be seamlessly connected to the existing CPL - based data - processing workflows, that is, enable users to continue running existing CPL recipes and obtain results through Python. To solve the above problems, the authors developed the PyCPL library, which not only provides Python language bindings but also realizes the encapsulation of the C++ layer through pybind11, so that the core functions of CPL can be easily invoked in Python. In addition, PyCPL also supports the creation of new Python recipes that meet ESO standards and can execute these recipes through the command - line tool PyEsoRex. This greatly improves the ease - of - use and application range of CPL and promotes the further development of the field of astronomical data processing.