From a0e9c097c2ee6fd7cace463c7d623cd741ea0b86 Mon Sep 17 00:00:00 2001 From: Joris van Zwieten <zwieten@astron.nl> Date: Wed, 22 Aug 2007 09:45:30 +0000 Subject: [PATCH] BugID: 1094 - Added support for the beam. Currently, no time-freq variable source positions and/or station positions are supported. Also, none of the beam parameters (wire length, slant, height, and orientation) can be solved for at the moment. --- .../BBSKernel/include/BBSKernel/MNS/MeqAzEl.h | 77 +++++++++++++++++++ .../include/BBSKernel/MNS/MeqDipoleBeam.h | 71 +++++++++++++++++ .../BBSKernel/include/BBSKernel/MNS/MeqExpr.h | 1 + .../include/BBSKernel/MNS/MeqMatrix.h | 3 + .../BBSKernel/include/BBSKernel/Makefile.am | 2 + CEP/BB/BBSKernel/include/BBSKernel/Model.h | 5 +- .../include/BBSKernel/VisSelection.h | 1 + 7 files changed, 158 insertions(+), 2 deletions(-) create mode 100644 CEP/BB/BBSKernel/include/BBSKernel/MNS/MeqAzEl.h create mode 100644 CEP/BB/BBSKernel/include/BBSKernel/MNS/MeqDipoleBeam.h diff --git a/CEP/BB/BBSKernel/include/BBSKernel/MNS/MeqAzEl.h b/CEP/BB/BBSKernel/include/BBSKernel/MNS/MeqAzEl.h new file mode 100644 index 00000000000..4c767bc4a11 --- /dev/null +++ b/CEP/BB/BBSKernel/include/BBSKernel/MNS/MeqAzEl.h @@ -0,0 +1,77 @@ +//# MeqAzEl.h: Azimuth and elevation for a direction (ra,dec) on the sky. +//# +//# Copyright (C) 2007 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# 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 2 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, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id$ + +#ifndef MNS_MEQAZEL_H +#define MNS_MEQAZEL_H + +#include <BBSKernel/MNS/MeqExpr.h> +#include <BBSKernel/MNS/MeqResultVec.h> + +#ifdef EXPR_GRAPH +#include <Common/lofar_string.h> +#endif + +namespace LOFAR +{ +namespace BBS +{ +class MeqSource; +class MeqStation; +class MeqRequest; +class MeqMatrix; + +// \ingroup BBSKernel +// \addtogroup MNS +// @{ + +class MeqAzEl: public MeqExprRep +{ +public: + enum + { + IN_RA, + IN_DEC, + IN_X, + IN_Y, + IN_Z, + N_InputPort + } InputPort; + + MeqAzEl(MeqSource &source, MeqStation &station); + MeqResultVec getResultVec(const MeqRequest &request); + +private: + void evaluate(const MeqRequest& request, const MeqMatrix &in_ra, + const MeqMatrix &in_dec, const MeqMatrix &in_x, const MeqMatrix &in_y, + const MeqMatrix &in_z, MeqMatrix &out_az, MeqMatrix &out_el); + +#ifdef EXPR_GRAPH + virtual std::string getLabel(); +#endif +}; + +// @} + +} // namespace BBS +} // namespace LOFAR + +#endif diff --git a/CEP/BB/BBSKernel/include/BBSKernel/MNS/MeqDipoleBeam.h b/CEP/BB/BBSKernel/include/BBSKernel/MNS/MeqDipoleBeam.h new file mode 100644 index 00000000000..fcd541cf399 --- /dev/null +++ b/CEP/BB/BBSKernel/include/BBSKernel/MNS/MeqDipoleBeam.h @@ -0,0 +1,71 @@ +//# MeqDipoleBeam.h: Dipole voltage beam (analytic) +//# +//# Copyright (C) 2007 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# 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 2 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, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id$ + +#ifndef MNS_MEQDIPOLEBEAM_H +#define MNS_MEQDIPOLEBEAM_H + +#include <BBSKernel/MNS/MeqExpr.h> +#include <BBSKernel/MNS/MeqJonesExpr.h> +#include <BBSKernel/MNS/MeqJonesResult.h> +#include <casa/BasicSL/Constants.h> + +namespace LOFAR +{ +namespace BBS +{ + +// \ingroup BBSKernel +// \addtogroup MNS +// @{ + +class MeqDipoleBeam: public MeqJonesExprRep +{ +public: + enum + { + IN_AZEL, + N_InputPort + } InputPort; + + MeqDipoleBeam(MeqExpr azel, double height = 1.706, double length = 1.38, + double slant = casa::C::pi / 4.001, double orientation = 0.0); + + virtual MeqJonesResult getJResult(const MeqRequest &request); + +private: + void evaluate(const MeqRequest &request, const MeqMatrix &in_az, + const MeqMatrix &in_el, MeqMatrix &out_E_theta, MeqMatrix &out_E_phi, + double height, double length, double slant, double orientation); + +#ifdef EXPR_GRAPH + virtual std::string getLabel(); +#endif + + double itsHeight, itsLength, itsSlant, itsOrientation; +}; + +// @} + +} //# namespace BBS +} //# namespace LOFAR + +#endif diff --git a/CEP/BB/BBSKernel/include/BBSKernel/MNS/MeqExpr.h b/CEP/BB/BBSKernel/include/BBSKernel/MNS/MeqExpr.h index 7e7d7251c8d..1bbffb149bb 100644 --- a/CEP/BB/BBSKernel/include/BBSKernel/MNS/MeqExpr.h +++ b/CEP/BB/BBSKernel/include/BBSKernel/MNS/MeqExpr.h @@ -144,6 +144,7 @@ protected: // It also increases NParents in the child. void addChild(MeqExpr child); void removeChild(MeqExpr child); + MeqExpr getChild(size_t index); private: // Forbid copy and assignment. diff --git a/CEP/BB/BBSKernel/include/BBSKernel/MNS/MeqMatrix.h b/CEP/BB/BBSKernel/include/BBSKernel/MNS/MeqMatrix.h index 58570dbcb59..45e9d8a06bd 100644 --- a/CEP/BB/BBSKernel/include/BBSKernel/MNS/MeqMatrix.h +++ b/CEP/BB/BBSKernel/include/BBSKernel/MNS/MeqMatrix.h @@ -139,6 +139,9 @@ public: void show (ostream& os) const { itsRep->show (os); } + bool isArray() const + { return itsRep->isArray(); } + bool isComplex() const { return itsRep->isComplex(); } diff --git a/CEP/BB/BBSKernel/include/BBSKernel/Makefile.am b/CEP/BB/BBSKernel/include/BBSKernel/Makefile.am index d74ded1e593..b80322d3667 100644 --- a/CEP/BB/BBSKernel/include/BBSKernel/Makefile.am +++ b/CEP/BB/BBSKernel/include/BBSKernel/Makefile.am @@ -13,10 +13,12 @@ pkginclude_HEADERS = \ VisSelection.h pkginclude_MNS_HEADERS = \ + MNS/MeqAzEl.h \ MNS/MeqBaseDFTPS.h \ MNS/MeqBaseLinPS.h \ MNS/MeqDFTPS.h \ MNS/MeqDiag.h \ + MNS/MeqDipoleBeam.h \ MNS/MeqDomain.h \ MNS/MeqExpr.h \ MNS/MeqFunklet.h \ diff --git a/CEP/BB/BBSKernel/include/BBSKernel/Model.h b/CEP/BB/BBSKernel/include/BBSKernel/Model.h index a8e546027c6..db9f5c86545 100644 --- a/CEP/BB/BBSKernel/include/BBSKernel/Model.h +++ b/CEP/BB/BBSKernel/include/BBSKernel/Model.h @@ -57,9 +57,10 @@ public: enum ModelComponent { - GAIN = 0, + BANDPASS = 0, + GAIN, DIRECTIONAL_GAIN, - BANDPASS, + DIPOLE_BEAM, PHASORS, N_ModelComponent }; diff --git a/CEP/BB/BBSKernel/include/BBSKernel/VisSelection.h b/CEP/BB/BBSKernel/include/BBSKernel/VisSelection.h index c4898d065a6..c4f4f40e110 100644 --- a/CEP/BB/BBSKernel/include/BBSKernel/VisSelection.h +++ b/CEP/BB/BBSKernel/include/BBSKernel/VisSelection.h @@ -112,6 +112,7 @@ public: private: bool convertTime(const string &in, double &out) const; + vector<bool> itsFieldFlags; pair<size_t, size_t> itsChannelRange; pair<double, double> itsTimeRange; -- GitLab