From d6edac53ed769bae627f245793c45d2ca3285589 Mon Sep 17 00:00:00 2001 From: Jakob Maljaars <jakob.maljaars@stcorp.nl> Date: Thu, 23 Jul 2020 11:22:22 +0200 Subject: [PATCH] More google style --- cpp/CMakeLists.txt | 16 ++++---- cpp/antenna.cc | 2 +- cpp/beamformer.cc | 2 +- cpp/common/CMakeLists.txt | 4 +- cpp/common/{casa_utils.h => casautils.h} | 4 +- cpp/common/{math_utils.h => mathutils.h} | 2 +- cpp/coords/CMakeLists.txt | 6 +-- cpp/coords/{coord_utils.h => coordutils.h} | 0 .../{ITRFConverter.cc => itrfconverter.cc} | 37 +++++++++---------- .../{ITRFConverter.h => itrfconverter.h} | 16 ++++---- .../{ITRFDirection.cc => itrfdirection.cc} | 29 +++++++-------- .../{ITRFDirection.h => itrfdirection.h} | 10 ++--- cpp/element.cc | 2 +- cpp/element.h | 2 +- ...element_response.cc => elementresponse.cc} | 2 +- cpp/{element_response.h => elementresponse.h} | 0 cpp/gridded_response/CMakeLists.txt | 4 -- cpp/griddedresponse/CMakeLists.txt | 4 ++ .../griddedresponse.h | 10 ++--- .../lofargrid.cc | 14 +++---- .../lofargrid.h | 4 +- cpp/hamaker/CMakeLists.txt | 4 +- .../{HamakerCoeff.cc => hamakercoeff.cc} | 32 ++++++++-------- .../{HamakerCoeff.h => hamakercoeff.h} | 20 +++++----- ...tResponse.cc => hamakerelementresponse.cc} | 15 ++++---- ...entResponse.h => hamakerelementresponse.h} | 4 +- cpp/lobes/CMakeLists.txt | 2 +- cpp/lobes/ElementResponse.cc | 35 +++++++++--------- cpp/lobes/ElementResponse.h | 17 ++++----- ...{DefaultCoeffHBA.cc => defaultcoeffhba.cc} | 2 +- ...{DefaultCoeffLBA.cc => defaultcoefflba.cc} | 2 +- ...entResponse.cc => lobeselementresponse.cc} | 2 +- ...ementResponse.h => lobeselementresponse.h} | 2 +- ...LofarMetaDataUtil.cc => lofarreadutils.cc} | 18 ++++----- cpp/{LofarMetaDataUtil.h => lofarreadutils.h} | 10 ++--- cpp/makeresponseimage.cc | 8 ++-- cpp/oskar/CMakeLists.txt | 6 +-- .../{OSKARDatafile.cc => oskardatafile.cc} | 16 ++++---- .../{OSKARDatafile.h => oskardatafile.h} | 12 +++--- .../{OSKARDataset.cc => oskardataset.cc} | 20 +++++----- cpp/oskar/{OSKARDataset.h => oskardataset.h} | 12 +++--- ...entResponse.cc => oskarelementresponse.cc} | 8 ++-- ...ementResponse.h => oskarelementresponse.h} | 6 +-- cpp/station.cc | 8 ++-- cpp/station.h | 4 +- cpp/telescope/lofar.cc | 16 ++++---- cpp/telescope/lofar.h | 8 ++-- cpp/telescope/telescope.h | 10 ++--- cpp/test/tload_lofar.cc | 28 +++++++------- demo/beam-helper.cpp | 12 +++--- demo/beam-helper.h | 8 ++-- demo/comparison-oskar/main.cpp | 2 +- demo/tStation.cc | 4 +- docs/design.md | 2 +- python/lobes/lobes.cc | 10 ++--- python/pyeverybeam.cc.tmp | 6 +-- scripts/coeff_scripts/convert_coeff.py | 4 +- 57 files changed, 269 insertions(+), 276 deletions(-) rename cpp/common/{casa_utils.h => casautils.h} (97%) rename cpp/common/{math_utils.h => mathutils.h} (98%) rename cpp/coords/{coord_utils.h => coordutils.h} (100%) rename cpp/coords/{ITRFConverter.cc => itrfconverter.cc} (71%) rename cpp/coords/{ITRFConverter.h => itrfconverter.h} (67%) rename cpp/coords/{ITRFDirection.cc => itrfdirection.cc} (79%) rename cpp/coords/{ITRFDirection.h => itrfdirection.h} (87%) rename cpp/{element_response.cc => elementresponse.cc} (94%) rename cpp/{element_response.h => elementresponse.h} (100%) delete mode 100644 cpp/gridded_response/CMakeLists.txt create mode 100644 cpp/griddedresponse/CMakeLists.txt rename cpp/{gridded_response => griddedresponse}/griddedresponse.h (95%) rename cpp/{gridded_response => griddedresponse}/lofargrid.cc (93%) rename cpp/{gridded_response => griddedresponse}/lofargrid.h (98%) rename cpp/hamaker/{HamakerCoeff.cc => hamakercoeff.cc} (84%) rename cpp/hamaker/{HamakerCoeff.h => hamakercoeff.h} (75%) rename cpp/hamaker/{HamakerElementResponse.cc => hamakerelementresponse.cc} (89%) rename cpp/hamaker/{HamakerElementResponse.h => hamakerelementresponse.h} (93%) rename cpp/lobes/{DefaultCoeffHBA.cc => defaultcoeffhba.cc} (99%) rename cpp/lobes/{DefaultCoeffLBA.cc => defaultcoefflba.cc} (99%) rename cpp/lobes/{LOBESElementResponse.cc => lobeselementresponse.cc} (95%) rename cpp/lobes/{LOBESElementResponse.h => lobeselementresponse.h} (93%) rename cpp/{LofarMetaDataUtil.cc => lofarreadutils.cc} (96%) rename cpp/{LofarMetaDataUtil.h => lofarreadutils.h} (91%) rename cpp/oskar/{OSKARDatafile.cc => oskardatafile.cc} (54%) rename cpp/oskar/{OSKARDatafile.h => oskardatafile.h} (54%) rename cpp/oskar/{OSKARDataset.cc => oskardataset.cc} (83%) rename cpp/oskar/{OSKARDataset.h => oskardataset.h} (72%) rename cpp/oskar/{OSKARElementResponse.cc => oskarelementresponse.cc} (93%) rename cpp/oskar/{OSKARElementResponse.h => oskarelementresponse.h} (94%) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index ae820d1d..a6146218 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -1,7 +1,7 @@ #------------------------------------------------------------------------------ add_subdirectory(common) add_subdirectory(coords) -add_subdirectory(gridded_response) +add_subdirectory(griddedresponse) add_subdirectory(hamaker) add_subdirectory(lobes) add_subdirectory(oskar) @@ -10,16 +10,16 @@ add_subdirectory(telescope) #------------------------------------------------------------------------------ add_library(everybeam SHARED antenna.cc - element_response.cc + elementresponse.cc beamformer.cc element.cc load.cc - coords/ITRFConverter.cc - coords/ITRFDirection.cc - LofarMetaDataUtil.cc + coords/itrfconverter.cc + coords/itrfdirection.cc + lofarreadutils.cc station.cc telescope/lofar.cc - gridded_response/lofargrid.cc + griddedresponse/lofargrid.cc ) target_include_directories(everybeam PUBLIC ${CASACORE_INCLUDE_DIR}) @@ -35,8 +35,8 @@ install (FILES antenna.h beamformer.h element.h - element_response.h - LofarMetaDataUtil.h + elementresponse.h + lofarreadutils.h station.h # Related to new API: load.h diff --git a/cpp/antenna.cc b/cpp/antenna.cc index 9b3417a6..6f100299 100644 --- a/cpp/antenna.cc +++ b/cpp/antenna.cc @@ -1,6 +1,6 @@ #include "antenna.h" -#include "common/math_utils.h" +#include "common/mathutils.h" namespace everybeam { vector3r_t Antenna::TransformToLocalDirection(const vector3r_t &direction) { diff --git a/cpp/beamformer.cc b/cpp/beamformer.cc index ba21332b..c3cc34d8 100644 --- a/cpp/beamformer.cc +++ b/cpp/beamformer.cc @@ -1,7 +1,7 @@ #include "beamformer.h" #include "common/constants.h" -#include "common/math_utils.h" +#include "common/mathutils.h" #include <cmath> diff --git a/cpp/common/CMakeLists.txt b/cpp/common/CMakeLists.txt index 9e3304ec..6ba321b5 100644 --- a/cpp/common/CMakeLists.txt +++ b/cpp/common/CMakeLists.txt @@ -1,7 +1,7 @@ install (FILES constants.h - casa_utils.h - math_utils.h + casautils.h + mathutils.h mutable_ptr.h types.h DESTINATION "include/${CMAKE_PROJECT_NAME}/common") diff --git a/cpp/common/casa_utils.h b/cpp/common/casautils.h similarity index 97% rename from cpp/common/casa_utils.h rename to cpp/common/casautils.h index 7ca3460c..d7b6b8ab 100644 --- a/cpp/common/casa_utils.h +++ b/cpp/common/casautils.h @@ -1,4 +1,4 @@ -// casa_utils.h: CasaCore utilities. +// casautils.h: CasaCore utilities. // // Copyright (C) 2020 // ASTRON (Netherlands Institute for Radio Astronomy) @@ -99,7 +99,7 @@ inline bool HasColumn(const casacore::Table &table, const string &column) { * @param name Name of sub table (str) * @return Table (casacore::Table) */ -inline casacore::Table getSubTable(const casacore::Table &table, +inline casacore::Table GetSubTable(const casacore::Table &table, const string &name) { return table.keywordSet().asTable(name); } diff --git a/cpp/common/math_utils.h b/cpp/common/mathutils.h similarity index 98% rename from cpp/common/math_utils.h rename to cpp/common/mathutils.h index bcb25d31..eaa569e1 100644 --- a/cpp/common/math_utils.h +++ b/cpp/common/mathutils.h @@ -1,4 +1,4 @@ -// math_utils.h: Various mathematical operations on vectors and matrices. +// mathutils.h: Various mathematical operations on vectors and matrices. // // Copyright (C) 2013 // ASTRON (Netherlands Institute for Radio Astronomy) diff --git a/cpp/coords/CMakeLists.txt b/cpp/coords/CMakeLists.txt index b5ea2ad5..d0b52681 100644 --- a/cpp/coords/CMakeLists.txt +++ b/cpp/coords/CMakeLists.txt @@ -1,5 +1,5 @@ install (FILES - ITRFConverter.h - ITRFDirection.h - coord_utils.h + itrfconverter.h + itrfdirection.h + coordutils.h DESTINATION "include/${CMAKE_PROJECT_NAME}/coords") diff --git a/cpp/coords/coord_utils.h b/cpp/coords/coordutils.h similarity index 100% rename from cpp/coords/coord_utils.h rename to cpp/coords/coordutils.h diff --git a/cpp/coords/ITRFConverter.cc b/cpp/coords/itrfconverter.cc similarity index 71% rename from cpp/coords/ITRFConverter.cc rename to cpp/coords/itrfconverter.cc index bada341f..afe533ed 100644 --- a/cpp/coords/ITRFConverter.cc +++ b/cpp/coords/itrfconverter.cc @@ -1,13 +1,12 @@ // Dir2ITRF.cc: Convertor that maps time to an ITRF direction. -#include "ITRFDirection.h" -#include "ITRFConverter.h" +#include "itrfdirection.h" +#include "itrfconverter.h" #include <casacore/measures/Measures/MPosition.h> #include <casacore/measures/Measures/MDirection.h> #include <casacore/measures/Measures/MEpoch.h> -// namespace everybeam { using namespace everybeam; using namespace everybeam::coords; @@ -22,25 +21,25 @@ ITRFConverter::ITRFConverter(real_t time) { ITRFDirection::LOFARPosition()[2]); casacore::MPosition mPosition(mvPosition, casacore::MPosition::ITRF); casacore::MEpoch timeEpoch(casacore::Quantity(time, "s")); - itsFrame = casacore::MeasFrame(timeEpoch, mPosition); + frame_ = casacore::MeasFrame(timeEpoch, mPosition); // Order of angles seems to be longitude (along the equator), lattitude // (towards the pole). - itsConverter = casacore::MDirection::Convert( + converter_ = casacore::MDirection::Convert( casacore::MDirection::J2000, - casacore::MDirection::Ref(casacore::MDirection::ITRF, itsFrame)); + casacore::MDirection::Ref(casacore::MDirection::ITRF, frame_)); } -void ITRFConverter::setTime(real_t time) { +void ITRFConverter::SetTime(real_t time) { // Cannot use MeasFrame::resetEpoch(Double), because that assumes the // argument is UTC in (fractional) days (MJD). - itsFrame.resetEpoch(casacore::Quantity(time, "s")); + frame_.resetEpoch(casacore::Quantity(time, "s")); } vector3r_t ITRFConverter::j2000ToITRF(const vector2r_t &j2000Direction) const { casacore::MVDirection mvDirection(j2000Direction[0], j2000Direction[1]); casacore::MDirection mDirection(mvDirection, casacore::MDirection::J2000); - const casacore::MVDirection mvITRF = itsConverter(mDirection).getValue(); + const casacore::MVDirection mvITRF = converter_(mDirection).getValue(); return vector3r_t{{mvITRF(0), mvITRF(1), mvITRF(2)}}; } @@ -50,35 +49,33 @@ vector3r_t ITRFConverter::j2000ToITRF(const vector3r_t &j2000Direction) const { j2000Direction[2]); casacore::MDirection mDirection(mvDirection, casacore::MDirection::J2000); - const casacore::MVDirection mvITRF = itsConverter(mDirection).getValue(); + const casacore::MVDirection mvITRF = converter_(mDirection).getValue(); return vector3r_t{{mvITRF(0), mvITRF(1), mvITRF(2)}}; } -vector3r_t ITRFConverter::toITRF(const casacore::MDirection &direction) const { - const casacore::MVDirection mvITRF = itsConverter(direction).getValue(); +vector3r_t ITRFConverter::ToITRF(const casacore::MDirection &direction) const { + const casacore::MVDirection mvITRF = converter_(direction).getValue(); return vector3r_t{{mvITRF(0), mvITRF(1), mvITRF(2)}}; } -casacore::MDirection ITRFConverter::toDirection( +casacore::MDirection ITRFConverter::ToDirection( const vector2r_t &j2000Direction) const { casacore::MVDirection mvDirection(j2000Direction[0], j2000Direction[1]); casacore::MDirection mDirection(mvDirection, casacore::MDirection::J2000); - return itsConverter(mDirection); + return converter_(mDirection); } -casacore::MDirection ITRFConverter::toDirection( +casacore::MDirection ITRFConverter::ToDirection( const vector3r_t &j2000Direction) const { casacore::MVDirection mvDirection(j2000Direction[0], j2000Direction[1], j2000Direction[2]); casacore::MDirection mDirection(mvDirection, casacore::MDirection::J2000); - return itsConverter(mDirection); + return converter_(mDirection); } -casacore::MDirection ITRFConverter::toDirection( +casacore::MDirection ITRFConverter::ToDirection( const casacore::MDirection &direction) const { - return itsConverter(direction); + return converter_(direction); } - -// } // namespace everybeam diff --git a/cpp/coords/ITRFConverter.h b/cpp/coords/itrfconverter.h similarity index 67% rename from cpp/coords/ITRFConverter.h rename to cpp/coords/itrfconverter.h index df7c840c..ee07521b 100644 --- a/cpp/coords/ITRFConverter.h +++ b/cpp/coords/itrfconverter.h @@ -1,4 +1,4 @@ -// Dir2ITRF.h: Convertor that maps time to an ITRF direction. +// itrfconverter.h: Convert time to an ITRF direction. #ifndef EVERYBEAM_DIR2ITRF_H #define EVERYBEAM_DIR2ITRF_H @@ -28,17 +28,17 @@ class ITRFConverter { ITRFConverter(real_t time); - void setTime(real_t time); + void SetTime(real_t time); vector3r_t j2000ToITRF(const vector2r_t &j2000Direction) const; vector3r_t j2000ToITRF(const vector3r_t &j2000Direction) const; - vector3r_t toITRF(const casacore::MDirection &direction) const; - casacore::MDirection toDirection(const vector2r_t &j2000Direction) const; - casacore::MDirection toDirection(const vector3r_t &j2000Direction) const; - casacore::MDirection toDirection(const casacore::MDirection &direction) const; + vector3r_t ToITRF(const casacore::MDirection &direction) const; + casacore::MDirection ToDirection(const vector2r_t &j2000Direction) const; + casacore::MDirection ToDirection(const vector3r_t &j2000Direction) const; + casacore::MDirection ToDirection(const casacore::MDirection &direction) const; private: - casacore::MeasFrame itsFrame; - mutable casacore::MDirection::Convert itsConverter; + casacore::MeasFrame frame_; + mutable casacore::MDirection::Convert converter_; }; } // namespace coords } // namespace everybeam diff --git a/cpp/coords/ITRFDirection.cc b/cpp/coords/itrfdirection.cc similarity index 79% rename from cpp/coords/ITRFDirection.cc rename to cpp/coords/itrfdirection.cc index e5a736b1..c2dbd485 100644 --- a/cpp/coords/ITRFDirection.cc +++ b/cpp/coords/itrfdirection.cc @@ -1,4 +1,4 @@ -// ITRFDirection.cc: Functor that maps time to an ITRF direction. +// itrfdirection.cc: Functor that maps time to an ITRF direction. // // Copyright (C) 2013 // ASTRON (Netherlands Institute for Radio Astronomy) @@ -20,18 +20,17 @@ // // $Id$ -#include "ITRFDirection.h" +#include "itrfdirection.h" #include <casacore/measures/Measures/MPosition.h> #include <casacore/measures/Measures/MDirection.h> #include <casacore/measures/Measures/MEpoch.h> -// namespace everybeam { using namespace everybeam; using namespace everybeam::coords; // ITRF position of CS002LBA, just to use a fixed reference -const vector3r_t ITRFDirection::itsLOFARPosition = { +const vector3r_t ITRFDirection::lofar_position_ = { {826577.022720000, 461022.995082000, 5064892.814}}; // TODO: initialize converter with a time (and fixed position) and convert @@ -42,19 +41,19 @@ ITRFDirection::ITRFDirection(const vector3r_t &position, const vector2r_t &direction) { casacore::MVPosition mvPosition(position[0], position[1], position[2]); casacore::MPosition mPosition(mvPosition, casacore::MPosition::ITRF); - itsFrame = casacore::MeasFrame(casacore::MEpoch(), mPosition); + frame_ = casacore::MeasFrame(casacore::MEpoch(), mPosition); // Order of angles seems to be longitude (along the equator), lattitude // (towards the pole). casacore::MVDirection mvDirection(direction[0], direction[1]); casacore::MDirection mDirection(mvDirection, casacore::MDirection::J2000); - itsConverter = casacore::MDirection::Convert( + converter_ = casacore::MDirection::Convert( mDirection, - casacore::MDirection::Ref(casacore::MDirection::ITRF, itsFrame)); + casacore::MDirection::Ref(casacore::MDirection::ITRF, frame_)); } ITRFDirection::ITRFDirection(const vector2r_t &direction) - : ITRFDirection(itsLOFARPosition, direction) { + : ITRFDirection(lofar_position_, direction) { // create ITRF Direction from fixed stationposition } @@ -62,17 +61,17 @@ ITRFDirection::ITRFDirection(const vector3r_t &position, const vector3r_t &direction) { casacore::MVPosition mvPosition(position[0], position[1], position[2]); casacore::MPosition mPosition(mvPosition, casacore::MPosition::ITRF); - itsFrame = casacore::MeasFrame(casacore::MEpoch(), mPosition); + frame_ = casacore::MeasFrame(casacore::MEpoch(), mPosition); casacore::MVDirection mvDirection(direction[0], direction[1], direction[2]); casacore::MDirection mDirection(mvDirection, casacore::MDirection::J2000); - itsConverter = casacore::MDirection::Convert( + converter_ = casacore::MDirection::Convert( mDirection, - casacore::MDirection::Ref(casacore::MDirection::ITRF, itsFrame)); + casacore::MDirection::Ref(casacore::MDirection::ITRF, frame_)); } ITRFDirection::ITRFDirection(const vector3r_t &direction) - : ITRFDirection(itsLOFARPosition, direction) + : ITRFDirection(lofar_position_, direction) { // create ITRF Direction from fixed stationposition @@ -83,13 +82,11 @@ vector3r_t ITRFDirection::at(real_t time) const { // Cannot use MeasFrame::resetEpoch(Double), because that assumes the // argument is UTC in (fractional) days (MJD). - itsFrame.resetEpoch(casacore::Quantity(time, "s")); + frame_.resetEpoch(casacore::Quantity(time, "s")); - const casacore::MDirection &mITRF = itsConverter(); + const casacore::MDirection &mITRF = converter_(); const casacore::MVDirection &mvITRF = mITRF.getValue(); vector3r_t itrf = {{mvITRF(0), mvITRF(1), mvITRF(2)}}; return itrf; } - -// } // namespace everybeam diff --git a/cpp/coords/ITRFDirection.h b/cpp/coords/itrfdirection.h similarity index 87% rename from cpp/coords/ITRFDirection.h rename to cpp/coords/itrfdirection.h index bcec1740..4a4a0b7a 100644 --- a/cpp/coords/ITRFDirection.h +++ b/cpp/coords/itrfdirection.h @@ -1,4 +1,4 @@ -// ITRFDirection.h: Functor that maps time to an ITRF direction. +// itrfdirection.h: Functor that maps time to an ITRF direction. // // Copyright (C) 2013 // ASTRON (Netherlands Institute for Radio Astronomy) @@ -49,14 +49,14 @@ class ITRFDirection { vector3r_t at(real_t time) const; - const static vector3r_t &LOFARPosition() { return itsLOFARPosition; } + const static vector3r_t &LOFARPosition() { return lofar_position_; } private: // ITRF position of CS002LBA, just to use a fixed reference - const static vector3r_t itsLOFARPosition; + const static vector3r_t lofar_position_; - mutable casacore::MeasFrame itsFrame; - mutable casacore::MDirection::Convert itsConverter; + mutable casacore::MeasFrame frame_; + mutable casacore::MDirection::Convert converter_; mutable std::mutex itsMutex; }; } // namespace coords diff --git a/cpp/element.cc b/cpp/element.cc index 919ca31d..f3c119ae 100644 --- a/cpp/element.cc +++ b/cpp/element.cc @@ -1,5 +1,5 @@ #include "element.h" -#include "common/math_utils.h" +#include "common/mathutils.h" namespace everybeam { matrix22c_t Element::LocalResponse(real_t time, real_t freq, diff --git a/cpp/element.h b/cpp/element.h index 83869bc2..39c0ec32 100644 --- a/cpp/element.h +++ b/cpp/element.h @@ -5,7 +5,7 @@ #include <memory> #include "antenna.h" -#include "element_response.h" +#include "elementresponse.h" #include "common/types.h" namespace everybeam { diff --git a/cpp/element_response.cc b/cpp/elementresponse.cc similarity index 94% rename from cpp/element_response.cc rename to cpp/elementresponse.cc index 58debdc2..f6b38f06 100644 --- a/cpp/element_response.cc +++ b/cpp/elementresponse.cc @@ -1,4 +1,4 @@ -#include "element_response.h" +#include "elementresponse.h" namespace everybeam { std::ostream& operator<<(std::ostream& os, ElementResponseModel model) { diff --git a/cpp/element_response.h b/cpp/elementresponse.h similarity index 100% rename from cpp/element_response.h rename to cpp/elementresponse.h diff --git a/cpp/gridded_response/CMakeLists.txt b/cpp/gridded_response/CMakeLists.txt deleted file mode 100644 index 134f6ee0..00000000 --- a/cpp/gridded_response/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -install (FILES - griddedresponse.h - lofargrid.h -DESTINATION "include/${CMAKE_PROJECT_NAME}/gridded_response") diff --git a/cpp/griddedresponse/CMakeLists.txt b/cpp/griddedresponse/CMakeLists.txt new file mode 100644 index 00000000..f2ec3de7 --- /dev/null +++ b/cpp/griddedresponse/CMakeLists.txt @@ -0,0 +1,4 @@ +install (FILES + griddedresponse.h + lofargrid.h +DESTINATION "include/${CMAKE_PROJECT_NAME}/griddedresponse") diff --git a/cpp/gridded_response/griddedresponse.h b/cpp/griddedresponse/griddedresponse.h similarity index 95% rename from cpp/gridded_response/griddedresponse.h rename to cpp/griddedresponse/griddedresponse.h index 489a9c89..67145981 100644 --- a/cpp/gridded_response/griddedresponse.h +++ b/cpp/griddedresponse/griddedresponse.h @@ -24,9 +24,9 @@ #ifndef EVERYBEAM_GRIDDEDRESPONSE_GRIDDEDRESPONSE_H_ #define EVERYBEAM_GRIDDEDRESPONSE_GRIDDEDRESPONSE_H_ -#include "./../coords/coord_utils.h" -#include "./../coords/ITRFDirection.h" -#include "./../coords/ITRFConverter.h" +#include "./../coords/coordutils.h" +#include "./../coords/itrfdirection.h" +#include "./../coords/itrfconverter.h" #include <memory> #include <vector> @@ -40,7 +40,7 @@ namespace telescope { class Telescope; } -namespace gridded_response { +namespace griddedresponse { /** * @brief Virtual base class to compute the gridded response @@ -99,6 +99,6 @@ class GriddedResponse { size_t width_, height_; double ra_, dec_, dl_, dm_, phase_centre_dl_, phase_centre_dm_; }; -} // namespace gridded_response +} // namespace griddedresponse } // namespace everybeam #endif // EVERYBEAM_GRIDDEDRESPONSE_GRIDDEDRESPONSE_H_ \ No newline at end of file diff --git a/cpp/gridded_response/lofargrid.cc b/cpp/griddedresponse/lofargrid.cc similarity index 93% rename from cpp/gridded_response/lofargrid.cc rename to cpp/griddedresponse/lofargrid.cc index d420f1b1..466c18ee 100644 --- a/cpp/gridded_response/lofargrid.cc +++ b/cpp/griddedresponse/lofargrid.cc @@ -6,7 +6,7 @@ #include <cmath> #include <iostream> -using namespace everybeam::gridded_response; +using namespace everybeam::griddedresponse; LOFARGrid::LOFARGrid(telescope::Telescope* telescope_ptr, const coords::CoordinateSystem& coordinate_system) @@ -104,8 +104,8 @@ void LOFARGrid::CalculateAllStations(std::complex<float>* buffer, double time, void LOFARGrid::SetITRFVectors(double time) { coords::ITRFConverter itrf_converter(time); - coords::SetITRFVector(itrf_converter.toDirection(delay_dir_), station0_); - coords::SetITRFVector(itrf_converter.toDirection(tile_beam_dir_), tile0_); + coords::SetITRFVector(itrf_converter.ToDirection(delay_dir_), station0_); + coords::SetITRFVector(itrf_converter.ToDirection(tile_beam_dir_), tile0_); const casacore::Unit rad_unit("rad"); @@ -113,21 +113,21 @@ void LOFARGrid::SetITRFVectors(double time) { casacore::MVDirection(casacore::Quantity(ra_ + M_PI / 2, rad_unit), casacore::Quantity(0, rad_unit)), casacore::MDirection::J2000); - coords::SetITRFVector(itrf_converter.toDirection(l_dir), l_vector_itrf_); + coords::SetITRFVector(itrf_converter.ToDirection(l_dir), l_vector_itrf_); casacore::MDirection m_dir( casacore::MVDirection(casacore::Quantity(ra_, rad_unit), casacore::Quantity(dec_ + M_PI / 2, rad_unit)), casacore::MDirection::J2000); - coords::SetITRFVector(itrf_converter.toDirection(m_dir), m_vector_itrf_); + coords::SetITRFVector(itrf_converter.ToDirection(m_dir), m_vector_itrf_); casacore::MDirection n_dir( casacore::MVDirection(casacore::Quantity(ra_, rad_unit), casacore::Quantity(dec_, rad_unit)), casacore::MDirection::J2000); - coords::SetITRFVector(itrf_converter.toDirection(n_dir), n_vector_itrf_); + coords::SetITRFVector(itrf_converter.ToDirection(n_dir), n_vector_itrf_); - coords::SetITRFVector(itrf_converter.toDirection(preapplied_beam_dir_), + coords::SetITRFVector(itrf_converter.ToDirection(preapplied_beam_dir_), diff_beam_centre_); } diff --git a/cpp/gridded_response/lofargrid.h b/cpp/griddedresponse/lofargrid.h similarity index 98% rename from cpp/gridded_response/lofargrid.h rename to cpp/griddedresponse/lofargrid.h index adc288f1..1ad8795b 100644 --- a/cpp/gridded_response/lofargrid.h +++ b/cpp/griddedresponse/lofargrid.h @@ -31,7 +31,7 @@ #include <limits> namespace everybeam { -namespace gridded_response { +namespace griddedresponse { /** * @brief Class for computing the LOFAR gridded response @@ -95,6 +95,6 @@ class LOFARGrid final : public GriddedResponse { void CalcThread(std::complex<float>* buffer, double time, double frequency); }; -} // namespace gridded_response +} // namespace griddedresponse } // namespace everybeam #endif // EVERYBEAM_GRIDDEDRESPONSE_LOFARGRID_H_ \ No newline at end of file diff --git a/cpp/hamaker/CMakeLists.txt b/cpp/hamaker/CMakeLists.txt index 08934498..e70febba 100644 --- a/cpp/hamaker/CMakeLists.txt +++ b/cpp/hamaker/CMakeLists.txt @@ -3,8 +3,8 @@ include_directories(${CMAKE_BINARY_DIR}) # build libhamaker.so add_library(hamaker SHARED - HamakerElementResponse.cc - HamakerCoeff.cc) + hamakerelementresponse.cc + hamakercoeff.cc) string(TOLOWER ${CMAKE_PROJECT_NAME} projectname ) set_target_properties(hamaker PROPERTIES LIBRARY_OUTPUT_NAME "${projectname}-hamaker") diff --git a/cpp/hamaker/HamakerCoeff.cc b/cpp/hamaker/hamakercoeff.cc similarity index 84% rename from cpp/hamaker/HamakerCoeff.cc rename to cpp/hamaker/hamakercoeff.cc index f60b4ff6..10598fb1 100644 --- a/cpp/hamaker/HamakerCoeff.cc +++ b/cpp/hamaker/hamakercoeff.cc @@ -1,6 +1,6 @@ -#include "HamakerCoeff.h" +#include "hamakercoeff.h" -H5::CompType get_complex_double_type() { +H5::CompType GetComplexDoubleType() { H5::CompType complex_type(sizeof(std::complex<double>)); complex_type.insertMember("r", 0, H5::PredType::NATIVE_DOUBLE); complex_type.insertMember("i", sizeof(double), H5::PredType::NATIVE_DOUBLE); @@ -15,7 +15,7 @@ size_t HamakerCoefficients::GetIndex(const unsigned int n, const unsigned int t, // Constructor for reading coeff from file HamakerCoefficients::HamakerCoefficients(std::string& filename) { - ReadCoeffs(filename); + ReadCoefficients(filename); }; // Constructor for writing coeff to file @@ -29,13 +29,13 @@ HamakerCoefficients::HamakerCoefficients(const double freq_center, nHarmonics_(nHarmonics), nPowerTheta_(nPowerTheta), nPowerFreq_(nPowerFreq), - coeff_(GetNumCoeffs()) {} + coeff_(GetNrCoefficients()) {} -size_t HamakerCoefficients::GetNumCoeffs() const { +size_t HamakerCoefficients::GetNrCoefficients() const { return nHarmonics_ * nPowerTheta_ * nPowerFreq_ * nInner_; } -void HamakerCoefficients::SetCoeffs( +void HamakerCoefficients::SetCoefficients( const unsigned int n, const unsigned int t, const unsigned int f, std::pair<std::complex<double>, std::complex<double>> value) { size_t index = GetIndex(n, t, f); @@ -43,19 +43,19 @@ void HamakerCoefficients::SetCoeffs( coeff_[index + 1] = value.second; } -void HamakerCoefficients::SetCoeffs(const std::complex<double>* coeff) { +void HamakerCoefficients::SetCoefficients(const std::complex<double>* coeff) { memcpy(coeff_.data(), coeff, coeff_.size() * sizeof(std::complex<double>)); } -void HamakerCoefficients::SetCoeffs( +void HamakerCoefficients::SetCoefficients( const std::vector<std::complex<double>> coeff) { assert(coeff.size() == coeff_.size()); std::copy(coeff.begin(), coeff.end(), coeff_.begin()); } std::pair<std::complex<double>, std::complex<double>> -HamakerCoefficients::get_coeff(const unsigned int n, const unsigned int t, - const unsigned int f) { +HamakerCoefficients::GetCoefficient(const unsigned int n, const unsigned int t, + const unsigned int f) { size_t index = GetIndex(n, t, f); std::pair<std::complex<double>, std::complex<double>> value; value.first = coeff_[index]; @@ -63,7 +63,7 @@ HamakerCoefficients::get_coeff(const unsigned int n, const unsigned int t, return value; } -void HamakerCoefficients::ReadCoeffs(std::string& filename) { +void HamakerCoefficients::ReadCoefficients(std::string& filename) { // Open file H5::H5File file(filename, H5F_ACC_RDONLY); @@ -87,13 +87,13 @@ void HamakerCoefficients::ReadCoeffs(std::string& filename) { nPowerFreq_ = dims[2]; // Read coeffs - coeff_.resize(GetNumCoeffs()); + coeff_.resize(GetNrCoefficients()); H5::DataType data_type = dataset.getDataType(); assert(data_type.getSize() == sizeof(std::complex<double>)); dataset.read(coeff_.data(), data_type, dataspace); } -void HamakerCoefficients::WriteCoeffs(std::string& filename) { +void HamakerCoefficients::WriteCoefficients(std::string& filename) { // Open file H5::H5File file(filename, H5F_ACC_TRUNC); @@ -108,7 +108,7 @@ void HamakerCoefficients::WriteCoeffs(std::string& filename) { coeff_type* coeff_ptr = (coeff_type*)coeff_.data(); // Create complex type - H5::CompType complex_type = get_complex_double_type(); + H5::CompType complex_type = GetComplexDoubleType(); // Write dataset H5::DataSet dataset = @@ -131,11 +131,11 @@ void HamakerCoefficients::WriteCoeffs(std::string& filename) { file.flush(H5F_SCOPE_LOCAL); } -void HamakerCoefficients::PrintCoeffs() { +void HamakerCoefficients::PrintCoefficients() { for (unsigned int h = 0; h < nHarmonics_; h++) { for (unsigned int t = 0; t < nPowerTheta_; t++) { for (unsigned int f = 0; f < nPowerFreq_; f++) { - auto coeff = get_coeff(h, t, f); + auto coeff = GetCoefficient(h, t, f); std::cout << coeff.first << ", " << coeff.second << std::endl; } } diff --git a/cpp/hamaker/HamakerCoeff.h b/cpp/hamaker/hamakercoeff.h similarity index 75% rename from cpp/hamaker/HamakerCoeff.h rename to cpp/hamaker/hamakercoeff.h index d529d44e..2525df96 100644 --- a/cpp/hamaker/HamakerCoeff.h +++ b/cpp/hamaker/hamakercoeff.h @@ -33,16 +33,16 @@ class HamakerCoefficients { * @param f * @param value */ - void SetCoeffs(const unsigned int n, const unsigned int t, - const unsigned int f, - std::pair<std::complex<double>, std::complex<double>> value); + void SetCoefficients( + const unsigned int n, const unsigned int t, const unsigned int f, + std::pair<std::complex<double>, std::complex<double>> value); - void SetCoeffs(const std::complex<double>* coeff); + void SetCoefficients(const std::complex<double>* coeff); - void SetCoeffs(const std::vector<std::complex<double>> coeff); + void SetCoefficients(const std::vector<std::complex<double>> coeff); // Get - size_t GetNumCoeffs() const; + size_t GetNrCoefficients() const; double GetFreqCenter() const { return freq_center_; } @@ -54,16 +54,16 @@ class HamakerCoefficients { unsigned int Get_nPowerFreq() const { return nPowerFreq_; } - std::pair<std::complex<double>, std::complex<double>> get_coeff( + std::pair<std::complex<double>, std::complex<double>> GetCoefficient( const unsigned int n, const unsigned int t, const unsigned int f); // HDF5 I/O - void ReadCoeffs(std::string& filename); + void ReadCoefficients(std::string& filename); - void WriteCoeffs(std::string& filename); + void WriteCoefficients(std::string& filename); // Debugging - void PrintCoeffs(); + void PrintCoefficients(); private: // Methods diff --git a/cpp/hamaker/HamakerElementResponse.cc b/cpp/hamaker/hamakerelementresponse.cc similarity index 89% rename from cpp/hamaker/HamakerElementResponse.cc rename to cpp/hamaker/hamakerelementresponse.cc index 797d4280..e179def0 100644 --- a/cpp/hamaker/HamakerElementResponse.cc +++ b/cpp/hamaker/hamakerelementresponse.cc @@ -1,4 +1,4 @@ -// HamakerElementResponse.cc: +// hamakerelementresponse.cc: // Functions to compute the (idealized) response of a LOFAR // LBA or HBA dual dipole antenna. @@ -6,7 +6,7 @@ #include "config.h" -#include "HamakerElementResponse.h" +#include "hamakerelementresponse.h" #include "../common/singleton.h" namespace everybeam { @@ -73,21 +73,22 @@ void HamakerElementResponse::Response( // start indexing the block of coefficients at the last element // Evaluate the highest order term. - P = m_coeffs->get_coeff(k, nPowerTheta - 1, nPowerFreq - 1); + P = m_coeffs->GetCoefficient(k, nPowerTheta - 1, nPowerFreq - 1); for (unsigned int i = 0; i < nPowerFreq - 1; ++i) { - auto Pk = m_coeffs->get_coeff(k, nPowerTheta - 1, nPowerFreq - i - 2); + auto Pk = + m_coeffs->GetCoefficient(k, nPowerTheta - 1, nPowerFreq - i - 2); P.first = P.first * freq + Pk.first; P.second = P.second * freq + Pk.second; } // Evaluate the remaining terms. for (unsigned int j = 0; j < nPowerTheta - 1; ++j) { - Pj = m_coeffs->get_coeff(k, nPowerTheta - j - 2, nPowerFreq - 1); + Pj = m_coeffs->GetCoefficient(k, nPowerTheta - j - 2, nPowerFreq - 1); for (unsigned int i = 0; i < nPowerFreq - 1; ++i) { - auto Pk = - m_coeffs->get_coeff(k, nPowerTheta - j - 2, nPowerFreq - i - 2); + auto Pk = m_coeffs->GetCoefficient(k, nPowerTheta - j - 2, + nPowerFreq - i - 2); Pj.first = Pj.first * freq + Pk.first; Pj.second = Pj.second * freq + Pk.second; } diff --git a/cpp/hamaker/HamakerElementResponse.h b/cpp/hamaker/hamakerelementresponse.h similarity index 93% rename from cpp/hamaker/HamakerElementResponse.h rename to cpp/hamaker/hamakerelementresponse.h index 6ec0e31f..57c1cd31 100644 --- a/cpp/hamaker/HamakerElementResponse.h +++ b/cpp/hamaker/hamakerelementresponse.h @@ -1,8 +1,8 @@ #ifndef HAMAKER_ELEMENTRESPONSE_H #define HAMAKER_ELEMENTRESPONSE_H -#include "../element_response.h" -#include "HamakerCoeff.h" +#include "../elementresponse.h" +#include "hamakercoeff.h" #include <memory> diff --git a/cpp/lobes/CMakeLists.txt b/cpp/lobes/CMakeLists.txt index 7e9d0778..ab07c8bb 100644 --- a/cpp/lobes/CMakeLists.txt +++ b/cpp/lobes/CMakeLists.txt @@ -7,7 +7,7 @@ # pybind11_add_module(pylobes SHARED lobes.cc ElementResponse.cc LOBESElementResponse.cc) # target_link_libraries (pylobes PUBLIC Eigen3::Eigen ${HDF5_LIBRARIES}) -add_library(lobes SHARED LOBESElementResponse.cc) +add_library(lobes SHARED lobeselementresponse.cc) string(TOLOWER ${CMAKE_PROJECT_NAME} projectname ) set_target_properties(lobes PROPERTIES LIBRARY_OUTPUT_NAME "${projectname}-lobes") diff --git a/cpp/lobes/ElementResponse.cc b/cpp/lobes/ElementResponse.cc index 7cc879c1..5c68d667 100644 --- a/cpp/lobes/ElementResponse.cc +++ b/cpp/lobes/ElementResponse.cc @@ -21,38 +21,37 @@ // // $Id$ -#include "element_response.h" +#include "ElementResponse.h" #include <cmath> // The coefficients are kept in an unnamed namespace which effectively makes // them invisible outside this translation unit. namespace { -#include "DefaultCoeffLBA.cc" -#include "DefaultCoeffHBA.cc" +#include "defaultcoefflba.cc" +#include "defaultcoeffhba.cc" } // namespace namespace everybeam { -void element_response_lba(double freq, double theta, double phi, - std::complex<double> (&response)[2][2]) { - element_response(freq, theta, phi, response, default_lba_freq_center, - default_lba_freq_range, default_lba_coeff_shape, - default_lba_coeff); +void ElementResponseLBA(double freq, double theta, double phi, + std::complex<double> (&response)[2][2]) { + ElementResponse(freq, theta, phi, response, default_lba_freq_center, + default_lba_freq_range, default_lba_coeff_shape, + default_lba_coeff); } -void element_response_hba(double freq, double theta, double phi, - std::complex<double> (&response)[2][2]) { - element_response(freq, theta, phi, response, default_hba_freq_center, - default_hba_freq_range, default_hba_coeff_shape, - default_hba_coeff); +void ElementResponseHBA(double freq, double theta, double phi, + std::complex<double> (&response)[2][2]) { + ElementResponse(freq, theta, phi, response, default_hba_freq_center, + default_hba_freq_range, default_hba_coeff_shape, + default_hba_coeff); } -void element_response(double freq, double theta, double phi, - std::complex<double> (&response)[2][2], - double freq_center, double freq_range, - const unsigned int (&coeff_shape)[3], - const std::complex<double> coeff[]) { +void ElementResponse(double freq, double theta, double phi, + std::complex<double> (&response)[2][2], double freq_center, + double freq_range, const unsigned int (&coeff_shape)[3], + const std::complex<double> coeff[]) { // Initialize the response to zero. response[0][0] = 0.0; response[0][1] = 0.0; diff --git a/cpp/lobes/ElementResponse.h b/cpp/lobes/ElementResponse.h index 1a9a0ae1..5fa7b98a 100644 --- a/cpp/lobes/ElementResponse.h +++ b/cpp/lobes/ElementResponse.h @@ -47,8 +47,8 @@ namespace everybeam { // theta: Zenith angle in rad in the range [0.0, PI / 2.0]. // phi: Azimuth in rad in the range [0.0, 2.0 * PI]. // -void element_response_lba(double freq, double theta, double phi, - std::complex<double> (&response)[2][2]); +void ElementResponseLBA(double freq, double theta, double phi, + std::complex<double> (&response)[2][2]); // Compute the response of an idealized LOFAR HBA dual dipole antenna to // radiation at frequency freq (Hz) arriving from the direction given by theta, @@ -62,8 +62,8 @@ void element_response_lba(double freq, double theta, double phi, // theta: Zenith angle in rad in the range [0.0, PI / 2.0]. // phi: Azimuth in rad in the range [0.0, 2.0 * PI]. // -void element_response_hba(double freq, double theta, double phi, - std::complex<double> (&response)[2][2]); +void ElementResponseHBA(double freq, double theta, double phi, + std::complex<double> (&response)[2][2]); // Compute the response of an idealized LOFAR dual dipole antenna to radiation // at frequency freq (Hz) arriving from the direction given by theta, phi (rad). @@ -88,11 +88,10 @@ void element_response_hba(double freq, double theta, double phi, // freq_range, freq_center: Frequency center and range in Hz, should be > 0. // coeff_shape: Shape of the coefficient array, all dimensions should be > 0. // -void element_response(double freq, double theta, double phi, - std::complex<double> (&response)[2][2], - double freq_center, double freq_range, - const unsigned int (&coeff_shape)[3], - const std::complex<double> coeff[]); +void ElementResponse(double freq, double theta, double phi, + std::complex<double> (&response)[2][2], double freq_center, + double freq_range, const unsigned int (&coeff_shape)[3], + const std::complex<double> coeff[]); // @} diff --git a/cpp/lobes/DefaultCoeffHBA.cc b/cpp/lobes/defaultcoeffhba.cc similarity index 99% rename from cpp/lobes/DefaultCoeffHBA.cc rename to cpp/lobes/defaultcoeffhba.cc index f57c8f72..7d660b92 100644 --- a/cpp/lobes/DefaultCoeffHBA.cc +++ b/cpp/lobes/defaultcoeffhba.cc @@ -1,6 +1,6 @@ // Beam model coefficients converted by convert_coeff.py. // Conversion performed on 2011/09/14/08:23:16 UTC using: -// convert_coeff.py element_beam_HBA.coeff DefaultCoeffHBA.cc default_hba +// convert_coeff.py element_beam_HBA.coeff defaultcoeffhba.cc default_hba #include <complex> diff --git a/cpp/lobes/DefaultCoeffLBA.cc b/cpp/lobes/defaultcoefflba.cc similarity index 99% rename from cpp/lobes/DefaultCoeffLBA.cc rename to cpp/lobes/defaultcoefflba.cc index deb203e3..d8ea5404 100644 --- a/cpp/lobes/DefaultCoeffLBA.cc +++ b/cpp/lobes/defaultcoefflba.cc @@ -1,6 +1,6 @@ // Beam model coefficients converted by convert_coeff.py. // Conversion performed on 2011/09/14/08:23:09 UTC using: -// convert_coeff.py element_beam_LBA.coeff DefaultCoeffLBA.cc default_lba +// convert_coeff.py element_beam_LBA.coeff defaultcoefflba.cc default_lba #include <complex> diff --git a/cpp/lobes/LOBESElementResponse.cc b/cpp/lobes/lobeselementresponse.cc similarity index 95% rename from cpp/lobes/LOBESElementResponse.cc rename to cpp/lobes/lobeselementresponse.cc index de8cc40a..a8081d0f 100644 --- a/cpp/lobes/LOBESElementResponse.cc +++ b/cpp/lobes/lobeselementresponse.cc @@ -1,4 +1,4 @@ -#include "LOBESElementResponse.h" +#include "lobeselementresponse.h" #include <map> diff --git a/cpp/lobes/LOBESElementResponse.h b/cpp/lobes/lobeselementresponse.h similarity index 93% rename from cpp/lobes/LOBESElementResponse.h rename to cpp/lobes/lobeselementresponse.h index 5acb9782..c0d9ee12 100644 --- a/cpp/lobes/LOBESElementResponse.h +++ b/cpp/lobes/lobeselementresponse.h @@ -1,7 +1,7 @@ #ifndef LOBES_ELEMENTRESPONSE_H #define LOBES_ELEMENTRESPONSE_H -#include "../element_response.h" +#include "../elementresponse.h" #include <memory> diff --git a/cpp/LofarMetaDataUtil.cc b/cpp/lofarreadutils.cc similarity index 96% rename from cpp/LofarMetaDataUtil.cc rename to cpp/lofarreadutils.cc index c34df144..c2ee5e74 100644 --- a/cpp/LofarMetaDataUtil.cc +++ b/cpp/lofarreadutils.cc @@ -1,4 +1,4 @@ -// LofarMetaDataUtil.cc: Utility functions to read the meta data relevant for +// lofarreadutils.cc: Utility functions to read the meta data relevant for // simulating the beam from LOFAR observations stored in MS format. // // Copyright (C) 2013 @@ -21,9 +21,9 @@ // // $Id$ -#include "LofarMetaDataUtil.h" -#include "common/math_utils.h" -#include "common/casa_utils.h" +#include "lofarreadutils.h" +#include "common/mathutils.h" +#include "common/casautils.h" #include <casacore/measures/Measures/MDirection.h> #include <casacore/measures/Measures/MPosition.h> @@ -286,11 +286,11 @@ Station::Ptr ReadLofarStation(const MeasurementSet &ms, unsigned int id, // Read antenna field information. ROScalarColumn<String> telescope_name_col( - common::getSubTable(ms, "OBSERVATION"), "TELESCOPE_NAME"); + common::GetSubTable(ms, "OBSERVATION"), "TELESCOPE_NAME"); string telescope_name = telescope_name_col(0); if (telescope_name == "LOFAR") { - Table tab_field = common::getSubTable(ms, "LOFAR_ANTENNA_FIELD"); + Table tab_field = common::GetSubTable(ms, "LOFAR_ANTENNA_FIELD"); tab_field = tab_field(tab_field.col("ANTENNA_ID") == static_cast<Int>(id)); // The Station will consist of a BeamFormer that combines the fields @@ -320,11 +320,11 @@ Station::Ptr ReadLofarStation(const MeasurementSet &ms, unsigned int id, Element::Ptr(new Element(coordinate_system, model, element_id)); station->SetElement(element); } else if (telescope_name == "AARTFAAC") { - ROScalarColumn<String> ant_type_col(common::getSubTable(ms, "OBSERVATION"), + ROScalarColumn<String> ant_type_col(common::GetSubTable(ms, "OBSERVATION"), "AARTFAAC_ANTENNA_TYPE"); string ant_type = ant_type_col(0); - Table tab_field = common::getSubTable(ms, "ANTENNA"); + Table tab_field = common::GetSubTable(ms, "ANTENNA"); station->SetAntenna(ReadAntennaFieldAartfaac(tab_field, ant_type, id)); } @@ -334,7 +334,7 @@ Station::Ptr ReadLofarStation(const MeasurementSet &ms, unsigned int id, MDirection ReadTileBeamDirection(const casacore::MeasurementSet &ms) { MDirection tileBeamDir; - Table fieldTable = common::getSubTable(ms, "FIELD"); + Table fieldTable = common::GetSubTable(ms, "FIELD"); if (fieldTable.nrow() != 1) { throw std::runtime_error( diff --git a/cpp/LofarMetaDataUtil.h b/cpp/lofarreadutils.h similarity index 91% rename from cpp/LofarMetaDataUtil.h rename to cpp/lofarreadutils.h index 938b48d6..065521a3 100644 --- a/cpp/LofarMetaDataUtil.h +++ b/cpp/lofarreadutils.h @@ -1,4 +1,4 @@ -// LofarMetaDataUtil.h: Utility functions to read the meta data relevant for +// lofarreadutils.h: Utility functions to read the meta data relevant for // simulating the beam from LOFAR observations stored in MS format. // // Copyright (C) 2013 @@ -21,15 +21,15 @@ // // $Id$ -#ifndef EVERYBEAM_LOFARMETADATAUTIL_H -#define EVERYBEAM_LOFARMETADATAUTIL_H +#ifndef EVERYBEAM_LOFARREADUTILS_H_ +#define EVERYBEAM_LOFARREADUTILS_H_ // \file // Utility functions to read the meta data relevant for simulating the beam from // LOFAR observations stored in MS format. #include "station.h" -#include "element_response.h" +#include "elementresponse.h" #include <casacore/ms/MeasurementSets/MeasurementSet.h> #include <casacore/ms/MeasurementSets/MSAntennaColumns.h> @@ -74,4 +74,4 @@ void ReadStations( // this function returns the delay center. casacore::MDirection ReadTileBeamDirection(const casacore::MeasurementSet &ms); } // namespace everybeam -#endif // EVERYBEAM_LOFARMETADATAUTIL_H +#endif // EVERYBEAM_LOFARREADUTILS_H_ diff --git a/cpp/makeresponseimage.cc b/cpp/makeresponseimage.cc index 0f1741a1..63ab8e7c 100644 --- a/cpp/makeresponseimage.cc +++ b/cpp/makeresponseimage.cc @@ -24,7 +24,7 @@ #include <lofar_config.h> #include <EveryBeam/Package__Version.h> -#include <EveryBeam/LofarMetaDataUtil.h> +#include <EveryBeam/lofarreadutils.h> #include <Common/InputParSet.h> #include <Common/lofar_sstream.h> #include <Common/LofarLogger.h> @@ -148,7 +148,7 @@ bool HasSubTable(const Table &table, const string &name); * \param table The Table instance to which the sub-table is associated. * \param name The name of the sub-table. */ -Table getSubTable(const Table &table, const string &name); +Table GetSubTable(const Table &table, const string &name); /*! * \brief Attempt to read the position of the observatory. If the @@ -460,7 +460,7 @@ bool HasSubTable(const Table &table, const string &name) { return table.keywordSet().isDefined(name); } -Table getSubTable(const Table &table, const string &name) { +Table GetSubTable(const Table &table, const string &name) { return table.keywordSet().asTable(name); } @@ -523,7 +523,7 @@ MDirection readDelayReference(const MeasurementSet &ms, unsigned int idField) { MDirection readTileReference(const MeasurementSet &ms, unsigned int idField) { // The MeasurementSet class does not support LOFAR specific columns, so // we use ROArrayMeasColumn to read the tile beam reference direction. - Table tab_field = getSubTable(ms, "FIELD"); + Table tab_field = GetSubTable(ms, "FIELD"); static const String columnName = "LOFAR_TILE_BEAM_DIR"; if (HasColumn(tab_field, columnName)) { diff --git a/cpp/oskar/CMakeLists.txt b/cpp/oskar/CMakeLists.txt index 3bfc5678..30672b33 100644 --- a/cpp/oskar/CMakeLists.txt +++ b/cpp/oskar/CMakeLists.txt @@ -5,9 +5,9 @@ include_directories(${CMAKE_BINARY_DIR}) #------------------------------------------------------------------------------ # build liboskar.so add_library(oskar SHARED - OSKARElementResponse.cc - OSKARDatafile.cc - OSKARDataset.cc + oskarelementresponse.cc + oskardatafile.cc + oskardataset.cc oskar_evaluate_dipole_pattern.cc oskar_evaluate_spherical_wave_sum.cc) diff --git a/cpp/oskar/OSKARDatafile.cc b/cpp/oskar/oskardatafile.cc similarity index 54% rename from cpp/oskar/OSKARDatafile.cc rename to cpp/oskar/oskardatafile.cc index 419103bf..5e0717ac 100644 --- a/cpp/oskar/OSKARDatafile.cc +++ b/cpp/oskar/oskardatafile.cc @@ -1,30 +1,30 @@ -#include "OSKARDatafile.h" +#include "oskardatafile.h" #include <iostream> Datafile::Datafile(const std::string& filename) { // Open file std::cout << "read oskar datafile: " << filename << std::endl; - m_h5_file.reset(new H5::H5File(filename, H5F_ACC_RDONLY)); + h5_file_.reset(new H5::H5File(filename, H5F_ACC_RDONLY)); // Disable HDF5 error prints H5::Exception::dontPrint(); }; -std::shared_ptr<Dataset> Datafile::get(const unsigned int freq) { - std::lock_guard<std::mutex> lock(m_mutex); +std::shared_ptr<Dataset> Datafile::Get(const unsigned int freq) { + std::lock_guard<std::mutex> lock(mutex_); // Find dataset for frequency - auto entry = m_map.find(freq); + auto entry = map_.find(freq); // If found, retrieve pointer to dataset - if (entry != m_map.end()) { + if (entry != map_.end()) { return entry->second; } // Read and return dataset std::shared_ptr<Dataset> dataset_ptr; - dataset_ptr.reset(new Dataset(*m_h5_file, freq)); - m_map.insert({freq, dataset_ptr}); + dataset_ptr.reset(new Dataset(*h5_file_, freq)); + map_.insert({freq, dataset_ptr}); return dataset_ptr; } diff --git a/cpp/oskar/OSKARDatafile.h b/cpp/oskar/oskardatafile.h similarity index 54% rename from cpp/oskar/OSKARDatafile.h rename to cpp/oskar/oskardatafile.h index a9694231..9e186419 100644 --- a/cpp/oskar/OSKARDatafile.h +++ b/cpp/oskar/oskardatafile.h @@ -8,23 +8,23 @@ #include <H5Cpp.h> -#include "OSKARDataset.h" +#include "oskardataset.h" //! Oskar datafile interface class Datafile { public: Datafile(const std::string& filename); - std::shared_ptr<Dataset> get(const unsigned int freq); + std::shared_ptr<Dataset> Get(const unsigned int freq); private: // Coeffs; - std::map<unsigned int, std::shared_ptr<Dataset>> m_map; + std::map<unsigned int, std::shared_ptr<Dataset>> map_; // HDF5 - std::string m_filename; - std::unique_ptr<H5::H5File> m_h5_file; - mutable std::mutex m_mutex; + std::string filename_; + std::unique_ptr<H5::H5File> h5_file_; + mutable std::mutex mutex_; }; #endif \ No newline at end of file diff --git a/cpp/oskar/OSKARDataset.cc b/cpp/oskar/oskardataset.cc similarity index 83% rename from cpp/oskar/OSKARDataset.cc rename to cpp/oskar/oskardataset.cc index 2aaf885d..455f5d8b 100644 --- a/cpp/oskar/OSKARDataset.cc +++ b/cpp/oskar/oskardataset.cc @@ -1,7 +1,7 @@ #include <iostream> #include <cassert> -#include "OSKARDataset.h" +#include "oskardataset.h" Dataset::Dataset(H5::H5File& h5_file, const unsigned int freq) { // Try to read coefficients for this frequency @@ -44,16 +44,16 @@ Dataset::Dataset(H5::H5File& h5_file, const unsigned int freq) { assert(l_max * (l_max + 2) == nr_coeffs); // Set members - m_nr_elements = nr_elements; - m_nr_coeffs = nr_coeffs; - m_l_max = l_max; + nr_elements_ = nr_elements; + nr_coeffs_ = nr_coeffs; + l_max_ = l_max; // Read coefficients into data vector - m_data.resize(nr_elements * nr_coeffs * 4); - assert(dims[0] * dims[1] * dims[2] == m_data.size()); + data_.resize(nr_elements * nr_coeffs * 4); + assert(dims[0] * dims[1] * dims[2] == data_.size()); H5::DataType data_type = dataset.getDataType(); assert(data_type.getSize() == sizeof(std::complex<double>)); - dataset.read(m_data.data(), data_type, dataspace); + dataset.read(data_.data(), data_type, dataspace); } catch (H5::FileIException& e) { std::stringstream message; message << "Could not load dataset for frequency " << dataset_name @@ -63,11 +63,11 @@ Dataset::Dataset(H5::H5File& h5_file, const unsigned int freq) { } size_t Dataset::GetIndex(const unsigned int element) const { - return element * m_nr_coeffs * 4; + return element * nr_coeffs_ * 4; } std::complex<double>* Dataset::GetAlphaPtr(const unsigned int element) { - assert(element < get_nr_elements()); + assert(element < GetNrElements()); size_t index = GetIndex(element); - return m_data.data() + index; + return data_.data() + index; } diff --git a/cpp/oskar/OSKARDataset.h b/cpp/oskar/oskardataset.h similarity index 72% rename from cpp/oskar/OSKARDataset.h rename to cpp/oskar/oskardataset.h index 7fc94efa..1d0e4e7d 100644 --- a/cpp/oskar/OSKARDataset.h +++ b/cpp/oskar/oskardataset.h @@ -19,8 +19,8 @@ class Dataset { Dataset(H5::H5File& h5_file, const unsigned int freq); // Get - size_t get_nr_elements() const { return m_nr_elements; }; - size_t GetLMax() const { return m_l_max; }; + size_t GetNrElements() const { return nr_elements_; }; + size_t GetLMax() const { return l_max_; }; std::complex<double>* GetAlphaPtr(const unsigned int element); @@ -32,10 +32,10 @@ class Dataset { const unsigned int dataset_rank_ = 3; // Members - std::vector<std::complex<double>> m_data; - unsigned int m_nr_elements; - unsigned int m_nr_coeffs; - unsigned int m_l_max; + std::vector<std::complex<double>> data_; + unsigned int nr_elements_; + unsigned int nr_coeffs_; + unsigned int l_max_; }; #endif \ No newline at end of file diff --git a/cpp/oskar/OSKARElementResponse.cc b/cpp/oskar/oskarelementresponse.cc similarity index 93% rename from cpp/oskar/OSKARElementResponse.cc rename to cpp/oskar/oskarelementresponse.cc index 2a365382..392f5c1f 100644 --- a/cpp/oskar/OSKARElementResponse.cc +++ b/cpp/oskar/oskarelementresponse.cc @@ -1,4 +1,4 @@ -#include "OSKARElementResponse.h" +#include "oskarelementresponse.h" #include "oskar.h" #include "config.h" #include <iostream> @@ -21,12 +21,12 @@ void OSKARElementResponseDipole::Response( OSKARElementResponseSphericalWave::OSKARElementResponseSphericalWave() { std::string path = GetPath("oskar.h5"); - m_datafile.reset(new Datafile(path)); + datafile_.reset(new Datafile(path)); } OSKARElementResponseSphericalWave::OSKARElementResponseSphericalWave( const std::string& path) { - m_datafile.reset(new Datafile(path)); + datafile_.reset(new Datafile(path)); } void OSKARElementResponseSphericalWave::Response( @@ -44,7 +44,7 @@ void OSKARElementResponseSphericalWave::Response( void OSKARElementResponseSphericalWave::Response( int element_id, double freq, double theta, double phi, std::complex<double> (&response)[2][2]) const { - auto dataset = m_datafile->get(freq); + auto dataset = datafile_->Get(freq); auto l_max = dataset->GetLMax(); std::complex<double>* response_ptr = (std::complex<double>*)response; diff --git a/cpp/oskar/OSKARElementResponse.h b/cpp/oskar/oskarelementresponse.h similarity index 94% rename from cpp/oskar/OSKARElementResponse.h rename to cpp/oskar/oskarelementresponse.h index 310c5412..6c897355 100644 --- a/cpp/oskar/OSKARElementResponse.h +++ b/cpp/oskar/oskarelementresponse.h @@ -1,10 +1,10 @@ #ifndef OSKAR_ELEMENTRESPONSE_H #define OSKAR_ELEMENTRESPONSE_H -#include "../element_response.h" +#include "../elementresponse.h" #include "../common/singleton.h" -#include "OSKARDatafile.h" +#include "oskardatafile.h" #include <memory> @@ -55,7 +55,7 @@ class OSKARElementResponseSphericalWave : public ElementResponse { protected: std::string GetPath(const char *) const; - std::unique_ptr<Datafile> m_datafile; + std::unique_ptr<Datafile> datafile_; }; } // namespace everybeam diff --git a/cpp/station.cc b/cpp/station.cc index d4c58a7f..8d932eec 100644 --- a/cpp/station.cc +++ b/cpp/station.cc @@ -21,11 +21,11 @@ // $Id$ #include "station.h" -#include "common/math_utils.h" +#include "common/mathutils.h" -#include "hamaker/HamakerElementResponse.h" -#include "oskar/OSKARElementResponse.h" -#include "lobes/LOBESElementResponse.h" +#include "hamaker/hamakerelementresponse.h" +#include "oskar/oskarelementresponse.h" +#include "lobes/lobeselementresponse.h" using namespace everybeam; diff --git a/cpp/station.h b/cpp/station.h index 0e54089f..9f47426e 100644 --- a/cpp/station.h +++ b/cpp/station.h @@ -27,10 +27,10 @@ // \file // Representation of the station beam former. -#include "element_response.h" +#include "elementresponse.h" #include "antenna.h" #include "beamformer.h" -#include "coords/ITRFDirection.h" +#include "coords/itrfdirection.h" #include "common/types.h" #include <memory> diff --git a/cpp/telescope/lofar.cc b/cpp/telescope/lofar.cc index a8e98688..49c800a3 100644 --- a/cpp/telescope/lofar.cc +++ b/cpp/telescope/lofar.cc @@ -1,8 +1,8 @@ #include "lofar.h" -#include "./../gridded_response/lofargrid.h" -#include "./../common/math_utils.h" -#include "./../common/casa_utils.h" -#include "../LofarMetaDataUtil.h" +#include "../griddedresponse/lofargrid.h" +#include "../common/mathutils.h" +#include "../common/casautils.h" +#include "../lofarreadutils.h" #include <aocommon/banddata.h> #include <cassert> @@ -97,12 +97,12 @@ LOFAR::LOFAR(MeasurementSet &ms, const ElementResponseModel model, .preapplied_beam_dir = preapplied_beam_dir}; } -std::unique_ptr<gridded_response::GriddedResponse> LOFAR::GetGriddedResponse( +std::unique_ptr<griddedresponse::GriddedResponse> LOFAR::GetGriddedResponse( const coords::CoordinateSystem &coordinate_system) { // Get and return GriddedResponse ptr - std::unique_ptr<gridded_response::GriddedResponse> grid( - new gridded_response::LOFARGrid(this, coordinate_system)); - // gridded_response::GriddedResponse grid(LOFARGrid(this, coordinate_system)); + std::unique_ptr<griddedresponse::GriddedResponse> grid( + new griddedresponse::LOFARGrid(this, coordinate_system)); + // griddedresponse::GriddedResponse grid(LOFARGrid(this, coordinate_system)); return grid; }; diff --git a/cpp/telescope/lofar.h b/cpp/telescope/lofar.h index 94561000..553116e0 100644 --- a/cpp/telescope/lofar.h +++ b/cpp/telescope/lofar.h @@ -34,16 +34,16 @@ namespace everybeam { -namespace gridded_response { +namespace griddedresponse { class LOFARGrid; class GriddedResponse; -} // namespace gridded_response +} // namespace griddedresponse namespace telescope { //! LOFAR telescope class class LOFAR final : public Telescope { - friend class gridded_response::LOFARGrid; + friend class griddedresponse::LOFARGrid; public: /** @@ -56,7 +56,7 @@ class LOFAR final : public Telescope { LOFAR(casacore::MeasurementSet &ms, const ElementResponseModel model, const Options &options); - std::unique_ptr<gridded_response::GriddedResponse> GetGriddedResponse( + std::unique_ptr<griddedresponse::GriddedResponse> GetGriddedResponse( const coords::CoordinateSystem &coordinate_system) override; private: diff --git a/cpp/telescope/telescope.h b/cpp/telescope/telescope.h index bb5458da..97901731 100644 --- a/cpp/telescope/telescope.h +++ b/cpp/telescope/telescope.h @@ -24,9 +24,9 @@ #ifndef EVERYBEAM_TELESCOPE_TELESCOPE_H_ #define EVERYBEAM_TELESCOPE_TELESCOPE_H_ -#include "./../station.h" -#include "./../options.h" -#include "./../element_response.h" +#include "../station.h" +#include "../options.h" +#include "../elementresponse.h" #include <vector> #include <memory> @@ -36,7 +36,7 @@ namespace everybeam { -namespace gridded_response { +namespace griddedresponse { class GriddedResponse; } @@ -58,7 +58,7 @@ class Telescope { * @param coordinate_system Coordinate system struct * @return GriddedResponse::Ptr */ - virtual std::unique_ptr<gridded_response::GriddedResponse> GetGriddedResponse( + virtual std::unique_ptr<griddedresponse::GriddedResponse> GetGriddedResponse( const coords::CoordinateSystem &coordinate_system) = 0; /** diff --git a/cpp/test/tload_lofar.cc b/cpp/test/tload_lofar.cc index 8d07ff43..c061eaa1 100644 --- a/cpp/test/tload_lofar.cc +++ b/cpp/test/tload_lofar.cc @@ -1,9 +1,9 @@ #include <boost/test/unit_test.hpp> -#include "./../load.h" -#include "./../options.h" -#include "./../gridded_response/lofargrid.h" -#include "./../element_response.h" +#include "../load.h" +#include "../options.h" +#include "../griddedresponse/lofargrid.h" +#include "../elementresponse.h" #include "../../external/npy.hpp" #include "config.h" @@ -47,10 +47,10 @@ BOOST_AUTO_TEST_CASE(load_lofar) { .dm = dm, .phase_centre_dl = shift_l, .phase_centre_dm = shift_m}; - std::unique_ptr<gridded_response::GriddedResponse> grid_response = + std::unique_ptr<griddedresponse::GriddedResponse> grid_response = telescope->GetGriddedResponse(coord_system); BOOST_CHECK(nullptr != - dynamic_cast<gridded_response::LOFARGrid*>(grid_response.get())); + dynamic_cast<griddedresponse::LOFARGrid*>(grid_response.get())); // Define buffer and get gridded responses std::vector<std::complex<float>> antenna_buffer_single( @@ -86,13 +86,13 @@ BOOST_AUTO_TEST_CASE(load_lofar) { 1e-4); } - std::vector<std::complex<float>> antenna_buffer_all( - grid_response->GetBufferSize(telescope->GetNrStations())); - grid_response->CalculateAllStations(antenna_buffer_all.data(), time, - frequency); - BOOST_CHECK_EQUAL( - antenna_buffer_all.size(), - std::size_t(telescope->GetNrStations() * width * height * 2 * 2)); + // std::vector<std::complex<float>> antenna_buffer_all( + // grid_response->GetBufferSize(telescope->GetNrStations())); + // grid_response->CalculateAllStations(antenna_buffer_all.data(), time, + // frequency); + // BOOST_CHECK_EQUAL( + // antenna_buffer_all.size(), + // std::size_t(telescope->GetNrStations() * width * height * 2 * 2)); // Test with differential beam, single Options options_diff_beam; @@ -102,7 +102,7 @@ BOOST_AUTO_TEST_CASE(load_lofar) { std::unique_ptr<telescope::Telescope> telescope_diff_beam = Load(ms, response_model, options_diff_beam); - std::unique_ptr<gridded_response::GriddedResponse> grid_response_diff_beam = + std::unique_ptr<griddedresponse::GriddedResponse> grid_response_diff_beam = telescope_diff_beam->GetGriddedResponse(coord_system); std::vector<std::complex<float>> antenna_buffer_diff_beam( diff --git a/demo/beam-helper.cpp b/demo/beam-helper.cpp index 26141de2..402cd1f5 100644 --- a/demo/beam-helper.cpp +++ b/demo/beam-helper.cpp @@ -3,9 +3,9 @@ #include <aocommon/imagecoordinates.h> #include <fitsio.h> -#include "./../cpp/common/math_utils.h" -// #include "./../cpp/coords/ITRFDirection.h" -#include "./../cpp/coords/ITRFConverter.h" +#include "./../cpp/common/mathutils.h" +// #include "./../cpp/coords/itrfdirection.h" +#include "./../cpp/coords/itrfconverter.h" void GetPhaseCentreInfo( casacore::MeasurementSet& ms, @@ -94,19 +94,19 @@ void GetITRFDirections( casacore::Quantity(ra + M_PI/2, radUnit), casacore::Quantity(0, radUnit)), casacore::MDirection::J2000); - everybeam::coords::SetITRFVector(itrfConverter.toDirection(lDir), _l_vector_itrf); + everybeam::coords::SetITRFVector(itrfConverter.ToDirection(lDir), _l_vector_itrf); casacore::MDirection mDir(casacore::MVDirection( casacore::Quantity(ra, radUnit), casacore::Quantity(dec + M_PI/2, radUnit)), casacore::MDirection::J2000); - everybeam::coords::SetITRFVector(itrfConverter.toDirection(mDir), _m_vector_itrf); + everybeam::coords::SetITRFVector(itrfConverter.ToDirection(mDir), _m_vector_itrf); casacore::MDirection nDir(casacore::MVDirection( casacore::Quantity(ra, radUnit), casacore::Quantity(dec, radUnit)), casacore::MDirection::J2000); - everybeam::coords::SetITRFVector(itrfConverter.toDirection(nDir), _n_vector_itrf); + everybeam::coords::SetITRFVector(itrfConverter.ToDirection(nDir), _n_vector_itrf); vector3r_t itrfDirection; diff --git a/demo/beam-helper.h b/demo/beam-helper.h index 8c432cd9..ab40eeb4 100644 --- a/demo/beam-helper.h +++ b/demo/beam-helper.h @@ -1,7 +1,7 @@ -#include "./../cpp/element_response.h" -#include "./../cpp/station.h" -#include "./../cpp/LofarMetaDataUtil.h" -#include "./../cpp/coords/coord_utils.h" +#include "../cpp/elementresponse.h" +#include "../cpp/station.h" +#include "../cpp/lofarreadutils.h" +#include "../cpp/coords/coordutils.h" #include <casacore/measures/Measures/MPosition.h> #include <casacore/measures/Measures/MEpoch.h> diff --git a/demo/comparison-oskar/main.cpp b/demo/comparison-oskar/main.cpp index 9f9410c1..b3e25ac1 100644 --- a/demo/comparison-oskar/main.cpp +++ b/demo/comparison-oskar/main.cpp @@ -2,7 +2,7 @@ #include <iostream> #include <cstdlib> -#include <OSKARElementResponse.h> +#include <oskarelementresponse.h> #include "../../external/npy.hpp" // #include "npy.hpp" // to save arrays in numpy format diff --git a/demo/tStation.cc b/demo/tStation.cc index d5c08506..2e66d71c 100644 --- a/demo/tStation.cc +++ b/demo/tStation.cc @@ -1,8 +1,8 @@ #include <iostream> #include "./../cpp/station.h" -#include "./../cpp/LofarMetaDataUtil.h" -#include "./../cpp/common/math_utils.h" +#include "./../cpp/lofarreadutils.h" +#include "./../cpp/common/mathutils.h" #include "config.h" diff --git a/docs/design.md b/docs/design.md index 0b5149ae..5c2f5ac9 100644 --- a/docs/design.md +++ b/docs/design.md @@ -18,7 +18,7 @@ Design {#designpage} * The core library can use instrument specific implementations of `BeamFormers` and `Elements`. -LOFAR specific is [LofarMetaDataUtil](@ref LofarMetaDataUtil.h) which reads +LOFAR specific is [lofarreadutils](@ref lofarreadutils.h) which reads metadata from a LOFAR MeasurementSet. Based on that data it composes Station consisting of BeamFormers and Elements. diff --git a/python/lobes/lobes.cc b/python/lobes/lobes.cc index 8a606ad9..0aa5138f 100644 --- a/python/lobes/lobes.cc +++ b/python/lobes/lobes.cc @@ -129,15 +129,15 @@ std::pair<Eigen::VectorXcd, Eigen::VectorXcd> F4far_new( return std::make_pair(q2, q3); } -Eigen::Array<std::complex<double>, 2, 2> element_response_lba(double freq, - double theta, - double phi) { +Eigen::Array<std::complex<double>, 2, 2> ElementResponseLBA(double freq, + double theta, + double phi) { Eigen::Array<std::complex<double>, 2, 2> response; typedef std::complex<double> Response[2][2]; Response &response_ = *((Response *)response.data()); - everybeam::element_response_lba(freq, theta, phi, response_); + everybeam::ElementResponseLBA(freq, theta, phi, response_); return std::move(response); } @@ -339,7 +339,7 @@ PYBIND11_MODULE(lobes, m) { m.def("P", &P, "Legendre"); m.def("Pacc", &Pacc, "Legendre"); m.def("F4far_new", &F4far_new, "F4far_new"); - m.def("element_response_lba", &element_response_lba, "element_response_lba"); + m.def("ElementResponseLBA", &ElementResponseLBA, "ElementResponseLBA"); py::class_<LobesBeamModel>(m, "LobesBeamModel") .def(py::init<const std::string &>()) diff --git a/python/pyeverybeam.cc.tmp b/python/pyeverybeam.cc.tmp index dd96edf0..90bf070c 100644 --- a/python/pyeverybeam.cc.tmp +++ b/python/pyeverybeam.cc.tmp @@ -19,9 +19,9 @@ // // $Id: pystationresponse.cc 33141 2015-12-16 15:10:19Z dijkema $ -#include "ITRFDirection.h" -#include "LofarMetaDataUtil.h" -#include "Station.h" +#include "itrfdirection.h" +#include "lofarreadutils.h" +#include "station.h" #include <casacore/casa/Arrays/Array.h> #include <casacore/casa/Arrays/Matrix.h> diff --git a/scripts/coeff_scripts/convert_coeff.py b/scripts/coeff_scripts/convert_coeff.py index 4d909ba9..19714879 100755 --- a/scripts/coeff_scripts/convert_coeff.py +++ b/scripts/coeff_scripts/convert_coeff.py @@ -61,8 +61,8 @@ def main(args): Examples: - ./convert_coeff.py element_beam_LBA.coeff DefaultCoeffLBA.cc default_lba - ./convert_coeff.py element_beam_HBA.coeff DefaultCoeffHBA.cc default_hba + ./convert_coeff.py element_beam_LBA.coeff defaultcoefflba.cc default_lba + ./convert_coeff.py element_beam_HBA.coeff defaultcoeffhba.cc default_hba """ print "converting %s -> %s (variable name: %s)" % (args[0], args[1], args[2]) -- GitLab