Skip to content
Snippets Groups Projects
Select Git revision
  • 929248670d87a239245f5c8e136bf4bc3dbae9c8
  • master default protected
  • test-pytango-10.0.3
  • revert-cs032-ccd-ip
  • deploy-components-parallel
  • fix-chrony-exporter
  • L2SS-2407-swap-iers-caltable-monitoring-port
  • L2SS-2357-fix-ruff
  • sync-up-with-meta-pypcc
  • stabilise-landing-page
  • all-stations-lofar2
  • v0.39.7-backports
  • Move-sdptr-to-v1.5.0
  • fix-build-ubuntu
  • tokens-in-env-files
  • fix-build
  • L2SS-2214-deploy-cdb
  • fix-missing-init
  • add-power-hardware-apply
  • L2SS-2129-Add-Subrack-Routine
  • Also-listen-internal-to-rpc
  • v0.55.5-r2 protected
  • v0.52.8-rc1 protected
  • v0.55.5 protected
  • v0.55.4 protected
  • 0.55.2.dev0
  • 0.55.1.dev0
  • 0.55.0.dev0
  • v0.54.0 protected
  • 0.53.2.dev0
  • 0.53.1.dev0
  • v0.52.3-r2 protected
  • remove-snmp-client
  • v0.52.3 protected
  • v0.52.3dev0 protected
  • 0.53.1dev0
  • v0.52.2-rc3 protected
  • v0.52.2-rc2 protected
  • v0.52.2-rc1 protected
  • v0.52.1.1 protected
  • v0.52.1 protected
41 results

submodule-and-lfs.sh

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    PointSource.h 2.16 KiB
    // PointSource.h: Point source model component with optional spectral index and
    // rotation measure.
    //
    // Copyright (C) 2020 ASTRON (Netherlands Institute for Radio Astronomy)
    // SPDX-License-Identifier: GPL-3.0-or-later
    
    #ifndef DPPP_POINTSOURCE_H
    #define DPPP_POINTSOURCE_H
    
    #include "Direction.h"
    #include "Spectrum.h"
    #include "Stokes.h"
    #include <memory>
    #include <set>
    namespace dp3 {
    namespace base {
    
    /// \brief Point source model component with optional spectral index and
    /// rotation measure.
    
    /// @{
    
    class PointSource {
    public:
      typedef std::shared_ptr<PointSource> Ptr;
      typedef std::shared_ptr<const PointSource> ConstPtr;
    
      PointSource(const Direction &direction, const Stokes &stokes,
                  const size_t beam_id = 0);
      PointSource(const Direction &direction, const Spectrum &stokes,
                  const size_t beam_id = 0);
    
      const Direction &GetDirection() const { return direction_; }
      void SetDirection(const Direction &position);
    
      void ComputeSpectrum(const xt::xtensor<double, 1> &frequencies,
                           xt::xtensor<std::complex<double>, 2> &result) const;
      const Spectrum &GetSpectrum() const { return spectrum_; }
    
      Stokes GetStokes(double freq) const;
      const Stokes &GetStokes() const { return spectrum_.GetReferenceFlux(); }
    
      const size_t &GetBeamId() const { return beam_id_; }
      void SetBeamId(size_t beam_id) { beam_id_ = beam_id; }
    
      template <typename T>
      void SetSpectralTerms(double refFreq, bool isLogarithmic, T first, T last);
    
      void SetRotationMeasure(double fraction, double angle, double rm);
    
      bool HasRotationMeasure() const;
      bool HasSpectralTerms() const;
    
    protected:
      Direction direction_;
      Spectrum spectrum_;
      size_t beam_id_;
    };
    
    /// @}
    
    template <typename T>
    void PointSource::SetSpectralTerms(double refFreq, bool isLogarithmic, T first,
                                       T last) {
      // FIXME: the following four statements can be removed later.
      // They are not needed anymore, but are kept for
      // backward compatibility for the tests.
    
      spectrum_.SetSpectralTerms(refFreq, isLogarithmic,
                                 xt::adapt(std::vector<double>(first, last)));
    };
    } // namespace base
    } // namespace dp3
    
    #endif