From ba2ac6ddac64361ecb11f4d724a278e12816409b Mon Sep 17 00:00:00 2001
From: Jakob Maljaars <jakob.maljaars@stcorp.nl>
Date: Fri, 19 Jun 2020 10:57:40 +0200
Subject: [PATCH] Add doxygen documentation and minor changes

---
 Antenna.cc                        |   2 -
 Antenna.h                         |  57 +++++++++++--
 BeamFormer.cc                     |  66 +++++++--------
 BeamFormer.h                      |  41 +++++++--
 Constants.h                       |  42 +++++-----
 Element.cc                        |   2 -
 Element.h                         |  23 ++++-
 ElementResponse.cc                |   2 -
 ElementResponse.h                 |  27 +++++-
 ITRFConverter.cc                  |   2 +-
 ITRFConverter.h                   |   9 +-
 ITRFDirection.cc                  |  42 +++++-----
 ITRFDirection.h                   |  42 +++++-----
 LofarMetaDataUtil.cc              |  44 +++++-----
 LofarMetaDataUtil.h               |  61 +++++++++-----
 MathUtil.cc                       |  42 +++++-----
 MathUtil.h                        |  42 +++++-----
 MutablePtr.h                      |  44 +++++-----
 Station.cc                        |  42 +++++-----
 Station.h                         | 134 ++++++++++++++++--------------
 Types.cc                          |  42 +++++-----
 Types.h                           |  42 +++++-----
 hamaker/HamakerCoeff.h            |  15 +++-
 hamaker/HamakerElementResponse.cc |   6 +-
 hamaker/HamakerElementResponse.h  |   1 +
 lobes/ElementResponse.cc          |  44 +++++-----
 lobes/ElementResponse.h           |  46 +++++-----
 lobes/LOBESElementResponse.h      |   1 +
 lobes/lobes.h                     |   5 +-
 makeresponseimage.cc              |  97 ++++++++-------------
 oskar/OSKARDatafile.h             |   1 +
 oskar/OSKARDataset.h              |   9 ++
 oskar/OSKARElementResponse.h      |   2 +
 pyeverybeam.cc                    | 129 +++++++++++++++++-----------
 34 files changed, 676 insertions(+), 530 deletions(-)

diff --git a/Antenna.cc b/Antenna.cc
index 1fbd589b..7316941b 100644
--- a/Antenna.cc
+++ b/Antenna.cc
@@ -3,7 +3,6 @@
 #include "MathUtil.h"
 
 namespace everybeam {
-
 vector3r_t Antenna::transform_to_local_direction(const vector3r_t &direction) {
   vector3r_t local_direction{
       dot(m_coordinate_system.axes.p, direction),
@@ -13,5 +12,4 @@ vector3r_t Antenna::transform_to_local_direction(const vector3r_t &direction) {
 
   return local_direction;
 }
-
 }  // namespace everybeam
\ No newline at end of file
diff --git a/Antenna.h b/Antenna.h
index 717f390c..087ed2b9 100644
--- a/Antenna.h
+++ b/Antenna.h
@@ -9,12 +9,17 @@
 
 namespace everybeam {
 
+/**
+ * @brief (Virtual) class describing an antenna, and computing the corresponding response()
+ * and arrayFactor().
+ * 
+ */
 class Antenna
 {
 public:
 
     /**
-     *  \brief Station coordinate system.
+     *  \brief %Station coordinate system.
      *
      *  A right handed, cartesian, local coordinate system with coordinate axes
      *  \p p, \p q, and \p r is associated with each antenna field.
@@ -66,16 +71,24 @@ public:
 
     typedef std::shared_ptr<Antenna> Ptr;
 
+    /**
+     * @brief Struct containing antenna options
+     * 
+     */
     struct Options
     {
-        real_t freq0;
-        vector3r_t station0;
-        vector3r_t tile0;
-        bool rotate;
-        vector3r_t east;
-        vector3r_t north;
+        real_t freq0; //!< %Antenna reference frequency (Hz).
+        vector3r_t station0; //!< Reference direction (ITRF, m)
+        vector3r_t tile0; //!< Tile beam former reference direction (ITRF, m).
+        bool rotate; //!< Boolean deciding if paralactic rotation should be applied.
+        vector3r_t east; //!< Eastward pointing unit vector
+        vector3r_t north; //!< Northward pointing unit vector
     };
 
+    /**
+     * @brief Construct a new %Antenna object
+     * 
+     */
     Antenna() :
         // default coordinate system
         // no shift of origin, no rotation
@@ -85,11 +98,23 @@ public:
         })
     {}
 
+    /**
+     * @brief Construct a new %Antenna object, given a coordinate system
+     * 
+     * @param coordinate_system 
+     */
     Antenna(const CoordinateSystem &coordinate_system) :
         // default phase reference system is the origin of the coordinate system
         Antenna(coordinate_system, coordinate_system.origin)
     {}
 
+    /**
+     * @brief Construct a new %Antenna object, given a coordinate system and a 
+     * phase reference position.
+     * 
+     * @param coordinate_system Coordinate system
+     * @param phase_reference_position Phase reference position
+     */
     Antenna(const CoordinateSystem &coordinate_system, const vector3r_t &phase_reference_position) :
         m_coordinate_system(coordinate_system),
         m_phase_reference_position(phase_reference_position),
@@ -97,6 +122,15 @@ public:
     {
     }
 
+    /**
+     * @brief Compute the %Antenna response
+     * 
+     * @param time Time, modified Julian date, UTC, in seconds (MJD(UTC), s).
+     * @param freq Frequency of the plane wave (Hz).
+     * @param direction Direction of arrival (ITRF, m).
+     * @param options 
+     * @return matrix22c_t Jones matrix
+     */
     matrix22c_t response(
         real_t time,
         real_t freq,
@@ -117,6 +151,15 @@ public:
         return response;
     }
 
+    /**
+     * @brief Compute the array factor of the antenna
+     * 
+     * @param time Time, modified Julian date, UTC, in seconds (MJD(UTC), s).
+     * @param freq Frequency of the plane wave (Hz).
+     * @param direction Direction of arrival (ITRF, m).
+     * @param options 
+     * @return diag22c_t 
+     */
     diag22c_t arrayFactor(
         real_t time,
         real_t freq,
diff --git a/BeamFormer.cc b/BeamFormer.cc
index 5b9a412b..8f63c24c 100644
--- a/BeamFormer.cc
+++ b/BeamFormer.cc
@@ -6,11 +6,12 @@
 #include <cmath>
 
 namespace everybeam {
-
 vector3r_t BeamFormer::transform_to_local_position(const vector3r_t &position) {
+  // Get antenna position relative to coordinate system origin
   vector3r_t dposition{position[0] - m_coordinate_system.origin[0],
                        position[1] - m_coordinate_system.origin[1],
                        position[2] - m_coordinate_system.origin[2]};
+  // Inner product on orthogonal unit vectors of coordinate system
   vector3r_t local_position{
       dot(m_coordinate_system.axes.p, dposition),
       dot(m_coordinate_system.axes.q, dposition),
@@ -21,35 +22,16 @@ vector3r_t BeamFormer::transform_to_local_position(const vector3r_t &position) {
 }
 
 std::vector<std::complex<double>> BeamFormer::compute_geometric_response(
-    double freq, const vector3r_t &direction) const {
-  std::vector<std::complex<double>> result;
-  result.reserve(m_antennas.size());
+    const double freq, const vector3r_t &direction) const {
+  // Initialize and fill result vector by looping over antennas
+  std::vector<std::complex<double>> result(m_antennas.size());
   for (auto &antenna : m_antennas) {
-    //         std::cout << "(" << antenna->m_phase_reference_position[0] << ",
-    //         " <<
-    //             antenna->m_phase_reference_position[1] << ", " <<
-    //             antenna->m_phase_reference_position[2] << ")" << std::endl;
-    //
-    //         std::cout << "(" << m_local_phase_reference_position[0] << ", "
-    //         <<
-    //             m_local_phase_reference_position[1] << ", " <<
-    //             m_local_phase_reference_position[2] << ")" << std::endl;
-    //
-    //         std::cout << "(" << (antenna->m_phase_reference_position[0] -
-    //         m_local_phase_reference_position[0]) << ", " <<
-    //             (antenna->m_phase_reference_position[1] -
-    //             m_local_phase_reference_position[1]) << ", " <<
-    //             (antenna->m_phase_reference_position[2] -
-    //             m_local_phase_reference_position[2]) << ")" << std::endl;
-    //
-    //         std::cout << "======" << std::endl;
-
-    double dl = direction[0] * (antenna->m_phase_reference_position[0] -
-                                m_local_phase_reference_position[0]) +
-                direction[1] * (antenna->m_phase_reference_position[1] -
-                                m_local_phase_reference_position[1]) +
-                direction[2] * (antenna->m_phase_reference_position[2] -
-                                m_local_phase_reference_position[2]);
+    const double dl = direction[0] * (antenna->m_phase_reference_position[0] -
+                                      m_local_phase_reference_position[0]) +
+                      direction[1] * (antenna->m_phase_reference_position[1] -
+                                      m_local_phase_reference_position[1]) +
+                      direction[2] * (antenna->m_phase_reference_position[2] -
+                                      m_local_phase_reference_position[2]);
 
     double phase = -2 * M_PI * dl / (constants::c / freq);
     result.push_back({std::sin(phase), std::cos(phase)});
@@ -59,20 +41,27 @@ std::vector<std::complex<double>> BeamFormer::compute_geometric_response(
 
 std::vector<std::pair<std::complex<double>, std::complex<double>>>
 BeamFormer::compute_weights(const vector3r_t &pointing, double freq) const {
-  std::vector<std::pair<std::complex<double>, std::complex<double>>> result;
-  double weight_sum[2] = {0.0, 0.0};
+  // Get geometric response for pointing direction
   auto geometric_response = compute_geometric_response(freq, pointing);
-  result.reserve(geometric_response.size());
-  for (unsigned int antenna_idx = 0; antenna_idx < m_antennas.size();
+
+  // Initialize and fill result
+  double weight_sum[2] = {0.0, 0.0};
+  std::vector<std::pair<std::complex<double>, std::complex<double>>> result(
+      geometric_response.size());
+  for (std::size_t antenna_idx = 0; antenna_idx < m_antennas.size();
        ++antenna_idx) {
-    auto phasor = geometric_response[antenna_idx];
+    // Compute conjugate of geometric response
+    auto phasor_conj = std::conj(geometric_response[antenna_idx]);
+    // Compute the delays in x/y direction
     result.push_back(
-        {std::conj(phasor) * (1.0 * m_antennas[antenna_idx]->m_enabled[0]),
-         std::conj(phasor) * (1.0 * m_antennas[antenna_idx]->m_enabled[1])});
+        {phasor_conj * (1.0 * m_antennas[antenna_idx]->m_enabled[0]),
+         phasor_conj * (1.0 * m_antennas[antenna_idx]->m_enabled[1])});
     weight_sum[0] += (1.0 * m_antennas[antenna_idx]->m_enabled[0]);
     weight_sum[1] += (1.0 * m_antennas[antenna_idx]->m_enabled[1]);
   }
-  for (unsigned int antenna_idx = 0; antenna_idx < m_antennas.size();
+
+  // Normalize the weight by the number of antennas
+  for (std::size_t antenna_idx = 0; antenna_idx < m_antennas.size();
        ++antenna_idx) {
     result[antenna_idx].first /= weight_sum[0];
     result[antenna_idx].second /= weight_sum[1];
@@ -84,7 +73,9 @@ BeamFormer::compute_weights(const vector3r_t &pointing, double freq) const {
 matrix22c_t BeamFormer::local_response(real_t time, real_t freq,
                                        const vector3r_t &direction,
                                        const Options &options) const {
+  // Weights based on pointing direction of beam
   auto weights = compute_weights(options.station0, options.freq0);
+  // Weights based on direction of interest
   auto geometric_response = compute_geometric_response(freq, direction);
 
   matrix22c_t result = {0};
@@ -108,5 +99,4 @@ matrix22c_t BeamFormer::local_response(real_t time, real_t freq,
   }
   return result;
 }
-
 }  // namespace everybeam
diff --git a/BeamFormer.h b/BeamFormer.h
index c12a350d..8fe72d32 100644
--- a/BeamFormer.h
+++ b/BeamFormer.h
@@ -8,45 +8,69 @@
 #include "Types.h"
 
 namespace everybeam {
-
 class BeamFormer : public Antenna
 {
 public:
 
     typedef std::shared_ptr<BeamFormer> Ptr;
 
+    /**
+     * @brief Construct a new BeamFormer object
+     * 
+     */    
     BeamFormer() :
         Antenna()
     {
         m_local_phase_reference_position = transform_to_local_position(m_phase_reference_position);
     }
 
+    /**
+     * @brief Construct a new BeamFormer object given a coordinate system.
+     * 
+     * @param coordinate_system 
+     */    
     BeamFormer(const CoordinateSystem &coordinate_system) :
         Antenna(coordinate_system)
     {
         m_local_phase_reference_position = transform_to_local_position(m_phase_reference_position);
     }
 
+    /**
+     * @brief Construct a new BeamFormer object given a coordinate system and a phase reference position
+     * 
+     * @param coordinate_system 
+     * @param phase_reference_position 
+     */
     BeamFormer(CoordinateSystem coordinate_system, vector3r_t phase_reference_position) :
         Antenna(coordinate_system, phase_reference_position)
     {
         m_local_phase_reference_position = transform_to_local_position(m_phase_reference_position);
     }
 
+    /**
+     * @brief Add an antenna to the m_antenna array.
+     * 
+     * @param antenna 
+     */
     void add_antenna(Antenna::Ptr antenna) {m_antennas.push_back(antenna);}
 
 private:
 
     vector3r_t  m_local_phase_reference_position; // in coordinate system of Antenna
 
+    // Transform position vector into a local position vector
     vector3r_t transform_to_local_position(const vector3r_t &position);
 
+    // Compute the BeamFormer response in certain direction of arrival (ITRF, m)
+    // and return (Jones) matrix of response
     virtual matrix22c_t local_response(
         real_t time,
         real_t freq,
         const vector3r_t &direction,
         const Options &options) const override;
 
+    // Compute the local arrayFactor, with arrayFactor a vectorial "representation"
+    // of Jones matrix
     virtual diag22c_t local_arrayFactor(
         real_t time,
         real_t freq,
@@ -55,16 +79,17 @@ private:
     {
         return {1.0, 1.0};
     }
-
-    std::vector<std::complex<double>> compute_geometric_response(double freq, const vector3r_t &direction) const;
+    
+    // Compute the geometric response for all the antennas in the BeamFormer based on 
+    // the probing frequency and a specified direction (either pointing dir or dir of interest).
+    std::vector<std::complex<double>> compute_geometric_response(const double freq, const vector3r_t &direction) const;
+    
+    // Compute the weights based on the pointing direction of the beam and the beam reference frequence.
     std::vector<std::pair<std::complex<double>,std::complex<double>>> compute_weights(const vector3r_t &direction, double freq) const;
 
+    // List of antennas in BeamFormer
+    // TODO: Maybe refactor to _m_antennas to indicate m_antennas is a private attribute
     std::vector<Antenna::Ptr> m_antennas;
-
-
 };
-
 } // namespace everybeam
-
-
 #endif
diff --git a/Constants.h b/Constants.h
index fa9e86ff..53bf3eab 100644
--- a/Constants.h
+++ b/Constants.h
@@ -1,24 +1,24 @@
-//# Constants.h: %Constants used in this library.
-//#
-//# Copyright (C) 2013
-//# ASTRON (Netherlands Institute for Radio Astronomy)
-//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
-//#
-//# This file is part of the LOFAR software suite.
-//# The LOFAR software suite is free software: you can redistribute it and/or
-//# modify it under the terms of the GNU General Public License as published
-//# by the Free Software Foundation, either version 3 of the License, or
-//# (at your option) any later version.
-//#
-//# The LOFAR software suite is distributed in the hope that it will be useful,
-//# but WITHOUT ANY WARRANTY; without even the implied warranty of
-//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//# GNU General Public License for more details.
-//#
-//# You should have received a copy of the GNU General Public License along
-//# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
-//#
-//# $Id$
+// Constants.h: %Constants used in this library.
+//
+// Copyright (C) 2013
+// ASTRON (Netherlands Institute for Radio Astronomy)
+// P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//
+// This file is part of the LOFAR software suite.
+// The LOFAR software suite is free software: you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as published
+// by the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The LOFAR software suite is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//
+// $Id$
 
 #ifndef EVERYBEAM_CONSTANTS_H
 #define EVERYBEAM_CONSTANTS_H
diff --git a/Element.cc b/Element.cc
index 80b3226c..cfa6be3c 100644
--- a/Element.cc
+++ b/Element.cc
@@ -2,7 +2,6 @@
 #include "MathUtil.h"
 
 namespace everybeam {
-
 matrix22c_t Element::local_response(real_t time, real_t freq,
                                     const vector3r_t &direction, size_t id,
                                     const Options &options) const {
@@ -31,5 +30,4 @@ matrix22c_t Element::local_response(real_t time, real_t freq,
                                     const Options &options) const {
   return local_response(time, freq, direction, m_id, options);
 }
-
 }  // namespace everybeam
diff --git a/Element.h b/Element.h
index 8595563c..83ba0ae0 100644
--- a/Element.h
+++ b/Element.h
@@ -10,18 +10,40 @@
 
 namespace everybeam {
 
+/**
+ * @brief Elementary antenna, for which a response can be computed,
+ * but without any substructure like a beamformer
+ * 
+ */
 class Element : public Antenna
 {
 public:
 
     typedef std::shared_ptr<Element> Ptr;
 
+    /**
+     * @brief Construct a new Element object
+     * 
+     * @param coordinate_system (antenna) CoordinateSystem
+     * @param element_response ElementResponseModel
+     * @param id 
+     */
     Element(const CoordinateSystem &coordinate_system, ElementResponse::Ptr element_response, int id) :
         Antenna(coordinate_system),
         m_id(id),
         m_element_response(element_response)
     {}
 
+    /**
+     * @brief Compute the local response of the element.
+     * 
+     * @param time Time, modified Julian date, UTC, in seconds (MJD(UTC), s).
+     * @param freq Frequency of the plane wave (Hz).
+     * @param direction Direction of arrival (ITRF, m).
+     * @param id ID of element
+     * @param options 
+     * @return matrix22c_t 
+     */
     matrix22c_t local_response(
         real_t time,
         real_t freq,
@@ -30,7 +52,6 @@ public:
         const Options &options) const;
 
 private:
-
     virtual matrix22c_t local_response(
         real_t time,
         real_t freq,
diff --git a/ElementResponse.cc b/ElementResponse.cc
index 77625f61..6e119106 100644
--- a/ElementResponse.cc
+++ b/ElementResponse.cc
@@ -1,7 +1,6 @@
 #include "ElementResponse.h"
 
 namespace everybeam {
-
 std::ostream& operator<<(std::ostream& os, ElementResponseModel model) {
   switch (model) {
     case Unknown:
@@ -24,5 +23,4 @@ std::ostream& operator<<(std::ostream& os, ElementResponseModel model) {
   }
   return os;
 }
-
 }  // namespace everybeam
diff --git a/ElementResponse.h b/ElementResponse.h
index 43733f2b..eca9f106 100644
--- a/ElementResponse.h
+++ b/ElementResponse.h
@@ -18,18 +18,41 @@ enum ElementResponseModel {
 
 std::ostream& operator<<(std::ostream& os, ElementResponseModel model);
 
+/**
+ * @brief Virtual class for the element response model. All the (antenna/element)
+ * response models inherit from this class.
+ * 
+ */
 class ElementResponse
 {
 public:
 
-    typedef MutablePtr<ElementResponse> Ptr;
+    typedef MutablePtr<ElementResponse> Ptr; //!< Pointer to ElementResponse object
 
+    /**
+     * @brief Virtual implementation of response method
+     * 
+     * @param freq Frequency of the plane wave (Hz).
+     * @param theta Angle wrt. z-axis (rad)
+     * @param phi Angle in the xy-plane wrt. x-axis  (rad)
+     * @param result Pointer to 2x2 array of Jones matrix
+     */
     virtual void response(
         double freq,
         double theta,
         double phi,
         std::complex<double> (&result)[2][2]) const = 0;
 
+
+    /**
+     * @brief Virtual implementation of response method
+     * 
+     * @param element_id ID of element
+     * @param freq Frequency of the plane wave (Hz).
+     * @param theta Angle wrt. z-axis (rad)
+     * @param phi Angle in the xy-plane wrt. x-axis  (rad)
+     * @param result Pointer to 2x2 array of Jones matrix
+     */
     virtual void response(
         int    element_id,
         double freq,
@@ -41,7 +64,5 @@ public:
     }
 
 };
-
 } // namespace everybeam
-
 #endif
diff --git a/ITRFConverter.cc b/ITRFConverter.cc
index 8ce27a2a..e51b7aed 100644
--- a/ITRFConverter.cc
+++ b/ITRFConverter.cc
@@ -1,4 +1,4 @@
-//# Dir2ITRF.cc: Convertor that maps time to an ITRF direction.
+// Dir2ITRF.cc: Convertor that maps time to an ITRF direction.
 
 #include "ITRFDirection.h"
 #include "ITRFConverter.h"
diff --git a/ITRFConverter.h b/ITRFConverter.h
index c19b0c6a..ff830b5e 100644
--- a/ITRFConverter.h
+++ b/ITRFConverter.h
@@ -1,4 +1,4 @@
-//# Dir2ITRF.h: Convertor that maps time to an ITRF direction.
+// Dir2ITRF.h: Convertor that maps time to an ITRF direction.
 
 #ifndef EVERYBEAM_DIR2ITRF_H
 #define EVERYBEAM_DIR2ITRF_H
@@ -16,6 +16,11 @@
 
 namespace everybeam {
 
+/**
+ * @brief Class providing utilities for coordinate transformations 
+ * to and from ITRF (International Terrestrial Reference Frame) 
+ * 
+ */
 class ITRFConverter
 {
 public:
@@ -36,7 +41,5 @@ private:
     casacore::MeasFrame itsFrame;
     mutable casacore::MDirection::Convert itsConverter;
 };
-
 } // namespace everybeam
-
 #endif
diff --git a/ITRFDirection.cc b/ITRFDirection.cc
index 20a45cf8..50fe889d 100644
--- a/ITRFDirection.cc
+++ b/ITRFDirection.cc
@@ -1,24 +1,24 @@
-//# ITRFDirection.cc: Functor that maps time to an ITRF direction.
-//#
-//# Copyright (C) 2013
-//# ASTRON (Netherlands Institute for Radio Astronomy)
-//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
-//#
-//# This file is part of the LOFAR software suite.
-//# The LOFAR software suite is free software: you can redistribute it and/or
-//# modify it under the terms of the GNU General Public License as published
-//# by the Free Software Foundation, either version 3 of the License, or
-//# (at your option) any later version.
-//#
-//# The LOFAR software suite is distributed in the hope that it will be useful,
-//# but WITHOUT ANY WARRANTY; without even the implied warranty of
-//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//# GNU General Public License for more details.
-//#
-//# You should have received a copy of the GNU General Public License along
-//# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
-//#
-//# $Id$
+// ITRFDirection.cc: Functor that maps time to an ITRF direction.
+//
+// Copyright (C) 2013
+// ASTRON (Netherlands Institute for Radio Astronomy)
+// P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//
+// This file is part of the LOFAR software suite.
+// The LOFAR software suite is free software: you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as published
+// by the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The LOFAR software suite is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//
+// $Id$
 
 #include "ITRFDirection.h"
 
diff --git a/ITRFDirection.h b/ITRFDirection.h
index 09234a9b..1a2e1428 100644
--- a/ITRFDirection.h
+++ b/ITRFDirection.h
@@ -1,24 +1,24 @@
-//# ITRFDirection.h: Functor that maps time to an ITRF direction.
-//#
-//# Copyright (C) 2013
-//# ASTRON (Netherlands Institute for Radio Astronomy)
-//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
-//#
-//# This file is part of the LOFAR software suite.
-//# The LOFAR software suite is free software: you can redistribute it and/or
-//# modify it under the terms of the GNU General Public License as published
-//# by the Free Software Foundation, either version 3 of the License, or
-//# (at your option) any later version.
-//#
-//# The LOFAR software suite is distributed in the hope that it will be useful,
-//# but WITHOUT ANY WARRANTY; without even the implied warranty of
-//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//# GNU General Public License for more details.
-//#
-//# You should have received a copy of the GNU General Public License along
-//# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
-//#
-//# $Id$
+// ITRFDirection.h: Functor that maps time to an ITRF direction.
+//
+// Copyright (C) 2013
+// ASTRON (Netherlands Institute for Radio Astronomy)
+// P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//
+// This file is part of the LOFAR software suite.
+// The LOFAR software suite is free software: you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as published
+// by the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The LOFAR software suite is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//
+// $Id$
 
 #ifndef EVERYBEAM_ITRFDIRECTION_H
 #define EVERYBEAM_ITRFDIRECTION_H
diff --git a/LofarMetaDataUtil.cc b/LofarMetaDataUtil.cc
index 9daf5fca..fc151d33 100644
--- a/LofarMetaDataUtil.cc
+++ b/LofarMetaDataUtil.cc
@@ -1,25 +1,25 @@
-//# LofarMetaDataUtil.cc: Utility functions to read the meta data relevant for
-//# simulating the beam from LOFAR observations stored in MS format.
-//#
-//# Copyright (C) 2013
-//# ASTRON (Netherlands Institute for Radio Astronomy)
-//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
-//#
-//# This file is part of the LOFAR software suite.
-//# The LOFAR software suite is free software: you can redistribute it and/or
-//# modify it under the terms of the GNU General Public License as published
-//# by the Free Software Foundation, either version 3 of the License, or
-//# (at your option) any later version.
-//#
-//# The LOFAR software suite is distributed in the hope that it will be useful,
-//# but WITHOUT ANY WARRANTY; without even the implied warranty of
-//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//# GNU General Public License for more details.
-//#
-//# You should have received a copy of the GNU General Public License along
-//# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
-//#
-//# $Id$
+// LofarMetaDataUtil.cc: Utility functions to read the meta data relevant for
+// simulating the beam from LOFAR observations stored in MS format.
+//
+// Copyright (C) 2013
+// ASTRON (Netherlands Institute for Radio Astronomy)
+// P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//
+// This file is part of the LOFAR software suite.
+// The LOFAR software suite is free software: you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as published
+// by the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The LOFAR software suite is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//
+// $Id$
 
 #include "LofarMetaDataUtil.h"
 // #include "AntennaFieldLBA.h"
diff --git a/LofarMetaDataUtil.h b/LofarMetaDataUtil.h
index e8124a63..8d042fc3 100644
--- a/LofarMetaDataUtil.h
+++ b/LofarMetaDataUtil.h
@@ -1,25 +1,25 @@
-//# LofarMetaDataUtil.h: Utility functions to read the meta data relevant for
-//# simulating the beam from LOFAR observations stored in MS format.
-//#
-//# Copyright (C) 2013
-//# ASTRON (Netherlands Institute for Radio Astronomy)
-//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
-//#
-//# This file is part of the LOFAR software suite.
-//# The LOFAR software suite is free software: you can redistribute it and/or
-//# modify it under the terms of the GNU General Public License as published
-//# by the Free Software Foundation, either version 3 of the License, or
-//# (at your option) any later version.
-//#
-//# The LOFAR software suite is distributed in the hope that it will be useful,
-//# but WITHOUT ANY WARRANTY; without even the implied warranty of
-//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//# GNU General Public License for more details.
-//#
-//# You should have received a copy of the GNU General Public License along
-//# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
-//#
-//# $Id$
+// LofarMetaDataUtil.h: Utility functions to read the meta data relevant for
+// simulating the beam from LOFAR observations stored in MS format.
+//
+// Copyright (C) 2013
+// ASTRON (Netherlands Institute for Radio Astronomy)
+// P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//
+// This file is part of the LOFAR software suite.
+// The LOFAR software suite is free software: you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as published
+// by the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The LOFAR software suite is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//
+// $Id$
 
 #ifndef EVERYBEAM_LOFARMETADATAUTIL_H
 #define EVERYBEAM_LOFARMETADATAUTIL_H
@@ -39,11 +39,28 @@ namespace everybeam {
 
 const ElementResponseModel defaultElementResponseModel = ElementResponseModel::Hamaker;
 
+/**
+ * @brief Read single station from MeasurementSet
+ * 
+ * @param ms Measurement set
+ * @param id Station id
+ * @param model Element response model
+ * @return Station::Ptr 
+ */
 Station::Ptr readStation(
     const casacore::MeasurementSet &ms,
     unsigned int id,
     const ElementResponseModel model = defaultElementResponseModel);
 
+/**
+ * @brief Read multiple stations from measurment set into buffer out_it
+ * Loops over readStation for all the antennas in MeasurementSet
+ * 
+ * @tparam T Template type
+ * @param ms Measurement set
+ * @param out_it Out buffer 
+ * @param model Element Response buffer
+ */
 template <typename T>
 void readStations(
     const casacore::MeasurementSet &ms,
diff --git a/MathUtil.cc b/MathUtil.cc
index b73819ee..005e0897 100644
--- a/MathUtil.cc
+++ b/MathUtil.cc
@@ -1,24 +1,24 @@
-//# MathUtil.cc: Various mathematical operations on vectors and matrices.
-//#
-//# Copyright (C) 2013
-//# ASTRON (Netherlands Institute for Radio Astronomy)
-//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
-//#
-//# This file is part of the LOFAR software suite.
-//# The LOFAR software suite is free software: you can redistribute it and/or
-//# modify it under the terms of the GNU General Public License as published
-//# by the Free Software Foundation, either version 3 of the License, or
-//# (at your option) any later version.
-//#
-//# The LOFAR software suite is distributed in the hope that it will be useful,
-//# but WITHOUT ANY WARRANTY; without even the implied warranty of
-//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//# GNU General Public License for more details.
-//#
-//# You should have received a copy of the GNU General Public License along
-//# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
-//#
-//# $Id$
+// MathUtil.cc: Various mathematical operations on vectors and matrices.
+//
+// Copyright (C) 2013
+// ASTRON (Netherlands Institute for Radio Astronomy)
+// P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//
+// This file is part of the LOFAR software suite.
+// The LOFAR software suite is free software: you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as published
+// by the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The LOFAR software suite is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//
+// $Id$
 
 #include "MathUtil.h"
 
diff --git a/MathUtil.h b/MathUtil.h
index 96c55550..0a35cd0b 100644
--- a/MathUtil.h
+++ b/MathUtil.h
@@ -1,24 +1,24 @@
-//# MathUtil.h: Various mathematical operations on vectors and matrices.
-//#
-//# Copyright (C) 2013
-//# ASTRON (Netherlands Institute for Radio Astronomy)
-//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
-//#
-//# This file is part of the LOFAR software suite.
-//# The LOFAR software suite is free software: you can redistribute it and/or
-//# modify it under the terms of the GNU General Public License as published
-//# by the Free Software Foundation, either version 3 of the License, or
-//# (at your option) any later version.
-//#
-//# The LOFAR software suite is distributed in the hope that it will be useful,
-//# but WITHOUT ANY WARRANTY; without even the implied warranty of
-//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//# GNU General Public License for more details.
-//#
-//# You should have received a copy of the GNU General Public License along
-//# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
-//#
-//# $Id$
+// MathUtil.h: Various mathematical operations on vectors and matrices.
+//
+// Copyright (C) 2013
+// ASTRON (Netherlands Institute for Radio Astronomy)
+// P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//
+// This file is part of the LOFAR software suite.
+// The LOFAR software suite is free software: you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as published
+// by the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The LOFAR software suite is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//
+// $Id$
 
 #ifndef EVERYBEAM_MATHUTIL_H
 #define EVERYBEAM_MATHUTIL_H
diff --git a/MutablePtr.h b/MutablePtr.h
index 4afb5f00..b4ad4616 100644
--- a/MutablePtr.h
+++ b/MutablePtr.h
@@ -1,24 +1,24 @@
-//# MutablePtr.h: Representation of an LBA antenna field.
-//#
-//# Copyright (C) 2013
-//# ASTRON (Netherlands Institute for Radio Astronomy)
-//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
-//#
-//# This file is part of the LOFAR software suite.
-//# The LOFAR software suite is free software: you can redistribute it and/or
-//# modify it under the terms of the GNU General Public License as published
-//# by the Free Software Foundation, either version 3 of the License, or
-//# (at your option) any later version.
-//#
-//# The LOFAR software suite is distributed in the hope that it will be useful,
-//# but WITHOUT ANY WARRANTY; without even the implied warranty of
-//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//# GNU General Public License for more details.
-//#
-//# You should have received a copy of the GNU General Public License along
-//# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
-//#
-//# $Id$
+// MutablePtr.h: Representation of an LBA antenna field.
+//
+// Copyright (C) 2013
+// ASTRON (Netherlands Institute for Radio Astronomy)
+// P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//
+// This file is part of the LOFAR software suite.
+// The LOFAR software suite is free software: you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as published
+// by the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The LOFAR software suite is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//
+// $Id$
 
 #ifndef EVERYBEAM_MUTABLEPTR_H
 #define EVERYBEAM_MUTABLEPTR_H
@@ -82,7 +82,5 @@ public:
     void set(std::shared_ptr<T> ptr) { *(this->get()) = ptr;}
     explicit operator bool() const noexcept {return **this;}
 };
-
 } // namespace everybeam
-
 #endif
diff --git a/Station.cc b/Station.cc
index 7a0749af..bf611b88 100644
--- a/Station.cc
+++ b/Station.cc
@@ -1,24 +1,24 @@
-//# Station.cc: Representation of the station beam former.
-//#
-//# Copyright (C) 2013
-//# ASTRON (Netherlands Institute for Radio Astronomy)
-//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
-//#
-//# This file is part of the LOFAR software suite.
-//# The LOFAR software suite is free software: you can redistribute it and/or
-//# modify it under the terms of the GNU General Public License as published
-//# by the Free Software Foundation, either version 3 of the License, or
-//# (at your option) any later version.
-//#
-//# The LOFAR software suite is distributed in the hope that it will be useful,
-//# but WITHOUT ANY WARRANTY; without even the implied warranty of
-//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//# GNU General Public License for more details.
-//#
-//# You should have received a copy of the GNU General Public License along
-//# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
-//#
-//# $Id$
+// Station.cc: Representation of the station beam former.
+//
+// Copyright (C) 2013
+// ASTRON (Netherlands Institute for Radio Astronomy)
+// P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//
+// This file is part of the LOFAR software suite.
+// The LOFAR software suite is free software: you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as published
+// by the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The LOFAR software suite is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//
+// $Id$
 
 #include "Station.h"
 #include "MathUtil.h"
diff --git a/Station.h b/Station.h
index e09c5463..9ea54f7e 100644
--- a/Station.h
+++ b/Station.h
@@ -1,24 +1,24 @@
-//# Station.h: Representation of the station beam former.
-//#
-//# Copyright (C) 2013
-//# ASTRON (Netherlands Institute for Radio Astronomy)
-//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
-//#
-//# This file is part of the LOFAR software suite.
-//# The LOFAR software suite is free software: you can redistribute it and/or
-//# modify it under the terms of the GNU General Public License as published
-//# by the Free Software Foundation, either version 3 of the License, or
-//# (at your option) any later version.
-//#
-//# The LOFAR software suite is distributed in the hope that it will be useful,
-//# but WITHOUT ANY WARRANTY; without even the implied warranty of
-//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//# GNU General Public License for more details.
-//#
-//# You should have received a copy of the GNU General Public License along
-//# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
-//#
-//# $Id$
+// Station.h: Representation of the station beam former.
+//
+// Copyright (C) 2013
+// ASTRON (Netherlands Institute for Radio Astronomy)
+// P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//
+// This file is part of the LOFAR software suite.
+// The LOFAR software suite is free software: you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as published
+// by the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The LOFAR software suite is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//
+// $Id$
 
 #ifndef EVERYBEAM_STATION_H
 #define EVERYBEAM_STATION_H
@@ -36,7 +36,6 @@
 #include <vector>
 
 namespace everybeam {
-
 class Station
 {
 public:
@@ -57,14 +56,10 @@ public:
 
     void setModel(const ElementResponseModel model);
 
-    /*!
-     *  \brief Return the name of the station.
-     */
+    //! Return the name of the station.
     const std::string &name() const;
 
-    /*!
-     *  \brief Return the position of the station (ITRF, m).
-     */
+    //! Return the position of the station (ITRF, m).
     const vector3r_t &position() const;
 
     /*!
@@ -79,50 +74,43 @@ public:
      */
     void setPhaseReference(const vector3r_t &reference);
 
-    /*!
-     *  \brief Return the phase reference position (ITRF, m).
-     *
-     *  \see Station::setPhaseReference()
-     */
+    //! Return the phase reference position (ITRF, m). \see Station::setPhaseReference()
     const vector3r_t &phaseReference() const;
 
     /*!
      *  \brief Add an antenna field to the station.
      *
-     *  Physical %LOFAR stations consist of an LBA field, and either one (remote
+     *  Physical (%LOFAR) stations consist of an LBA field, and either one (remote
      *  and international stations) or two (core stations) HBA fields. Virtual
-     *  %LOFAR stations can consist of a combination of the antenna fields of
+     *  (%LOFAR) stations can consist of a combination of the antenna fields of
      *  several physical stations.
      *
      *  Use this method to add the appropriate antenna fields to the station.
      */
 //     void addField(const AntennaField::ConstPtr &field);
 
-
-    /*!
-     *  \brief Return the number of available antenna fields.
-     */
+    //! Return the number of available antenna fields.
     size_t nFields() const;
 
-    /*!
-     *  \brief Return the requested antenna field.
-     *
-     *  \param i Antenna field number (0-based).
-     *  \return An AntennaField::ConstPtr to the requested AntennaField
-     *  instance, or an empty AntennaField::ConstPtr if \p i is out of bounds.
-     */
+    // /*!
+    //  *  \brief Return the requested antenna field.
+    //  *
+    //  *  \param i Antenna field number (0-based).
+    //  *  \return An AntennaField::ConstPtr to the requested AntennaField
+    //  *  instance, or an empty AntennaField::ConstPtr if \p i is out of bounds.
+    //  */
 //     AntennaField::ConstPtr field(size_t i) const;
 
-    /*!
-     *  \brief Return an iterator that points to the beginning of the list of
-     *  antenna fields.
-     */
+    // /*!
+    //  *  \brief Return an iterator that points to the beginning of the list of
+    //  *  antenna fields.
+    //  */
 //     FieldList::const_iterator beginFields() const;
 
-    /*!
-     *  \brief Return an iterator that points to the end of the list of antenna
-     *  fields.
-     */
+    // /*!
+    //  *  \brief Return an iterator that points to the end of the list of antenna
+    //  *  fields.
+    //  */
 //     FieldList::const_iterator endFields() const;
 
     /*!
@@ -141,7 +129,7 @@ public:
      *  \param rotate Boolean deciding if paralactic rotation should be applied.
      *  \return Jones matrix that represents the %station response.
      *
-     *  For any given sub-band, the %LOFAR station beam former computes weights
+     *  For any given sub-band, the (%LOFAR) station beam former computes weights
      *  for a single reference frequency. Usually, this reference frequency is
      *  the center frequency of the sub-band. For any frequency except the
      *  reference frequency, these weights are an approximation. This aspect of
@@ -174,7 +162,7 @@ public:
      *  \param rotate Boolean deciding if paralactic rotation should be applied.
      *  \return A diagonal matrix with the array factor of the X and Y antennae.
      *
-     *  For any given sub-band, the %LOFAR station beam former computes weights
+     *  For any given sub-band, the (%LOFAR) station beam former computes weights
      *  for a single reference frequency. Usually, this reference frequency is
      *  the center frequency of the sub-band. For any frequency except the
      *  reference frequency, these weights are an approximation. This aspect of
@@ -304,12 +292,32 @@ public:
 
     const ElementResponse::Ptr get_element_response() {return itsElementResponse;}
 
+    /**
+     * @brief Compute the Jones matrix for the element response
+     * 
+     * @param time Time, modified Julian date, UTC, in seconds (MJD(UTC), s).
+     * @param freq Frequency of the plane wave (Hz).
+     * @param direction Direction of arrival (ITRF, m).
+     * @param id Element id
+     * @param rotate Boolean deciding if paralactic rotation should be applied. 
+     * @return matrix22c_t Jones matrix of element response
+     */
     matrix22c_t elementResponse(real_t time, real_t freq,
         const vector3r_t &direction, size_t id, const bool rotate) const;
 
+    /**
+     * @brief Compute the Jones matrix for the element response
+     * 
+     * @param time Time, modified Julian date, UTC, in seconds (MJD(UTC), s).
+     * @param freq Frequency of the plane wave (Hz).
+     * @param direction Direction of arrival (ITRF, m).
+     * @param rotate Boolean deciding if paralactic rotation should be applied. 
+     * @return matrix22c_t Jones matrix of element response
+     */
     matrix22c_t elementResponse(real_t time, real_t freq,
         const vector3r_t &direction, const bool rotate = true) const;
 
+    //! Specialized implementation of response function. 
     matrix22c_t response(
         real_t time,
         real_t freq,
@@ -318,17 +326,17 @@ public:
         return itsAntenna->response(time, freq, direction);
     }
 
+    //! Set antenna attribute, usually a BeamFormer, but can also be an Element
     void set_antenna(Antenna::Ptr antenna) {itsAntenna = antenna;}
 
+    //! Set Element attribute
     void set_element(Element::Ptr element) {itsElement = element;}
 
-
-
 private:
 
     vector3r_t ncp(real_t time) const;
     vector3r_t ncppol0(real_t time) const;
-    /** Compute the parallactic rotation. */
+    //! Compute the parallactic rotation. 
     matrix22r_t rotation(real_t time, const vector3r_t &direction) const;
 
     std::string itsName;
@@ -357,9 +365,9 @@ private:
 };
 
 
-//# ------------------------------------------------------------------------- //
-//# - Implementation: Station                                               - //
-//# ------------------------------------------------------------------------- //
+// ------------------------------------------------------------------------- //
+// - Implementation: Station                                               - //
+// ------------------------------------------------------------------------- //
 
 template <typename T, typename U>
 void Station::response(unsigned int count, real_t time, T freq,
@@ -408,7 +416,5 @@ void Station::arrayFactor(unsigned int count, real_t time, T freq,
             tile0);
     }
 }
-
 } // namespace everybeam
-
 #endif
diff --git a/Types.cc b/Types.cc
index 8b5b807e..f75ae165 100644
--- a/Types.cc
+++ b/Types.cc
@@ -1,24 +1,24 @@
-//# Types.cc: Declaration of types used in this library.
-//#
-//# Copyright (C) 2013
-//# ASTRON (Netherlands Institute for Radio Astronomy)
-//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
-//#
-//# This file is part of the LOFAR software suite.
-//# The LOFAR software suite is free software: you can redistribute it and/or
-//# modify it under the terms of the GNU General Public License as published
-//# by the Free Software Foundation, either version 3 of the License, or
-//# (at your option) any later version.
-//#
-//# The LOFAR software suite is distributed in the hope that it will be useful,
-//# but WITHOUT ANY WARRANTY; without even the implied warranty of
-//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//# GNU General Public License for more details.
-//#
-//# You should have received a copy of the GNU General Public License along
-//# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
-//#
-//# $Id$
+// Types.cc: Declaration of types used in this library.
+//
+// Copyright (C) 2013
+// ASTRON (Netherlands Institute for Radio Astronomy)
+// P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//
+// This file is part of the LOFAR software suite.
+// The LOFAR software suite is free software: you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as published
+// by the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The LOFAR software suite is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//
+// $Id$
 
 #include "Types.h"
 
diff --git a/Types.h b/Types.h
index 48ae0b63..21fd2995 100644
--- a/Types.h
+++ b/Types.h
@@ -1,24 +1,24 @@
-//# Types.h: Types used in this library.
-//#
-//# Copyright (C) 2013
-//# ASTRON (Netherlands Institute for Radio Astronomy)
-//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
-//#
-//# This file is part of the LOFAR software suite.
-//# The LOFAR software suite is free software: you can redistribute it and/or
-//# modify it under the terms of the GNU General Public License as published
-//# by the Free Software Foundation, either version 3 of the License, or
-//# (at your option) any later version.
-//#
-//# The LOFAR software suite is distributed in the hope that it will be useful,
-//# but WITHOUT ANY WARRANTY; without even the implied warranty of
-//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//# GNU General Public License for more details.
-//#
-//# You should have received a copy of the GNU General Public License along
-//# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
-//#
-//# $Id$
+// Types.h: Types used in this library.
+//
+// Copyright (C) 2013
+// ASTRON (Netherlands Institute for Radio Astronomy)
+// P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//
+// This file is part of the LOFAR software suite.
+// The LOFAR software suite is free software: you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as published
+// by the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The LOFAR software suite is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//
+// $Id$
 
 #ifndef EVERYBEAM_TYPES_H
 #define EVERYBEAM_TYPES_H
diff --git a/hamaker/HamakerCoeff.h b/hamaker/HamakerCoeff.h
index 48a7837c..1f46e198 100644
--- a/hamaker/HamakerCoeff.h
+++ b/hamaker/HamakerCoeff.h
@@ -10,15 +10,17 @@
 
 #include <H5Cpp.h>
 
+//! Hamaker coefficients
 class HamakerCoefficients {
     public:
+        //! Default constructor
         HamakerCoefficients();
 
-        // Constructor for reading coeff from file
+        //! Constructor for reading coeff from file
         HamakerCoefficients(
             std::string& filename);
 
-        // Constructor for writing coeff to file
+        //! Constructor for writing coeff to file
         HamakerCoefficients(
             const double freq_center,
             const double freq_range,
@@ -26,7 +28,14 @@ class HamakerCoefficients {
             const unsigned int nPowerTheta,
             const unsigned int nPowerFreq);
 
-        // Set
+        /**
+         * @brief Set Hamaker coefficients
+         * 
+         * @param n 
+         * @param t 
+         * @param f 
+         * @param value 
+         */
         void set_coeff(
             const unsigned int n,
             const unsigned int t,
diff --git a/hamaker/HamakerElementResponse.cc b/hamaker/HamakerElementResponse.cc
index 545e85a7..f48ad4a8 100644
--- a/hamaker/HamakerElementResponse.cc
+++ b/hamaker/HamakerElementResponse.cc
@@ -1,6 +1,6 @@
-//# HamakerElementResponse.cc:
-//# Functions to compute the (idealized) response of a LOFAR
-//# LBA or HBA dual dipole antenna.
+// HamakerElementResponse.cc:
+// Functions to compute the (idealized) response of a LOFAR
+// LBA or HBA dual dipole antenna.
 
 #include <stdexcept>
 
diff --git a/hamaker/HamakerElementResponse.h b/hamaker/HamakerElementResponse.h
index 0dc663ec..2a22c4ee 100644
--- a/hamaker/HamakerElementResponse.h
+++ b/hamaker/HamakerElementResponse.h
@@ -8,6 +8,7 @@
 
 namespace everybeam {
 
+//! Implementation of the Hamaker response model
 class HamakerElementResponse : public ElementResponse
 {
 public:
diff --git a/lobes/ElementResponse.cc b/lobes/ElementResponse.cc
index f11591f2..5836334e 100644
--- a/lobes/ElementResponse.cc
+++ b/lobes/ElementResponse.cc
@@ -1,25 +1,25 @@
-//# ElementResponse.cc: Functions to compute the (idealized) response of a LOFAR
-//# LBA or HBA dual dipole antenna.
-//#
-//# Copyright (C) 2011
-//# ASTRON (Netherlands Institute for Radio Astronomy)
-//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
-//#
-//# This file is part of the LOFAR software suite.
-//# The LOFAR software suite is free software: you can redistribute it and/or
-//# modify it under the terms of the GNU General Public License as published
-//# by the Free Software Foundation, either version 3 of the License, or
-//# (at your option) any later version.
-//#
-//# The LOFAR software suite is distributed in the hope that it will be useful,
-//# but WITHOUT ANY WARRANTY; without even the implied warranty of
-//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//# GNU General Public License for more details.
-//#
-//# You should have received a copy of the GNU General Public License along
-//# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
-//#
-//# $Id$
+// ElementResponse.cc: Functions to compute the (idealized) response of a LOFAR
+// LBA or HBA dual dipole antenna.
+//
+// Copyright (C) 2011
+// ASTRON (Netherlands Institute for Radio Astronomy)
+// P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//
+// This file is part of the LOFAR software suite.
+// The LOFAR software suite is free software: you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as published
+// by the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The LOFAR software suite is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//
+// $Id$
 
 #include "ElementResponse.h"
 
diff --git a/lobes/ElementResponse.h b/lobes/ElementResponse.h
index fbcac138..90e65c18 100644
--- a/lobes/ElementResponse.h
+++ b/lobes/ElementResponse.h
@@ -1,25 +1,25 @@
-//# ElementResponse.h: Functions to compute the (idealized) response of a LOFAR
-//# LBA or HBA dual dipole antenna.
-//#
-//# Copyright (C) 2011
-//# ASTRON (Netherlands Institute for Radio Astronomy)
-//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
-//#
-//# This file is part of the LOFAR software suite.
-//# The LOFAR software suite is free software: you can redistribute it and/or
-//# modify it under the terms of the GNU General Public License as published
-//# by the Free Software Foundation, either version 3 of the License, or
-//# (at your option) any later version.
-//#
-//# The LOFAR software suite is distributed in the hope that it will be useful,
-//# but WITHOUT ANY WARRANTY; without even the implied warranty of
-//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//# GNU General Public License for more details.
-//#
-//# You should have received a copy of the GNU General Public License along
-//# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
-//#
-//# $Id$
+// ElementResponse.h: Functions to compute the (idealized) response of a LOFAR
+// LBA or HBA dual dipole antenna.
+//
+// Copyright (C) 2011
+// ASTRON (Netherlands Institute for Radio Astronomy)
+// P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//
+// This file is part of the LOFAR software suite.
+// The LOFAR software suite is free software: you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as published
+// by the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The LOFAR software suite is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//
+// $Id$
 
 #ifndef LOFAR_ELEMENTRESPONSE_H
 #define LOFAR_ELEMENTRESPONSE_H
@@ -96,6 +96,6 @@ void element_response(double freq, double theta, double phi,
 
 // @}
 
-} //# namespace everybeam
+} // namespace everybeam
 
 #endif
diff --git a/lobes/LOBESElementResponse.h b/lobes/LOBESElementResponse.h
index c6330601..738d6c21 100644
--- a/lobes/LOBESElementResponse.h
+++ b/lobes/LOBESElementResponse.h
@@ -7,6 +7,7 @@
 
 namespace everybeam {
 
+//! Implementation of the Lobes response model
 class LOBESElementResponse : public ElementResponse
 {
 public:
diff --git a/lobes/lobes.h b/lobes/lobes.h
index b2386c7b..00112ee2 100644
--- a/lobes/lobes.h
+++ b/lobes/lobes.h
@@ -4,7 +4,7 @@
 
 namespace py = pybind11;
 
-
+//! (Virtual) Beam model class 
 class BeamModel {
 
 public:
@@ -14,7 +14,7 @@ public:
     virtual py::array_t<std::complex<double>> eval(py::EigenDRef<const Eigen::ArrayXd> theta, py::EigenDRef<const Eigen::ArrayXd> phi)=0;
 };
 
-
+//! Lobes beam model, wrapped with pybind11
 class LobesBeamModel : public BeamModel {
 
 public:
@@ -31,6 +31,7 @@ private:
     py::array_t<int> m_nms;
 };
 
+//! Lobes beam model, not implemented!
 class HamakerBeamModel : public BeamModel {
 
 public:
diff --git a/makeresponseimage.cc b/makeresponseimage.cc
index 23e079d5..c2a662a5 100644
--- a/makeresponseimage.cc
+++ b/makeresponseimage.cc
@@ -1,25 +1,25 @@
-//# makeresponseimage.cc: Generate images of the station response for a given
-//# MeasurementSet.
-//#
-//# Copyright (C) 2013
-//# ASTRON (Netherlands Institute for Radio Astronomy)
-//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
-//#
-//# This file is part of the LOFAR software suite.
-//# The LOFAR software suite is free software: you can redistribute it and/or
-//# modify it under the terms of the GNU General Public License as published
-//# by the Free Software Foundation, either version 3 of the License, or
-//# (at your option) any later version.
-//#
-//# The LOFAR software suite is distributed in the hope that it will be useful,
-//# but WITHOUT ANY WARRANTY; without even the implied warranty of
-//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//# GNU General Public License for more details.
-//#
-//# You should have received a copy of the GNU General Public License along
-//# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
-//#
-//# $Id$
+// makeresponseimage.cc: Generate images of the station response for a given
+// MeasurementSet.
+//
+// Copyright (C) 2013
+// ASTRON (Netherlands Institute for Radio Astronomy)
+// P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//
+// This file is part of the LOFAR software suite.
+// The LOFAR software suite is free software: you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as published
+// by the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The LOFAR software suite is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//
+// $Id$
 
 #include <lofar_config.h>
 
@@ -73,28 +73,14 @@ namespace {
  *  along with the time for which these ITRF coordinates are valid.
  */
 struct ITRFDirectionMap {
-  /*!
-   *  \brief The time for which this ITRF direction map is valid (MJD(UTC)
-   *  in seconds).
-   */
-  double_t time0;
-
-  /*!
-   *  \brief Station beam former reference direction expressed in ITRF
-   *  coordinates.
-   */
-  vector3r_t station0;
-
-  /*!
-   *  \brief Tile beam former reference direction expressed in ITRF
-   *  coordinates.
-   */
-  vector3r_t tile0;
-
-  /*!
-   *  \brief ITRF coordinates for a grid of points on the sky.
-   */
-  Matrix<vector3r_t> directions;
+  double_t time0;       //!< The time for which this ITRF direction map is valid
+                        //!< (MJD(UTC) in seconds).
+  vector3r_t station0;  //!< Station beam former reference direction expressed
+                        //!< in ITRF coordinates.
+  vector3r_t tile0;  //!< Tile beam former reference direction expressed in ITRF
+                     //!< coordinates.
+  Matrix<vector3r_t>
+      directions;  //!< ITRF coordinates for a grid of points on the sky.
 };
 
 /*!
@@ -128,22 +114,14 @@ ITRFDirectionMap makeDirectionMap(const DirectionCoordinate &coordinates,
 DirectionCoordinate makeCoordinates(const MDirection &reference,
                                     unsigned int size, double delta);
 
-/*!
- *  \brief Convert an ITRF position given as a vector3r_t
- *  instance to a casacore::MPosition.
- */
+//! Convert an ITRF position given as a vector3r_t instance to a
+//! casacore::MPosition.
 MPosition toMPositionITRF(const vector3r_t &position);
 
-/*!
- *  \brief Convert a casacore::MPosition instance to a
- *  vector3r_t instance.
- */
+//! Convert a casacore::MPosition instance to a vector3r_t instance.
 vector3r_t fromMPosition(const MPosition &position);
 
-/*!
- *  \brief Convert a casacore::MDirection instance to a
- *  vector3r_t instance.
- */
+//! Convert a casacore::MDirection instance to a vector3r_t instance.
 vector3r_t fromMDirection(const MDirection &direction);
 
 /*!
@@ -247,9 +225,7 @@ template <class T>
 void store(const Cube<T> &data, const DirectionCoordinate &coordinates,
            double frequency, const string &name);
 
-/*!
- *  \brief Convert a string to a CASA Quantity (value with unit).
- */
+//! Convert a string to a CASA Quantity (value with unit).
 Quantity readQuantity(const String &in);
 
 /*!
@@ -433,8 +409,7 @@ ITRFDirectionMap makeDirectionMap(const DirectionCoordinate &coordinates,
   Vector<Double> pixel = coordinates.referencePixel();
   for (pixel(1) = 0.0; pixel(1) < shape(1); ++pixel(1)) {
     for (pixel(0) = 0.0; pixel(0) < shape(0); ++pixel(0)) {
-      // CoordinateSystem::toWorld(): RA range [-pi,pi], DEC range
-      // [-pi/2,pi/2].
+      // CoordinateSystem::toWorld(): RA range [-pi,pi], DEC range [-pi/2,pi/2]
       if (coordinates.toWorld(world, pixel)) {
         map.directions(pixel(0), pixel(1)) = fromMDirection(convertor(world));
       }
diff --git a/oskar/OSKARDatafile.h b/oskar/OSKARDatafile.h
index f681d9e5..46de070e 100644
--- a/oskar/OSKARDatafile.h
+++ b/oskar/OSKARDatafile.h
@@ -10,6 +10,7 @@
 
 #include "OSKARDataset.h"
 
+//! Oskar datafile interface
 class Datafile {
     public:
         Datafile(
diff --git a/oskar/OSKARDataset.h b/oskar/OSKARDataset.h
index f1a0c1a2..614167f0 100644
--- a/oskar/OSKARDataset.h
+++ b/oskar/OSKARDataset.h
@@ -6,8 +6,17 @@
 
 #include <H5Cpp.h>
 
+//! OSKAR dataset
 class Dataset {
     public:
+
+        /**
+         * @brief Construct a new Dataset object given a h5 file and a
+         * frequency
+         * 
+         * @param h5_file H5 file (.h5)
+         * @param freq Frequency to look for (Hz)
+         */
         Dataset(
             H5::H5File& h5_file,
             const unsigned int freq);
diff --git a/oskar/OSKARElementResponse.h b/oskar/OSKARElementResponse.h
index d5f69b17..ee8b772d 100644
--- a/oskar/OSKARElementResponse.h
+++ b/oskar/OSKARElementResponse.h
@@ -10,6 +10,7 @@
 
 namespace everybeam {
 
+//! Implementation of the OSKAR dipole response model
 class OSKARElementResponseDipole : public ElementResponse
 {
 public:
@@ -26,6 +27,7 @@ public:
 
 };
 
+//! Implementation of the OSKAR spherical wave response model
 class OSKARElementResponseSphericalWave : public ElementResponse
 {
 public:
diff --git a/pyeverybeam.cc b/pyeverybeam.cc
index 791a5a03..dd96edf0 100644
--- a/pyeverybeam.cc
+++ b/pyeverybeam.cc
@@ -1,23 +1,23 @@
-//# pyeverybeam.cc: python module for EveryBeam object.
-//# Copyright (C) 2007
-//# ASTRON (Netherlands Institute for Radio Astronomy)
-//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
-//#
-//# This file is part of the LOFAR software suite.
-//# The LOFAR software suite is free software: you can redistribute it and/or
-//# modify it under the terms of the GNU General Public License as published
-//# by the Free Software Foundation, either version 3 of the License, or
-//# (at your option) any later version.
-//#
-//# The LOFAR software suite is distributed in the hope that it will be useful,
-//# but WITHOUT ANY WARRANTY; without even the implied warranty of
-//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//# GNU General Public License for more details.
-//#
-//# You should have received a copy of the GNU General Public License along
-//# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
-//#
-//# $Id: pystationresponse.cc 33141 2015-12-16 15:10:19Z dijkema $
+// pyeverybeam.cc: python module for EveryBeam object.
+// Copyright (C) 2007
+// ASTRON (Netherlands Institute for Radio Astronomy)
+// P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//
+// This file is part of the LOFAR software suite.
+// The LOFAR software suite is free software: you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as published
+// by the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The LOFAR software suite is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//
+// $Id: pystationresponse.cc 33141 2015-12-16 15:10:19Z dijkema $
 
 #include "ITRFDirection.h"
 #include "LofarMetaDataUtil.h"
@@ -49,22 +49,16 @@ using namespace everybeam;
 
 namespace everybeam {
 namespace {
-/*!
- *  \brief Convert an ITRF position given as a everybeam::vector3r_t
- *  instance to a casacore::MPosition.
- */
+
+//! Convert an ITRF position given as a everybeam::vector3r_t instance to a
+//! casacore::MPosition.
 MPosition toMPositionITRF(const vector3r_t &position);
 
-/*!
- *  \brief Convert a casacore::MPosition instance to a
- #  everybeam::vector3r_t instance.
- */
+//! Convert a casacore::MPosition instance to a everybeam::vector3r_t instance.
 vector3r_t fromMPosition(const MPosition &position);
 
-/*!
- *  \brief Convert a casacore::MDirection instance to a
- *  StationResponse::vector3r_t instance.
- */
+//! Convert a casacore::MDirection instance to a StationResponse::vector3r_t
+//! instance.
 vector3r_t fromMDirection(const MDirection &direction);
 
 /*!
@@ -140,44 +134,79 @@ MDirection readTileReference(const MeasurementSet &ms, unsigned int idField);
 
 class PyEveryBeam {
  public:
+  /**
+   * @brief Construct a new Py Every Beam object
+   *
+   * @param msName
+   * @param inverse
+   * @param useElementResponse
+   * @param useArrayFactor
+   * @param useChanFreq
+   */
   PyEveryBeam(const string &msName, bool inverse = false,
               bool useElementResponse = true, bool useArrayFactor = true,
               bool useChanFreq = false);
 
-  // Get the software version.
+  //! Get the software version.
   string version(const string &type) const;
 
-  // Set the delay reference direction in radians, J2000. The delay reference
-  // direction is the direction used by the station beamformer.
+  /**
+   * @brief Set the delay reference direction in radians, J2000. The delay
+   * reference direction is the direction used by the station beamformer.
+   *
+   * @param ra Right ascension (H)
+   * @param dec Declination (rad)
+   */
   void setRefDelay(double ra, double dec);
 
-  // Get the delay reference direction in meters, ITRF. The delay reference
-  // direction is the direction used by the station beamformer.
+  /**
+   * @brief Get the delay reference direction in meters, ITRF. The delay
+   * reference direction is the direction used by the station beamformer.
+   *
+   */
   ValueHolder getRefDelay(real_t time);
 
-  // Set the tile reference direction in radians, J2000. The tile reference
-  // direction is the direction used by the analog tile beamformer and is
-  // relevant only for HBA observations.
+  /**
+   * @brief Set the tile reference direction in radians, J2000. The tile
+   * reference direction is the direction used by the analog tile beamformer and
+   * is relevant only for HBA observations.
+   *
+   * @param ra Right ascension (H)
+   * @param dec Declination (rad)
+   */
   void setRefTile(double ra, double dec);
 
-  // Get the tile reference direction in meters, ITRF. The delay reference
-  // direction is the direction used by the analog tile beamformer and is
-  // relevant only for HBA observations.
+  /**
+   * @brief Get the tile reference direction in meters, ITRF. The delay
+   * reference direction is the direction used by the analog tile beamformer and
+   * is relevant only for HBA observations.
+   *
+   */
   ValueHolder getRefTile(real_t time);
 
-  // Set the direction of interest in radians, J2000. Can and often will be
-  // different than the delay and/or tile reference direction.
+  /**
+   * @brief Set the direction of interest in radians, J2000. Can and often will
+   * be different than the delay and/or tile reference direction.
+   *
+   * @param ra Right ascension (H)
+   * @param dec Declination (rad)
+   */
   void setDirection(double ra, double dec);
 
-  // Get the direction of intereset in meters, ITRF.
+  //! Get the direction of intereset in meters, ITRF.
   ValueHolder getDirection(real_t time);
 
-  // Compute the LOFAR beam Jones matrices for the given time, station, and/or
-  // channel.
+  // TODO: needs tightening and give methods more meaningful name!
+  //! Compute the beam Jones matrices for the given time
   ValueHolder evaluate0(double time);
+  //! Compute the beam Jones matrices for the given time and station
   ValueHolder evaluate1(double time, int station);
+  //! Compute the beam Jones matrices for the given time, station and channel
   ValueHolder evaluate2(double time, int station, int channel);
+  //! Compute the beam Jones matrices for the given time, station and frequency
   ValueHolder evaluate3(double time, int station, double freq);
+  //! Compute the beam Jones matrices for the given time, station, frequency and
+  //! direction
   ValueHolder evaluate4(double time, int station, double freq,
                         const ValueHolder &direction,
                         const ValueHolder &station0, const ValueHolder &tile0);
@@ -196,10 +225,11 @@ class PyEveryBeam {
                           const Vector<Double> &freq,
                           const Vector<Double> &freq0) const;
 
+  // Utilities for inverting (diagonal) matrix
   void invert(matrix22c_t &in) const;
   void invert(diag22c_t &in) const;
 
-  //# Data members.
+  // Data members.
   bool itsInverse;
   bool itsUseElementResponse;
   bool itsUseArrayFactor;
@@ -678,7 +708,6 @@ MDirection readTileReference(const MeasurementSet &ms, unsigned int idField) {
   return readDelayReference(ms, idField);
 }
 }  // namespace
-
 }  // namespace everybeam
 
 // Define the python module itself.
-- 
GitLab