diff --git a/.clang-format b/.clang-format index a0a17c17ab6507017f353333e987fd5c810a43df..e077ae2639efbd86dd1d7b49d6ed35f96ba7f5e5 100644 --- a/.clang-format +++ b/.clang-format @@ -1,48 +1,157 @@ --- +Language: Cpp # BasedOnStyle: Google AccessModifierOffset: -1 -ConstructorInitializerIndentWidth: 4 -AlignEscapedNewlinesLeft: true +AlignAfterOpenBracket: Align +AlignConsecutiveMacros: false +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignEscapedNewlines: Left +AlignOperands: true AlignTrailingComments: true +AllowAllArgumentsOnNextLine: true +AllowAllConstructorInitializersOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: true -AllowShortIfStatementsOnASingleLine: true +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: All +AllowShortLambdasOnASingleLine: All +AllowShortIfStatementsOnASingleLine: WithoutElse AllowShortLoopsOnASingleLine: true -AlwaysBreakTemplateDeclarations: true +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: true -BreakBeforeBinaryOperators: false +AlwaysBreakTemplateDeclarations: Yes +BinPackArguments: true +BinPackParameters: true +BraceWrapping: + AfterCaseLabel: false + AfterClass: false + AfterControlStatement: false + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: false + AfterUnion: false + AfterExternBlock: false + BeforeCatch: false + BeforeElse: false + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +BreakBeforeBinaryOperators: None +BreakBeforeBraces: Attach +BreakBeforeInheritanceComma: false +BreakInheritanceList: BeforeColon BreakBeforeTernaryOperators: true BreakConstructorInitializersBeforeComma: false -BinPackParameters: true +BreakConstructorInitializers: BeforeColon +BreakAfterJavaFieldAnnotations: false +BreakStringLiterals: true ColumnLimit: 80 +CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: false ConstructorInitializerAllOnOneLineOrOnePerLine: true -DerivePointerBinding: true +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +DerivePointerAlignment: true +DisableFormat: false ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: true +ForEachMacros: + - foreach + - Q_FOREACH + - BOOST_FOREACH +IncludeBlocks: Regroup +IncludeCategories: + - Regex: '^<ext/.*\.h>' + Priority: 2 + - Regex: '^<.*\.h>' + Priority: 1 + - Regex: '^<.*' + Priority: 2 + - Regex: '.*' + Priority: 3 +IncludeIsMainRegex: '([-_](test|unittest))?$' IndentCaseLabels: true +IndentPPDirectives: None +IndentWidth: 2 +IndentWrappedFunctionNames: false +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: false +MacroBlockBegin: '' +MacroBlockEnd: '' MaxEmptyLinesToKeep: 1 NamespaceIndentation: None -ObjCSpaceBeforeProtocolList: false +ObjCBinPackProtocolList: Never +ObjCBlockIndentWidth: 2 +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: true +PenaltyBreakAssignment: 2 PenaltyBreakBeforeFirstCallParameter: 1 -PenaltyBreakComment: 60 -PenaltyBreakString: 1000 +PenaltyBreakComment: 300 PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyBreakTemplateDeclaration: 10 PenaltyExcessCharacter: 1000000 PenaltyReturnTypeOnItsOwnLine: 200 -PointerBindsToType: true +PointerAlignment: Left +RawStringFormats: + - Language: Cpp + Delimiters: + - cc + - CC + - cpp + - Cpp + - CPP + - 'c++' + - 'C++' + CanonicalDelimiter: '' + BasedOnStyle: google + - Language: TextProto + Delimiters: + - pb + - PB + - proto + - PROTO + EnclosingFunctions: + - EqualsProto + - EquivToProto + - PARSE_PARTIAL_TEXT_PROTO + - PARSE_TEST_PROTO + - PARSE_TEXT_PROTO + - ParseTextOrDie + - ParseTextProtoOrDie + CanonicalDelimiter: '' + BasedOnStyle: google +ReflowComments: true +SortIncludes: false +SortUsingDeclarations: true +SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: ControlStatements +SpaceBeforeRangeBasedForLoopColon: true +SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 2 -Cpp11BracedListStyle: true +SpacesInAngles: false +SpacesInContainerLiterals: true +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false Standard: Auto -IndentWidth: 2 +StatementMacros: + - Q_UNUSED + - QT_REQUIRE_VERSION TabWidth: 8 UseTab: Never -BreakBeforeBraces: Attach -IndentFunctionDeclarationAfterType: true -SortIncludes: false -SpacesInParentheses: false -SpacesInAngles: false -SpaceInEmptyParentheses: false -SpacesInCStyleCastParentheses: false -SpaceAfterControlStatementKeyword: true -SpaceBeforeAssignmentOperators: true -ContinuationIndentWidth: 4 ... diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 82a6e5bccaf372f836df03b0868e93cb120ba1bf..bf560c716bfe80d42f8b9f93a3d902a940890837 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,8 +4,8 @@ stages: - build-lofarbeam - build-doc - deploy-doc - - build-dependency - - test-dependency + # - build-dependency + # - test-dependency - deploy build-base: @@ -23,7 +23,9 @@ clang-format: stage: clang-format image: $CI_REGISTRY_IMAGE:base script: - - apt-get update && apt-get -y install clang-format + # - apt-get update && apt-get -y install clang-format + - apt-get -y install python3-pip + - pip3 install clang-format - ./scripts/clang-format-check.sh build-lofarbeam: @@ -68,50 +70,50 @@ deploy-doc: refs: - master -build-dp3: - stage: build-dependency - script: - - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - - > - docker build - --build-arg CI_REGISTRY_IMAGE=$CI_REGISTRY_IMAGE - --build-arg CI_COMMIT_SHORT_SHA=$CI_COMMIT_SHORT_SHA - --tag $CI_REGISTRY_IMAGE:dp3-$CI_COMMIT_SHORT_SHA - -f ./test/Dockerfile-dp3 . - - docker push $CI_REGISTRY_IMAGE:dp3-$CI_COMMIT_SHORT_SHA +# build-dp3: +# stage: build-dependency +# script: +# - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY +# - > +# docker build +# --build-arg CI_REGISTRY_IMAGE=$CI_REGISTRY_IMAGE +# --build-arg CI_COMMIT_SHORT_SHA=$CI_COMMIT_SHORT_SHA +# --tag $CI_REGISTRY_IMAGE:dp3-$CI_COMMIT_SHORT_SHA +# -f ./test/Dockerfile-dp3 . +# - docker push $CI_REGISTRY_IMAGE:dp3-$CI_COMMIT_SHORT_SHA -build-wsclean: - stage: build-dependency - script: - - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - - > - docker build - --build-arg CI_REGISTRY_IMAGE=$CI_REGISTRY_IMAGE - --build-arg CI_COMMIT_SHORT_SHA=$CI_COMMIT_SHORT_SHA - --tag $CI_REGISTRY_IMAGE:wsclean-$CI_COMMIT_SHORT_SHA - -f ./test/Dockerfile-wsclean . - - docker push $CI_REGISTRY_IMAGE:wsclean-$CI_COMMIT_SHORT_SHA +# build-wsclean: +# stage: build-dependency +# script: +# - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY +# - > +# docker build +# --build-arg CI_REGISTRY_IMAGE=$CI_REGISTRY_IMAGE +# --build-arg CI_COMMIT_SHORT_SHA=$CI_COMMIT_SHORT_SHA +# --tag $CI_REGISTRY_IMAGE:wsclean-$CI_COMMIT_SHORT_SHA +# -f ./test/Dockerfile-wsclean . +# - docker push $CI_REGISTRY_IMAGE:wsclean-$CI_COMMIT_SHORT_SHA -test-dp3: - variables: - GIT_STRATEGY: none - stage: test-dependency - script: - - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - - > - docker run - $CI_REGISTRY_IMAGE:dp3-$CI_COMMIT_SHORT_SHA - /opt/lofarbeam/lofarbeam/test/tDockerDP3 +# test-dp3: +# variables: +# GIT_STRATEGY: none +# stage: test-dependency +# script: +# - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY +# - > +# docker run +# $CI_REGISTRY_IMAGE:dp3-$CI_COMMIT_SHORT_SHA +# /opt/lofarbeam/lofarbeam/test/tDockerDP3 -test-wsclean: - variables: - GIT_STRATEGY: none - stage: test-dependency - script: - - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - - > - docker pull - $CI_REGISTRY_IMAGE:wsclean-$CI_COMMIT_SHORT_SHA +# test-wsclean: +# variables: +# GIT_STRATEGY: none +# stage: test-dependency +# script: +# - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY +# - > +# docker pull +# $CI_REGISTRY_IMAGE:wsclean-$CI_COMMIT_SHORT_SHA deploy: variables: diff --git a/Antenna.cc b/Antenna.cc index c5f4b5bb702384d2dbc4fee0844d50a69f20f5c8..1fbd589b6252aee220f069a7963a20589ee89b11 100644 --- a/Antenna.cc +++ b/Antenna.cc @@ -2,8 +2,7 @@ #include "MathUtil.h" -namespace LOFAR { -namespace StationResponse { +namespace everybeam { vector3r_t Antenna::transform_to_local_direction(const vector3r_t &direction) { vector3r_t local_direction{ @@ -15,5 +14,4 @@ vector3r_t Antenna::transform_to_local_direction(const vector3r_t &direction) { return local_direction; } -} // namespace StationResponse -} // namespace LOFAR \ No newline at end of file +} // namespace everybeam \ No newline at end of file diff --git a/Antenna.h b/Antenna.h index 1a8d6ba0cccf65b0d145e503cf46e72d2a8928b5..717f390c178b6f8d4c5cc83b8b5b5acd9ea0f6e0 100644 --- a/Antenna.h +++ b/Antenna.h @@ -1,5 +1,5 @@ -#ifndef ANTENNA_H -#define ANTENNA_H +#ifndef EVERYBEAM_ANTENNA_H +#define EVERYBEAM_ANTENNA_H #include <complex> #include <memory> @@ -7,8 +7,7 @@ #include "Types.h" -namespace LOFAR { -namespace StationResponse { +namespace everybeam { class Antenna { @@ -157,6 +156,5 @@ private: }; -} // namespace StationResponse -} // namespace LOFAR +} // namespace everybeam #endif diff --git a/BeamFormer.cc b/BeamFormer.cc index c0efd2fe3a4ad0010bf811cb3993e1de8800c8a5..5b9a412b832d351193e2af4ce148861158eb300f 100644 --- a/BeamFormer.cc +++ b/BeamFormer.cc @@ -5,8 +5,7 @@ #include <cmath> -namespace LOFAR { -namespace StationResponse { +namespace everybeam { vector3r_t BeamFormer::transform_to_local_position(const vector3r_t &position) { vector3r_t dposition{position[0] - m_coordinate_system.origin[0], @@ -52,14 +51,14 @@ std::vector<std::complex<double>> BeamFormer::compute_geometric_response( direction[2] * (antenna->m_phase_reference_position[2] - m_local_phase_reference_position[2]); - double phase = -2 * M_PI * dl / (Constants::c / freq); + double phase = -2 * M_PI * dl / (constants::c / freq); result.push_back({std::sin(phase), std::cos(phase)}); } return result; } std::vector<std::pair<std::complex<double>, std::complex<double>>> - BeamFormer::compute_weights(const vector3r_t &pointing, double freq) const { +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}; auto geometric_response = compute_geometric_response(freq, pointing); @@ -110,5 +109,4 @@ matrix22c_t BeamFormer::local_response(real_t time, real_t freq, return result; } -} // namespace StationResponse -} // namespace LOFAR +} // namespace everybeam diff --git a/BeamFormer.h b/BeamFormer.h index 1383431a62c9433b5c90853ce322fff72bb5fb74..c12a350dd2f6a63a541bd9d58476008d35c2d8bc 100644 --- a/BeamFormer.h +++ b/BeamFormer.h @@ -1,5 +1,5 @@ -#ifndef BEAMFORMER_H -#define BEAMFORMER_H +#ifndef EVERYBEAM_BEAMFORMER_H +#define EVERYBEAM_BEAMFORMER_H #include <complex> #include <vector> @@ -7,8 +7,7 @@ #include "Element.h" #include "Types.h" -namespace LOFAR { -namespace StationResponse { +namespace everybeam { class BeamFormer : public Antenna { @@ -65,8 +64,7 @@ private: }; -} // namespace StationResponse -} // namespace LOFAR +} // namespace everybeam #endif diff --git a/CMake/FindBeamModel.cmake b/CMake/FindBeamModel.cmake index 8eca9a8142d7deabacf536b5bd50d39cf32dd52b..ac2e9c19b26f026e62a2032ef33749c98f9183c8 100644 --- a/CMake/FindBeamModel.cmake +++ b/CMake/FindBeamModel.cmake @@ -9,14 +9,14 @@ find_package(PackageHandleStandardArgs) find_path( BEAMMODEL_INCLUDE_DIR - NAMES StationResponse/Station.h + NAMES EveryBeam/Station.h HINTS ${BEAMMODEL_ROOT_DIR} PATH_SUFFIXES include ) find_library( BEAMMODEL_STATION_RESPONSE_LIBRARY - NAMES stationresponse + NAMES everybeam HINTS ${BEAMMODEL_ROOT_DIR} PATH_SUFFIXES lib ) diff --git a/CMakeLists.txt b/CMakeLists.txt index e4b31b4701ef44eb57c050006cc9917ae4c4117f..26471d57316494f9b544e17d33628107aae59eeb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,7 +39,7 @@ add_subdirectory(oskar) add_compile_options(-std=c++11 -Wall -DNDEBUG -Wl,--no-undefined) -add_library(stationresponse SHARED +add_library(everybeam SHARED Antenna.cc ElementResponse.cc BeamFormer.cc @@ -52,18 +52,18 @@ add_library(stationresponse SHARED Types.cc ) -set_target_properties(stationresponse PROPERTIES +set_target_properties(everybeam PROPERTIES CXX_STANDARD 17 VERSION 3 ) -target_include_directories(stationresponse PUBLIC ${CASACORE_INCLUDE_DIR}) +target_include_directories(everybeam PUBLIC ${CASACORE_INCLUDE_DIR}) -target_link_libraries(stationresponse PUBLIC ${CASACORE_LIBRARIES}) +target_link_libraries(everybeam PUBLIC ${CASACORE_LIBRARIES}) -target_link_libraries(stationresponse PUBLIC hamaker lobes oskar) +target_link_libraries(everybeam PUBLIC hamaker lobes oskar) -install (TARGETS stationresponse DESTINATION lib) +install (TARGETS everybeam DESTINATION lib) install (FILES Antenna.h @@ -78,7 +78,7 @@ install (FILES Types.h ITRFConverter.h ITRFDirection.h -DESTINATION include/StationResponse) +DESTINATION include/EveryBeam) find_package(Doxygen) diff --git a/Constants.h b/Constants.h index 738444c6c7853f89bbeaa8ed2fc3e8deba46712b..fa9e86ffd72acc1dd4a94803e01e9ed83bc86eef 100644 --- a/Constants.h +++ b/Constants.h @@ -20,26 +20,22 @@ //# //# $Id$ -#ifndef LOFAR_STATIONRESPONSE_CONSTANTS_H -#define LOFAR_STATIONRESPONSE_CONSTANTS_H +#ifndef EVERYBEAM_CONSTANTS_H +#define EVERYBEAM_CONSTANTS_H // \file // %Constants used in this library. #include "Types.h" -namespace LOFAR { -namespace StationResponse -{ +namespace everybeam { /** %Constants used in this library. */ -namespace Constants +namespace constants { /** Speed of light (m/s) */ const real_t c = 2.99792458e+08; -} //# namespace Constants - -} //# namespace StationResponse -} // namespace LOFAR +} // namespace constants +} // namespace everybeam #endif diff --git a/Element.cc b/Element.cc index 608330836302e194a433554bab592db2ff9f3a97..80b3226c9dc326af460bbc3c46772f4afd81f0b8 100644 --- a/Element.cc +++ b/Element.cc @@ -1,8 +1,7 @@ #include "Element.h" #include "MathUtil.h" -namespace LOFAR { -namespace StationResponse { +namespace everybeam { matrix22c_t Element::local_response(real_t time, real_t freq, const vector3r_t &direction, size_t id, @@ -33,5 +32,4 @@ matrix22c_t Element::local_response(real_t time, real_t freq, return local_response(time, freq, direction, m_id, options); } -} // namespace StationResponse -} // namespace LOFAR +} // namespace everybeam diff --git a/Element.h b/Element.h index 787731f79ab501d45935e04af218a65f932f6d4f..8595563cff103844d252b76cc336631f43ca22b0 100644 --- a/Element.h +++ b/Element.h @@ -1,5 +1,5 @@ -#ifndef ELEMENT_H -#define ELEMENT_H +#ifndef EVERYBEAM_ELEMENT_H +#define EVERYBEAM_ELEMENT_H #include <complex> #include <memory> @@ -8,8 +8,7 @@ #include "ElementResponse.h" #include "Types.h" -namespace LOFAR { -namespace StationResponse { +namespace everybeam { class Element : public Antenna { @@ -42,7 +41,6 @@ private: ElementResponse::Ptr m_element_response; }; -} // namespace StationResponse -} // namespace LOFAR +} // namespace everybeam #endif diff --git a/ElementResponse.cc b/ElementResponse.cc index 6b913d9aab4da243d40ce20a44860d5bf2cb2b07..77625f618342c79f91d5f9e354a23cea5677938b 100644 --- a/ElementResponse.cc +++ b/ElementResponse.cc @@ -1,7 +1,6 @@ #include "ElementResponse.h" -namespace LOFAR { -namespace StationResponse { +namespace everybeam { std::ostream& operator<<(std::ostream& os, ElementResponseModel model) { switch (model) { @@ -26,5 +25,4 @@ std::ostream& operator<<(std::ostream& os, ElementResponseModel model) { return os; } -} // namespace StationResponse -} // namespace LOFAR +} // namespace everybeam diff --git a/ElementResponse.h b/ElementResponse.h index 3210d07373e873787946d0659bd5e32259f5e3ec..43733f2bf13983b3016d0fcc058e35161912189c 100644 --- a/ElementResponse.h +++ b/ElementResponse.h @@ -1,13 +1,12 @@ -#ifndef ELEMENTRESPONSE_H -#define ELEMENTRESPONSE_H +#ifndef EVERYBEAM_ELEMENTRESPONSE_H +#define EVERYBEAM_ELEMENTRESPONSE_H #include <complex> #include <ostream> #include "MutablePtr.h" -namespace LOFAR { -namespace StationResponse { +namespace everybeam { enum ElementResponseModel { Unknown, @@ -43,7 +42,6 @@ public: }; -} // namespace StationResponse -} // namespace LOFAR +} // namespace everybeam #endif diff --git a/ITRFConverter.cc b/ITRFConverter.cc index e55204f85386e55a6ddeacf6edfc2215f3aa8f5f..8ce27a2a8b68ce744639eb1f6e3b8eb8ae9116d1 100644 --- a/ITRFConverter.cc +++ b/ITRFConverter.cc @@ -7,12 +7,11 @@ #include <casacore/measures/Measures/MDirection.h> #include <casacore/measures/Measures/MEpoch.h> -namespace LOFAR { -namespace StationResponse { +namespace everybeam { // TODO: Initialize converter with a time (and fixed position) and convert // specific directions. -// Needed for wslean as well as for the makestationresponse executable. +// Needed for wslean as well as for the makeeverybeam executable. ITRFConverter::ITRFConverter(real_t time) { // create ITRF Direction from fixed stationposition @@ -80,5 +79,4 @@ casacore::MDirection ITRFConverter::toDirection( return itsConverter(direction); } -} // namespace StationResponse -} // namespace LOFAR +} // namespace everybeam diff --git a/ITRFConverter.h b/ITRFConverter.h index 2f527a17f7efc9f914c21f04dcb6059b56ea592c..c19b0c6a6e8611d21ce463d1686175c0421e3a1d 100644 --- a/ITRFConverter.h +++ b/ITRFConverter.h @@ -1,7 +1,7 @@ //# Dir2ITRF.h: Convertor that maps time to an ITRF direction. -#ifndef LOFAR_STATIONRESPONSE_DIR2ITRF_H -#define LOFAR_STATIONRESPONSE_DIR2ITRF_H +#ifndef EVERYBEAM_DIR2ITRF_H +#define EVERYBEAM_DIR2ITRF_H // \file // Functor that maps J2000 to an ITRF direction. @@ -14,8 +14,7 @@ #include <memory> -namespace LOFAR { -namespace StationResponse { +namespace everybeam { class ITRFConverter { @@ -38,7 +37,6 @@ private: mutable casacore::MDirection::Convert itsConverter; }; -} //# namespace StationResponse -} // namespace LOFAR +} // namespace everybeam #endif diff --git a/ITRFDirection.cc b/ITRFDirection.cc index 7a0b264c1e575073ca4f63ea57295b32afb29348..20a45cf83ecba0933ceee836d709d90244971670 100644 --- a/ITRFDirection.cc +++ b/ITRFDirection.cc @@ -26,15 +26,14 @@ #include <casacore/measures/Measures/MDirection.h> #include <casacore/measures/Measures/MEpoch.h> -namespace LOFAR { -namespace StationResponse { +namespace everybeam { // ITRF position of CS002LBA, just to use a fixed reference const vector3r_t ITRFDirection::itsLOFARPosition = { {826577.022720000, 461022.995082000, 5064892.814}}; // TODO: initialize converter with a time (and fixed position) and convert -// specific directions. Needed for wslean as well as for the makestationresponse +// specific directions. Needed for wslean as well as for the makeeverybeam // executable. ITRFDirection::ITRFDirection(const vector3r_t &position, @@ -91,5 +90,4 @@ vector3r_t ITRFDirection::at(real_t time) const { return itrf; } -} // namespace StationResponse -} // namespace LOFAR +} // namespace everybeam diff --git a/ITRFDirection.h b/ITRFDirection.h index 9e293e9a7bf807e0d1e83b067e9f74e5d8e37bf6..09234a9b2020f4176c8ef9a9bf834f1da4bd9df4 100644 --- a/ITRFDirection.h +++ b/ITRFDirection.h @@ -20,8 +20,8 @@ //# //# $Id$ -#ifndef LOFAR_STATIONRESPONSE_ITRFDIRECTION_H -#define LOFAR_STATIONRESPONSE_ITRFDIRECTION_H +#ifndef EVERYBEAM_ITRFDIRECTION_H +#define EVERYBEAM_ITRFDIRECTION_H // \file // Functor that maps time to an ITRF direction. @@ -35,8 +35,7 @@ #include <memory> #include <mutex> -namespace LOFAR { -namespace StationResponse { +namespace everybeam { class ITRFDirection { @@ -62,7 +61,6 @@ private: mutable std::mutex itsMutex; }; -} //# namespace StationResponse -} // namespace LOFAR +} // namespace everybeam #endif diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..10926e87f113fb026c366866d6fa466061562870 --- /dev/null +++ b/LICENSE @@ -0,0 +1,675 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program 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. + + This program 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 this program. If not, see <http://www.gnu.org/licenses/>. + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + <program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<http://www.gnu.org/licenses/>. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<http://www.gnu.org/philosophy/why-not-lgpl.html>. + diff --git a/LofarMetaDataUtil.cc b/LofarMetaDataUtil.cc index 6a7f6f9d3d7829215496bbb4c584b7b9233bcd01..9daf5fca4771bec9171fe2aa2bed2564d5100324 100644 --- a/LofarMetaDataUtil.cc +++ b/LofarMetaDataUtil.cc @@ -54,8 +54,7 @@ #include <casacore/ms/MeasurementSets/MSSpectralWindow.h> #include <casacore/ms/MeasurementSets/MSSpWindowColumns.h> -namespace LOFAR { -namespace StationResponse { +namespace everybeam { constexpr Antenna::CoordinateSystem::Axes lofar_antenna_orientation = { { @@ -381,5 +380,4 @@ MDirection readTileBeamDirection(const casacore::MeasurementSet &ms) { return tileBeamDir; } -} // namespace StationResponse -} // namespace LOFAR +} // namespace everybeam diff --git a/LofarMetaDataUtil.h b/LofarMetaDataUtil.h index 88ffb208660b24dc46c363b575ad7fc4af46077c..e8124a63f9d3b52b3a33ad8d309149837a3c1bd6 100644 --- a/LofarMetaDataUtil.h +++ b/LofarMetaDataUtil.h @@ -21,8 +21,8 @@ //# //# $Id$ -#ifndef LOFAR_STATIONRESPONSE_LOFARMETADATAUTIL_H -#define LOFAR_STATIONRESPONSE_LOFARMETADATAUTIL_H +#ifndef EVERYBEAM_LOFARMETADATAUTIL_H +#define EVERYBEAM_LOFARMETADATAUTIL_H // \file // Utility functions to read the meta data relevant for simulating the beam from @@ -35,8 +35,7 @@ #include <casacore/ms/MeasurementSets/MSAntennaColumns.h> #include <casacore/measures/Measures/MDirection.h> -namespace LOFAR { -namespace StationResponse { +namespace everybeam { const ElementResponseModel defaultElementResponseModel = ElementResponseModel::Hamaker; @@ -62,7 +61,6 @@ void readStations( // this function returns the delay center. casacore::MDirection readTileBeamDirection(const casacore::MeasurementSet &ms); -} //# namespace StationResponse -} // namespace LOFAR +} // namespace everybeam #endif diff --git a/MathUtil.cc b/MathUtil.cc index 4a73b10cc02277e0e0729f3aad53c3e4069f85ed..b73819ee27ea24b3cdf0bed45365d97274e75b20 100644 --- a/MathUtil.cc +++ b/MathUtil.cc @@ -22,6 +22,4 @@ #include "MathUtil.h" -namespace LOFAR { -namespace StationResponse {} // namespace StationResponse -} // namespace LOFAR +namespace everybeam {} // namespace everybeam diff --git a/MathUtil.h b/MathUtil.h index 1a1e2e318c8e5a02be8cf76debe7e9a39c95b3d2..96c555507bc34803cd1e207228db9880b29c33f6 100644 --- a/MathUtil.h +++ b/MathUtil.h @@ -20,17 +20,15 @@ //# //# $Id$ -#ifndef LOFAR_STATIONRESPONSE_MATHUTIL_H -#define LOFAR_STATIONRESPONSE_MATHUTIL_H +#ifndef EVERYBEAM_MATHUTIL_H +#define EVERYBEAM_MATHUTIL_H // \file // Various mathematical operations on vectors and matrices. #include "Types.h" -namespace LOFAR { -namespace StationResponse -{ +namespace everybeam { inline real_t dot(const vector3r_t &arg0, const vector3r_t &arg1) { @@ -158,7 +156,6 @@ inline diag22c_t normalize(const raw_array_factor_t &raw) return af; } -} //# namespace StationResponse -} // namespace LOFAR +} // namespace everybeam #endif diff --git a/MutablePtr.h b/MutablePtr.h index 65b874a2389a97390f874e5e198d3955e4e6a518..4afb5f00a47c42e896ee2468fbff88357b1d62d4 100644 --- a/MutablePtr.h +++ b/MutablePtr.h @@ -20,14 +20,12 @@ //# //# $Id$ -#ifndef LOFAR_STATIONRESPONSE_MUTABLEPTR_H -#define LOFAR_STATIONRESPONSE_MUTABLEPTR_H +#ifndef EVERYBEAM_MUTABLEPTR_H +#define EVERYBEAM_MUTABLEPTR_H #include <memory> -namespace LOFAR { -namespace StationResponse -{ +namespace everybeam { /*! * \brief MutablePtr is a mutable smart pointer derived from std::shared_ptr. @@ -85,7 +83,6 @@ public: explicit operator bool() const noexcept {return **this;} }; -} //# namespace StationResponse -} // namespace LOFAR +} // namespace everybeam #endif diff --git a/Singleton.h b/Singleton.h index ec0e96c4130c4abc02c86dffb3e695d439354617..5d8006290dbd9878f280eeeb7645e2cdabe208bb 100644 --- a/Singleton.h +++ b/Singleton.h @@ -1,5 +1,4 @@ -namespace LOFAR { -namespace StationResponse { +namespace everybeam { template<typename T> class Singleton @@ -19,5 +18,4 @@ class Singleton void operator=(Singleton const&) = delete; }; -} // namespace StationResponse -} // namespace LOFAR +} // namespace everybeam diff --git a/Station.cc b/Station.cc index 5723bdb6ff872bc9db4b4900e2b5073f9243aee8..7a0749af4c7aa263eee8f2332e21b434575ba458 100644 --- a/Station.cc +++ b/Station.cc @@ -29,8 +29,7 @@ // #include "DualDipoleAntenna.h" // #include "TileAntenna.h" -namespace LOFAR { -namespace StationResponse { +namespace everybeam { Station::Station(const std::string &name, const vector3r_t &position, const ElementResponseModel model) @@ -237,5 +236,4 @@ vector3r_t Station::ncp(real_t time) const { return itsNCP->at(time); } vector3r_t Station::ncppol0(real_t time) const { return itsNCPPol0->at(time); } -} // namespace StationResponse -} // namespace LOFAR +} // namespace everybeam diff --git a/Station.h b/Station.h index 5a32a1130e94dbddfe6d94f8e91fbe17a4db7524..e09c546394c025e614379e27d4993c01ca8461bf 100644 --- a/Station.h +++ b/Station.h @@ -20,8 +20,8 @@ //# //# $Id$ -#ifndef LOFAR_STATIONRESPONSE_STATION_H -#define LOFAR_STATIONRESPONSE_STATION_H +#ifndef EVERYBEAM_STATION_H +#define EVERYBEAM_STATION_H // \file // Representation of the station beam former. @@ -35,9 +35,7 @@ #include <memory> #include <vector> -namespace LOFAR { -namespace StationResponse -{ +namespace everybeam { class Station { @@ -411,7 +409,6 @@ void Station::arrayFactor(unsigned int count, real_t time, T freq, } } -} //# namespace StationResponse -} // namespace LOFAR +} // namespace everybeam #endif diff --git a/Types.cc b/Types.cc index ccfb3c1ba933e64c155eafee8be58c9373150632..8b5b807e8763daae9a823f4d16120cbd9685d57e 100644 --- a/Types.cc +++ b/Types.cc @@ -22,6 +22,4 @@ #include "Types.h" -namespace LOFAR { -namespace StationResponse {} // namespace StationResponse -} // namespace LOFAR +namespace everybeam {} // namespace everybeam diff --git a/Types.h b/Types.h index 7361706f3a5217b00e811ecef6e9201cc9f75d71..48ae0b63784c1acf3bc47c8a26f0bb0df18baf26 100644 --- a/Types.h +++ b/Types.h @@ -20,8 +20,8 @@ //# //# $Id$ -#ifndef LOFAR_STATIONRESPONSE_TYPES_H -#define LOFAR_STATIONRESPONSE_TYPES_H +#ifndef EVERYBEAM_TYPES_H +#define EVERYBEAM_TYPES_H // \file // Types used in this library. @@ -31,9 +31,7 @@ #include <ostream> #include <complex> -namespace LOFAR { -namespace StationResponse -{ +namespace everybeam { /** Print the contents of a static array. */ template <typename T, size_t N> @@ -103,7 +101,6 @@ std::ostream &operator<<(std::ostream &out, const std::array<T, N> &obj) return out; } -} //# namespace StationResponse -} // namespace LOFAR +} // namespace everybeam #endif diff --git a/docs/design.md b/docs/design.md index 53aa393ba1f068515eb3f413851a6caf2b4d308a..cabbd3e016d955851e9e19bc217e6a7a9acb7011 100644 --- a/docs/design.md +++ b/docs/design.md @@ -19,7 +19,7 @@ `BeamFormers` and `Elements`. LOFAR specific is [LofarMetaDataUtil](@ref LofarMetaDataUtil.h) which reads -metadata from a LOFAR MeasurementSet. Based on that thata it composes Station +metadata from a LOFAR MeasurementSet. Based on that data it composes Station consisting of BeamFormers and Elements. The inputs of a BeamFormer are elements at a given positions. @@ -35,13 +35,13 @@ HBA1 as inputs. Classes: -* [Station](@ref LOFAR::StationResponse::Station) is a thin wrapper around an +* [Station](@ref everybeam::Station) is a thin wrapper around an Element object, with some convenience functions. -* [Element](@ref LOFAR::StationResponse::Element) - something for which a +* [Element](@ref everybeam::Element) - something for which a response can be computed, can be a single element (antenna) or a beamformer. -* [BeamFormer](@ref LOFAR::StationResponse::BeamFormer) - +* [BeamFormer](@ref everybeam::BeamFormer) - Special kind of Element beamformer, has inputs that are Element objects. -* [ElementResponse](@ref LOFAR::StationResponse::ElementResponse) - response of +* [ElementResponse](@ref everybeam::ElementResponse) - response of a single element (antenna), different models can be implemented. diff --git a/hamaker/HamakerCoeff.cc b/hamaker/HamakerCoeff.cc index 66ba45ddce4b74db1f75f0eb647631fe8ce0398c..4105ec5076c5ee5d37fb923dd98f77873086dbcc 100644 --- a/hamaker/HamakerCoeff.cc +++ b/hamaker/HamakerCoeff.cc @@ -55,8 +55,8 @@ void HamakerCoefficients::set_coeffs( } std::pair<std::complex<double>, std::complex<double>> - HamakerCoefficients::get_coeff(const unsigned int n, const unsigned int t, - const unsigned int f) { +HamakerCoefficients::get_coeff(const unsigned int n, const unsigned int t, + const unsigned int f) { size_t index = get_index(n, t, f); std::pair<std::complex<double>, std::complex<double>> value; value.first = m_coeff[index]; diff --git a/hamaker/HamakerElementResponse.cc b/hamaker/HamakerElementResponse.cc index 34a8a5f23339a1e7fccfff149705a656b024641f..545e85a78f3f93c101446bc525fa7f5d88f047dc 100644 --- a/hamaker/HamakerElementResponse.cc +++ b/hamaker/HamakerElementResponse.cc @@ -9,8 +9,7 @@ #include "HamakerElementResponse.h" #include "../Singleton.h" -namespace LOFAR { -namespace StationResponse { +namespace everybeam { std::shared_ptr<HamakerElementResponse> HamakerElementResponse::getInstance( const std::string& name) { @@ -124,5 +123,4 @@ HamakerElementResponseLBA::HamakerElementResponseLBA() { m_coeffs.reset(new HamakerCoefficients(path)); } -} // namespace StationResponse -} // namespace LOFAR +} // namespace everybeam diff --git a/hamaker/HamakerElementResponse.h b/hamaker/HamakerElementResponse.h index a984a4d0640989fa7eb158a0bd56b43acf8e014c..0dc663ecffe3b207522f1828427b25e9689b04a6 100644 --- a/hamaker/HamakerElementResponse.h +++ b/hamaker/HamakerElementResponse.h @@ -1,10 +1,12 @@ +#ifndef HAMAKER_ELEMENTRESPONSE_H +#define HAMAKER_ELEMENTRESPONSE_H + #include "../ElementResponse.h" #include "HamakerCoeff.h" #include <memory> -namespace LOFAR { -namespace StationResponse { +namespace everybeam { class HamakerElementResponse : public ElementResponse { @@ -35,5 +37,6 @@ public: HamakerElementResponseLBA(); }; -} // namespace StationResponse -} // namespace LOFAR +} // namespace everybeam + +#endif diff --git a/lobes/ElementResponse.cc b/lobes/ElementResponse.cc index 9be03164213b9986b6eccb44d83c00bedb41c164..f11591f209a861605b4266fc2f5076579c982f64 100644 --- a/lobes/ElementResponse.cc +++ b/lobes/ElementResponse.cc @@ -32,7 +32,7 @@ namespace { #include "DefaultCoeffHBA.cc" } // namespace -namespace LOFAR { +namespace everybeam { void element_response_lba(double freq, double theta, double phi, std::complex<double> (&response)[2][2]) { @@ -144,4 +144,4 @@ void element_response(double freq, double theta, double phi, } } -} // namespace LOFAR +} // namespace everybeam diff --git a/lobes/ElementResponse.h b/lobes/ElementResponse.h index f95ba672544e94f30f6046d752f3cf73ffa1c853..fbcac1389ba0826107a4d7cf13ab06c1b7df1ba7 100644 --- a/lobes/ElementResponse.h +++ b/lobes/ElementResponse.h @@ -30,7 +30,7 @@ #include <complex> -namespace LOFAR +namespace everybeam { // \addtogroup ElementResponse @@ -96,6 +96,6 @@ void element_response(double freq, double theta, double phi, // @} -} //# namespace LOFAR +} //# namespace everybeam #endif diff --git a/lobes/LOBESElementResponse.cc b/lobes/LOBESElementResponse.cc index a475f56929b0f8e28886fe4fab1cda7643e79423..4c628fe0ae42b3647fa236385088ba9043782d6e 100644 --- a/lobes/LOBESElementResponse.cc +++ b/lobes/LOBESElementResponse.cc @@ -2,8 +2,7 @@ #include <map> -namespace LOFAR { -namespace StationResponse { +namespace everybeam { LOBESElementResponse::LOBESElementResponse(std::string name) {} @@ -24,5 +23,4 @@ std::shared_ptr<LOBESElementResponse> LOBESElementResponse::getInstance( return entry->second; }; -} // namespace StationResponse -} // namespace LOFAR +} // namespace everybeam diff --git a/lobes/LOBESElementResponse.h b/lobes/LOBESElementResponse.h index 7b9d7d1c4ad41e797e8bdf7b203b6d17a735c04b..c63306019988ffd53698036c37c994a2f28a8910 100644 --- a/lobes/LOBESElementResponse.h +++ b/lobes/LOBESElementResponse.h @@ -1,9 +1,11 @@ +#ifndef LOBES_ELEMENTRESPONSE_H +#define LOBES_ELEMENTRESPONSE_H + #include "../ElementResponse.h" #include <memory> -namespace LOFAR { -namespace StationResponse { +namespace everybeam { class LOBESElementResponse : public ElementResponse { @@ -20,5 +22,6 @@ public: static std::shared_ptr<LOBESElementResponse> getInstance(std::string name); }; -} // namespace StationResponse -} // namespace LOFAR +} // namespace everybeam + +#endif diff --git a/lobes/lobes.cc b/lobes/lobes.cc index ff5db10e9bfa9145cde79b2b1ad05f8b5ba07385..8a606ad95c4327a5943667ed846abb56d27fedeb 100644 --- a/lobes/lobes.cc +++ b/lobes/lobes.cc @@ -104,7 +104,6 @@ std::pair<Eigen::VectorXcd, Eigen::VectorXcd> F4far_new( Eigen::ArrayXcd exp_i_m_phi = Eigen::exp(1.0i * double(m) * phi); if (s == 1) { - q2 = C * std::pow(-1.0i, -n - 1) / beta * 1.0i * double(m) / (sin_theta)*std::sqrt((2. * n + 1) / 2.0 * std::tgamma(n - std::abs(m) + 1) / @@ -138,7 +137,7 @@ Eigen::Array<std::complex<double>, 2, 2> element_response_lba(double freq, typedef std::complex<double> Response[2][2]; Response &response_ = *((Response *)response.data()); - LOFAR::element_response_lba(freq, theta, phi, response_); + everybeam::element_response_lba(freq, theta, phi, response_); return std::move(response); } @@ -234,7 +233,6 @@ LobesBeamModel::LobesBeamModel(const std::string &data_file_name) { py::array_t<std::complex<double>> LobesBeamModel::eval( py::EigenDRef<const Eigen::ArrayXd> theta, py::EigenDRef<const Eigen::ArrayXd> phi) { - double beta; for (auto [i, freq] : enumerate(m_frequencies)) { beta = 2.0 * M_PI * freq / 2.99792458e8; @@ -327,7 +325,6 @@ py::array_t<std::complex<double>> LobesBeamModel::eval( // } PYBIND11_MODULE(lobes, m) { - m.doc() = "LOBES module"; // optional module docstring m.def("plustwo", &plustwo, "A function which adds two to a number"); diff --git a/makeresponseimage.cc b/makeresponseimage.cc index 850bc7929edd683bfaf3aaa41e4878dddeb76364..23e079d52f634a6726118f9fc4676801657e6935 100644 --- a/makeresponseimage.cc +++ b/makeresponseimage.cc @@ -23,8 +23,8 @@ #include <lofar_config.h> -#include <StationResponse/Package__Version.h> -#include <StationResponse/LofarMetaDataUtil.h> +#include <EveryBeam/Package__Version.h> +#include <EveryBeam/LofarMetaDataUtil.h> #include <Common/InputParSet.h> #include <Common/lofar_sstream.h> #include <Common/LofarLogger.h> @@ -57,9 +57,8 @@ #include <iterator> using namespace casacore; -using namespace LOFAR; -using namespace LOFAR::StationResponse; -using LOFAR::operator<<; +using namespace everybeam; +using everybeam::operator<<; namespace { /*! @@ -130,20 +129,20 @@ DirectionCoordinate makeCoordinates(const MDirection &reference, unsigned int size, double delta); /*! - * \brief Convert an ITRF position given as a StationResponse::vector3r_t + * \brief 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 - * StationResponse::vector3r_t instance. + * vector3r_t instance. */ vector3r_t fromMPosition(const MPosition &position); /*! * \brief Convert a casacore::MDirection instance to a - * StationResponse::vector3r_t instance. + * vector3r_t instance. */ vector3r_t fromMDirection(const MDirection &direction); @@ -268,12 +267,12 @@ T filter(T first, T last, int min, int max); } // namespace int main(int argc, char *argv[]) { - TEST_SHOW_VERSION(argc, argv, StationResponse); + TEST_SHOW_VERSION(argc, argv, EveryBeam); INIT_LOGGER(basename(string(argv[0]))); - Version::show<StationResponseVersion>(cout); + Version::show<EveryBeamVersion>(cout); // Parse inputs. - LOFAR::InputParSet inputs; + everybeam::InputParSet inputs; inputs.create("ms", "", "Name of input MeasurementSet", "string"); inputs.create("stations", "0", "IDs of stations to process", "int vector"); inputs.create("cellsize", "60arcsec", "Angular pixel size", diff --git a/oskar/OSKARElementResponse.cc b/oskar/OSKARElementResponse.cc index 7cd0c84cd6a0e7c512d467b9138435ac05e8d6e2..69891d1a81a44a70f246dbc349f1e8ddc09e4a6d 100644 --- a/oskar/OSKARElementResponse.cc +++ b/oskar/OSKARElementResponse.cc @@ -3,8 +3,7 @@ #include "config.h" #include <iostream> -namespace LOFAR { -namespace StationResponse { +namespace everybeam { void OSKARElementResponseDipole::response( double freq, double theta, double phi, @@ -60,5 +59,4 @@ std::string OSKARElementResponseSphericalWave::get_path( return ss.str(); } -} // namespace StationResponse -} // namespace LOFAR +} // namespace everybeam diff --git a/oskar/OSKARElementResponse.h b/oskar/OSKARElementResponse.h index 9689cbfab703c86e4fbed844286c7abb5425cd2c..d5f69b1761f5b50fbf593b371d072e315eab2d24 100644 --- a/oskar/OSKARElementResponse.h +++ b/oskar/OSKARElementResponse.h @@ -1,3 +1,6 @@ +#ifndef OSKAR_ELEMENTRESPONSE_H +#define OSKAR_ELEMENTRESPONSE_H + #include "../ElementResponse.h" #include "../Singleton.h" @@ -5,8 +8,7 @@ #include <memory> -namespace LOFAR { -namespace StationResponse { +namespace everybeam { class OSKARElementResponseDipole : public ElementResponse { @@ -53,5 +55,5 @@ protected: std::unique_ptr<Datafile> m_datafile; }; -} // namespace StationResponse -} // namespace LOFAR +} // namespace everybeam +#endif diff --git a/pystationresponse.cc b/pyeverybeam.cc similarity index 84% rename from pystationresponse.cc rename to pyeverybeam.cc index 960ab4d924855c90a8133351e5761ccfe978622b..791a5a03af81cf8bd252a3be17e86f9ef5b92fc1 100644 --- a/pystationresponse.cc +++ b/pyeverybeam.cc @@ -1,4 +1,4 @@ -//# pystationresponse.cc: python module for StationResponse object. +//# 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 @@ -45,20 +45,19 @@ using namespace casacore; using namespace boost::python; -using namespace LOFAR::StationResponse; +using namespace everybeam; -namespace LOFAR { -namespace BBS { +namespace everybeam { namespace { /*! - * \brief Convert an ITRF position given as a StationResponse::vector3r_t + * \brief 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 - # StationResponse::vector3r_t instance. + # everybeam::vector3r_t instance. */ vector3r_t fromMPosition(const MPosition &position); @@ -139,11 +138,11 @@ MDirection readDelayReference(const MeasurementSet &ms, unsigned int idField); MDirection readTileReference(const MeasurementSet &ms, unsigned int idField); } // namespace -class PyStationResponse { +class PyEveryBeam { public: - PyStationResponse(const string &msName, bool inverse = false, - bool useElementResponse = true, bool useArrayFactor = true, - bool useChanFreq = false); + PyEveryBeam(const string &msName, bool inverse = false, + bool useElementResponse = true, bool useArrayFactor = true, + bool useChanFreq = false); // Get the software version. string version(const string &type) const; @@ -216,9 +215,9 @@ class PyStationResponse { ITRFDirection::Ptr itsDirection; }; -PyStationResponse::PyStationResponse(const string &name, bool inverse, - bool useElementResponse, - bool useArrayFactor, bool useChanFreq) +PyEveryBeam::PyEveryBeam(const string &name, bool inverse, + bool useElementResponse, bool useArrayFactor, + bool useChanFreq) : itsInverse(inverse), itsUseElementResponse(useElementResponse), itsUseArrayFactor(useArrayFactor), @@ -274,18 +273,14 @@ PyStationResponse::PyStationResponse(const string &name, bool inverse, MDirection::J2000)()))); } -string PyStationResponse::version(const string &type) const { - // return Version::getInfo<pystationresponseVersion>("stationresponse", - // type); - return "0.1"; -} +string PyEveryBeam::version(const string &type) const { return "0.1"; } -void PyStationResponse::setRefDelay(double ra, double dec) { +void PyEveryBeam::setRefDelay(double ra, double dec) { vector2r_t direction = {{ra, dec}}; itsRefDelay.reset(new ITRFDirection(itsRefPosition, direction)); } -ValueHolder PyStationResponse::getRefDelay(real_t time) { +ValueHolder PyEveryBeam::getRefDelay(real_t time) { vector3r_t refDelay = itsRefDelay->at(time); Vector<Double> result(3); result(0) = refDelay[0]; @@ -295,12 +290,12 @@ ValueHolder PyStationResponse::getRefDelay(real_t time) { return ValueHolder(result); } -void PyStationResponse::setRefTile(double ra, double dec) { +void PyEveryBeam::setRefTile(double ra, double dec) { vector2r_t direction = {{ra, dec}}; itsRefTile.reset(new ITRFDirection(itsRefPosition, direction)); } -ValueHolder PyStationResponse::getRefTile(real_t time) { +ValueHolder PyEveryBeam::getRefTile(real_t time) { vector3r_t refTile = itsRefTile->at(time); Vector<Double> result(3); result(0) = refTile[0]; @@ -310,12 +305,12 @@ ValueHolder PyStationResponse::getRefTile(real_t time) { return ValueHolder(result); } -void PyStationResponse::setDirection(double ra, double dec) { +void PyEveryBeam::setDirection(double ra, double dec) { vector2r_t direction = {{ra, dec}}; itsDirection.reset(new ITRFDirection(itsRefPosition, direction)); } -ValueHolder PyStationResponse::getDirection(real_t time) { +ValueHolder PyEveryBeam::getDirection(real_t time) { vector3r_t direction = itsDirection->at(time); Vector<Double> result(3); result(0) = direction[0]; @@ -325,7 +320,7 @@ ValueHolder PyStationResponse::getDirection(real_t time) { return ValueHolder(result); } -ValueHolder PyStationResponse::evaluate0(double time) { +ValueHolder PyEveryBeam::evaluate0(double time) { Array<DComplex> result( IPosition(4, 2, 2, itsChanFreq.size(), itsStations.size())); @@ -343,7 +338,7 @@ ValueHolder PyStationResponse::evaluate0(double time) { return ValueHolder(result); } -ValueHolder PyStationResponse::evaluate1(double time, int station) { +ValueHolder PyEveryBeam::evaluate1(double time, int station) { // assertSTR(station >= 0 && static_cast<size_t>(station) // < itsStations.size(), "invalid station number: " << station); @@ -356,8 +351,7 @@ ValueHolder PyStationResponse::evaluate1(double time, int station) { evaluate(itsStations(station), time, itsChanFreq, itsRefFreq)); } -ValueHolder PyStationResponse::evaluate2(double time, int station, - int channel) { +ValueHolder PyEveryBeam::evaluate2(double time, int station, int channel) { // assertSTR(station >= 0 && static_cast<size_t>(station) // < itsStations.size(), "invalid station number: " << station); // assertSTR(channel >= 0 && static_cast<size_t>(channel) @@ -372,8 +366,7 @@ ValueHolder PyStationResponse::evaluate2(double time, int station, return ValueHolder(evaluate(itsStations(station), time, freq, freq0)); } -ValueHolder PyStationResponse::evaluate3(double time, int station, - double freq) { +ValueHolder PyEveryBeam::evaluate3(double time, int station, double freq) { // assertSTR(station >= 0 && static_cast<size_t>(station) // < itsStations.size(), "invalid station number: " << station); @@ -385,10 +378,10 @@ ValueHolder PyStationResponse::evaluate3(double time, int station, return ValueHolder(evaluate(itsStations(station), time, freq, freq0)); } -ValueHolder PyStationResponse::evaluate4(double time, int station, double freq, - const ValueHolder &vh_direction, - const ValueHolder &vh_station0, - const ValueHolder &vh_tile0) { +ValueHolder PyEveryBeam::evaluate4(double time, int station, double freq, + const ValueHolder &vh_direction, + const ValueHolder &vh_station0, + const ValueHolder &vh_tile0) { assert(vh_direction.dataType() == TpArrayDouble); assert(vh_station0.dataType() == TpArrayDouble); assert(vh_tile0.dataType() == TpArrayDouble); @@ -412,10 +405,9 @@ ValueHolder PyStationResponse::evaluate4(double time, int station, double freq, direction, station0, tile0)); } -Cube<DComplex> PyStationResponse::evaluate(const Station::ConstPtr &station, - double time, - const Vector<Double> &freq, - const Vector<Double> &freq0) const { +Cube<DComplex> PyEveryBeam::evaluate(const Station::ConstPtr &station, + double time, const Vector<Double> &freq, + const Vector<Double> &freq0) const { Cube<DComplex> result(2, 2, freq.size(), 0.0); if (itsUseArrayFactor) { vector3r_t direction = itsDirection->at(time); @@ -478,10 +470,12 @@ Cube<DComplex> PyStationResponse::evaluate(const Station::ConstPtr &station, return result; } -Matrix<DComplex> PyStationResponse::evaluate_itrf( - const Station::ConstPtr &station, double time, double freq, double freq0, - const vector3r_t &direction, const vector3r_t &station0, - const vector3r_t &tile0) const { +Matrix<DComplex> PyEveryBeam::evaluate_itrf(const Station::ConstPtr &station, + double time, double freq, + double freq0, + const vector3r_t &direction, + const vector3r_t &station0, + const vector3r_t &tile0) const { Matrix<DComplex> result(2, 2, 0.0); if (itsUseArrayFactor) { if (itsUseElementResponse) { @@ -531,9 +525,9 @@ Matrix<DComplex> PyStationResponse::evaluate_itrf( return result; } -Matrix<DComplex> PyStationResponse::evaluate(const Station::ConstPtr &station, - double time, double freq, - double freq0) const { +Matrix<DComplex> PyEveryBeam::evaluate(const Station::ConstPtr &station, + double time, double freq, + double freq0) const { vector3r_t direction; vector3r_t station0; vector3r_t tile0; @@ -547,7 +541,7 @@ Matrix<DComplex> PyStationResponse::evaluate(const Station::ConstPtr &station, return evaluate_itrf(station, time, freq, freq0, direction, station0, tile0); } -void PyStationResponse::invert(matrix22c_t &in) const { +void PyEveryBeam::invert(matrix22c_t &in) const { complex_t invDet = 1.0 / (in[0][0] * in[1][1] - in[0][1] * in[1][0]); complex_t tmp = in[1][1]; @@ -560,7 +554,7 @@ void PyStationResponse::invert(matrix22c_t &in) const { in[1][1] *= invDet; } -void PyStationResponse::invert(diag22c_t &in) const { +void PyEveryBeam::invert(diag22c_t &in) const { DComplex invDet = 1.0 / (in[0] * in[1]); DComplex tmp = in[1]; in[1] = in[0]; @@ -571,34 +565,31 @@ void PyStationResponse::invert(diag22c_t &in) const { } // Now define the interface in Boost-Python. -void pystationresponse() { - class_<PyStationResponse>("StationResponse", - init<std::string, bool, bool, bool, bool>()) - .def("version", &PyStationResponse::version, +void pyeverybeam() { + class_<PyEveryBeam>("EveryBeam", init<std::string, bool, bool, bool, bool>()) + .def("version", &PyEveryBeam::version, (boost::python::arg("type") = "other")) - .def("setRefDelay", &PyStationResponse::setRefDelay, + .def("setRefDelay", &PyEveryBeam::setRefDelay, (boost::python::arg("ra"), boost::python::arg("dec"))) - .def("getRefDelay", &PyStationResponse::getRefDelay, + .def("getRefDelay", &PyEveryBeam::getRefDelay, (boost::python::arg("time"))) - .def("setRefTile", &PyStationResponse::setRefTile, + .def("setRefTile", &PyEveryBeam::setRefTile, (boost::python::arg("ra"), boost::python::arg("dec"))) - .def("getRefTile", &PyStationResponse::getRefTile, - (boost::python::arg("time"))) - .def("setDirection", &PyStationResponse::setDirection, + .def("getRefTile", &PyEveryBeam::getRefTile, (boost::python::arg("time"))) + .def("setDirection", &PyEveryBeam::setDirection, (boost::python::arg("ra"), boost::python::arg("dec"))) - .def("getDirection", &PyStationResponse::getDirection, - (boost::python::arg("time"))) - .def("evaluate0", &PyStationResponse::evaluate0, + .def("getDirection", &PyEveryBeam::getDirection, (boost::python::arg("time"))) - .def("evaluate1", &PyStationResponse::evaluate1, + .def("evaluate0", &PyEveryBeam::evaluate0, (boost::python::arg("time"))) + .def("evaluate1", &PyEveryBeam::evaluate1, (boost::python::arg("time"), boost::python::arg("station"))) - .def("evaluate2", &PyStationResponse::evaluate2, + .def("evaluate2", &PyEveryBeam::evaluate2, (boost::python::arg("time"), boost::python::arg("station"), boost::python::arg("channel"))) - .def("evaluate3", &PyStationResponse::evaluate3, + .def("evaluate3", &PyEveryBeam::evaluate3, (boost::python::arg("time"), boost::python::arg("station"), boost::python::arg("freq"))) - .def("evaluate4", &PyStationResponse::evaluate4, + .def("evaluate4", &PyEveryBeam::evaluate4, (boost::python::arg("time"), boost::python::arg("station"), boost::python::arg("freq"), boost::python::arg("direction"), boost::python::arg("station0"), boost::python::arg("tile0"))); @@ -688,14 +679,13 @@ MDirection readTileReference(const MeasurementSet &ms, unsigned int idField) { } } // namespace -} // namespace BBS -} // namespace LOFAR +} // namespace everybeam // Define the python module itself. -BOOST_PYTHON_MODULE(_stationresponse) { +BOOST_PYTHON_MODULE(_everybeam) { casacore::python::register_convert_excp(); casacore::python::register_convert_basicdata(); casacore::python::register_convert_casa_valueholder(); - LOFAR::BBS::pystationresponse(); + everybeam::pyeverybeam(); } diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 303efae34c0eb1b66ebd7bd99f67612a7035e17a..dcfd18e3a5e5f184ae25980eed2b8d0c691318ea 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -18,7 +18,7 @@ if (TEST_MEASUREMENTSET) ) target_include_directories( tStationReference PRIVATE - ${BEAMMODEL_INCLUDE_DIR}/StationResponse + ${BEAMMODEL_INCLUDE_DIR}/EveryBeam ${CASACORE_INCLUDE_DIR} "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" @@ -30,7 +30,7 @@ if (TEST_MEASUREMENTSET) add_executable(tStation tStation.cc) target_link_libraries( tStation PRIVATE - stationresponse + everybeam ) target_include_directories( tStation PRIVATE @@ -46,7 +46,7 @@ if (CFITSIO_FOUND) add_library(beamhelper SHARED beam-helper.cpp) target_include_directories(beamhelper PUBLIC "${CMAKE_SOURCE_DIR}") target_include_directories(beamhelper PUBLIC ${CFITSIO_INCLUDE_DIR}) - target_link_libraries(beamhelper PUBLIC stationresponse) + target_link_libraries(beamhelper PUBLIC everybeam) target_link_libraries(beamhelper PUBLIC ${CFITSIO_LIBRARY}) add_executable(tStationBeamHamaker tStationBeamHamaker.cc) diff --git a/test/beam-helper.h b/test/beam-helper.h index 08edd8a58dc54d5e43067c47d7f5bdb5f5b98b56..8a611629ec6e012a10c653d46863fbc94544eb8d 100644 --- a/test/beam-helper.h +++ b/test/beam-helper.h @@ -14,7 +14,7 @@ #include <casacore/tables/Tables/TableRecord.h> #include <casacore/tables/Tables/ScalarColumn.h> -using namespace LOFAR::StationResponse; +using namespace everybeam; void GetPhaseCentreInfo( casacore::MeasurementSet& ms, diff --git a/test/tElementBeamCommon.h b/test/tElementBeamCommon.h index b13244d577850ea58686577c63d5ada090020c87..4d49106fdfde0f12109861d5ce5c2b710ff39f15 100644 --- a/test/tElementBeamCommon.h +++ b/test/tElementBeamCommon.h @@ -5,7 +5,7 @@ #include "beam-helper.h" void calculateElementBeams( - LOFAR::StationResponse::Station::Ptr& station, + everybeam::Station::Ptr& station, std::vector<vector2r_t>& thetaPhiDirections, size_t nr_antennas, unsigned int subgrid_size, @@ -44,7 +44,7 @@ void calculateElementBeams( } void calculateElementBeams( - LOFAR::StationResponse::Station::Ptr& station, + everybeam::Station::Ptr& station, std::vector<vector3r_t>& itrfDirections, size_t nr_antennas, unsigned int subgrid_size, @@ -80,7 +80,7 @@ void calculateElementBeams( } void run( - LOFAR::StationResponse::ElementResponseModel elementResponseModel, + everybeam::ElementResponseModel elementResponseModel, double frequency, std::string& input_filename, std::string& output_filename) diff --git a/test/tElementBeamHamaker.cc b/test/tElementBeamHamaker.cc index bab531d5c305a79248c0942970837753a7762c92..ad37e1c477e27d93292dfcdb3fe7ec9d3c7fddcb 100644 --- a/test/tElementBeamHamaker.cc +++ b/test/tElementBeamHamaker.cc @@ -2,7 +2,7 @@ #include "tElementBeamCommon.h" -using namespace LOFAR::StationResponse; +using namespace everybeam; int main(int argc, char** argv) { ElementResponseModel model(Hamaker); diff --git a/test/tElementBeamOSKARDipole.cc b/test/tElementBeamOSKARDipole.cc index 848fbe3fd91d60aad6e3532b04d96cbc759ec0c0..f67d8a23db98dbfe385d27991c5735d398c79d5e 100644 --- a/test/tElementBeamOSKARDipole.cc +++ b/test/tElementBeamOSKARDipole.cc @@ -2,7 +2,7 @@ #include "tElementBeamCommon.h" -using namespace LOFAR::StationResponse; +using namespace everybeam; int main(int argc, char** argv) { ElementResponseModel model(OSKARDipole); diff --git a/test/tElementBeamOSKARSphericalWave.cc b/test/tElementBeamOSKARSphericalWave.cc index e7e22f3793fcd362b912d118be01617b9003c3db..3cf7be3da0d5a4cb7d093793504fc774bd80311e 100644 --- a/test/tElementBeamOSKARSphericalWave.cc +++ b/test/tElementBeamOSKARSphericalWave.cc @@ -2,7 +2,7 @@ #include "tElementBeamCommon.h" -using namespace LOFAR::StationResponse; +using namespace everybeam; int main(int argc, char** argv) { ElementResponseModel model(OSKARSphericalWave); diff --git a/test/tStation.cc b/test/tStation.cc index 94d589eb1969f70b1fee7e59a7f0efb159352e77..c6b6e3d311d1de19ab2083f284de97775e417337 100644 --- a/test/tStation.cc +++ b/test/tStation.cc @@ -8,7 +8,7 @@ #include "config.h" -using namespace LOFAR::StationResponse; +using namespace everybeam; int main() { std::string name = "CS001LBA"; diff --git a/test/tStationBeamCommon.h b/test/tStationBeamCommon.h index 1c9c0385500ddfddaa4c994ef4ef99af5ac2400a..300599621279fc010d0ab24473621d58d509e7d8 100644 --- a/test/tStationBeamCommon.h +++ b/test/tStationBeamCommon.h @@ -5,7 +5,7 @@ #include "beam-helper.h" void calculateStationBeams( - std::vector<LOFAR::StationResponse::Station::Ptr>& stations, + std::vector<everybeam::Station::Ptr>& stations, std::vector<vector3r_t>& itrfDirections, vector3r_t stationDirection, vector3r_t tileDirection, @@ -40,7 +40,7 @@ void calculateStationBeams( } void run( - LOFAR::StationResponse::ElementResponseModel elementResponseModel, + everybeam::ElementResponseModel elementResponseModel, double frequency, std::string& input_filename, std::string& output_filename) @@ -76,7 +76,7 @@ void run( double currentTime = timeColumn(nr_timesteps / 2); // Read stations - std::vector<LOFAR::StationResponse::Station::Ptr> stations; + std::vector<everybeam::Station::Ptr> stations; stations.resize(nr_stations); readStations(ms, stations.begin(), elementResponseModel); diff --git a/test/tStationBeamHamaker.cc b/test/tStationBeamHamaker.cc index 28f2a52dc3b41ccb07e328559dce74621664538a..9a455c5d1c76283a00bc05387c01b29de2214560 100644 --- a/test/tStationBeamHamaker.cc +++ b/test/tStationBeamHamaker.cc @@ -2,7 +2,7 @@ #include "tStationBeamCommon.h" -using namespace LOFAR::StationResponse; +using namespace everybeam; int main(int argc, char** argv) { ElementResponseModel model(Hamaker); diff --git a/test/tStationBeamOSKARDipole.cc b/test/tStationBeamOSKARDipole.cc index 1ea3dca2d0ebb4d98e7943a4ab661262fdb957e6..21b3c1e204aa9aa650bd13eabc3abdbd48600953 100644 --- a/test/tStationBeamOSKARDipole.cc +++ b/test/tStationBeamOSKARDipole.cc @@ -2,7 +2,7 @@ #include "tStationBeamCommon.h" -using namespace LOFAR::StationResponse; +using namespace everybeam; int main(int argc, char** argv) { ElementResponseModel model(OSKARDipole); diff --git a/test/tStationBeamOSKARSphericalWave.cc b/test/tStationBeamOSKARSphericalWave.cc index 4af0dfabbf67a27297f2bc599199d5f5f006faec..64d3495153112f3aa14995fba6971a49d43a2b85 100644 --- a/test/tStationBeamOSKARSphericalWave.cc +++ b/test/tStationBeamOSKARSphericalWave.cc @@ -2,7 +2,7 @@ #include "tStationBeamCommon.h" -using namespace LOFAR::StationResponse; +using namespace everybeam; int main(int argc, char** argv) { ElementResponseModel model(OSKARSphericalWave);