Skip to content
Snippets Groups Projects
Select Git revision
  • e8821f7dcb3d5aea66daf79d351a00425dab0d9b
  • master default protected
  • L2SS-1914-fix_job_dispatch
  • TMSS-3170
  • TMSS-3167
  • TMSS-3161
  • TMSS-3158-Front-End-Only-Allow-Changing-Again
  • TMSS-3133
  • TMSS-3319-Fix-Templates
  • test-fix-deploy
  • TMSS-3134
  • TMSS-2872
  • defer-state
  • add-custom-monitoring-points
  • TMSS-3101-Front-End-Only
  • TMSS-984-choices
  • SDC-1400-Front-End-Only
  • TMSS-3079-PII
  • TMSS-2936
  • check-for-max-244-subbands
  • TMSS-2927---Front-End-Only-PXII
  • Before-Remove-TMSS
  • LOFAR-Release-4_4_318 protected
  • LOFAR-Release-4_4_317 protected
  • LOFAR-Release-4_4_316 protected
  • LOFAR-Release-4_4_315 protected
  • LOFAR-Release-4_4_314 protected
  • LOFAR-Release-4_4_313 protected
  • LOFAR-Release-4_4_312 protected
  • LOFAR-Release-4_4_311 protected
  • LOFAR-Release-4_4_310 protected
  • LOFAR-Release-4_4_309 protected
  • LOFAR-Release-4_4_308 protected
  • LOFAR-Release-4_4_307 protected
  • LOFAR-Release-4_4_306 protected
  • LOFAR-Release-4_4_304 protected
  • LOFAR-Release-4_4_303 protected
  • LOFAR-Release-4_4_302 protected
  • LOFAR-Release-4_4_301 protected
  • LOFAR-Release-4_4_300 protected
  • LOFAR-Release-4_4_299 protected
41 results

tmss_test_data_django_models.py

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