Skip to content
Snippets Groups Projects
Select Git revision
  • 1949af175f96843752271df79c103bc90f4d8c8c
  • master default protected
  • gec-113-static-ska-sdp-func
  • rtd-ubuntu24-plucky
  • ast-1644-temp-fix
  • ast-1600-fix-beam-for-meerkat-ska-mid
  • readthedocs-c++17
  • mwa_python_wrapper
  • ast-1384-remove-element-index-argument
  • ast-1509-fix-polarization-orientation-in-gridded-response
  • add-test-for-squared-mueller-matrices
  • 1493-extend-python-bindings
  • ast-1493-implement-response-dishpoint-1
  • ast-1325-prototype-ska-beam-model-interface
  • ast-1416-oskar-ska-sdp-func-1
  • ast-1386-create-default-element
  • ast-1384-fix-sorted-frequencies-check-sphericalharmonicsresponse-1
  • ast-1111-add-vector-bindings
  • ast-973-add-test-for-lobes-coefficients
  • ast-645-add-beam-normalisation-mode-preapplied
  • disable-element-beam-1
  • v0.7.1
  • v0.7.0
  • v0.6.2
  • v0.6.1
  • v0.6.0
  • v0.5.8
  • v0.5.7
  • v0.5.6
  • v0.5.5
  • v0.5.4
  • v0.5.3
  • v0.5.2
  • v0.5.1
  • v0.4.0
  • v0.3.1
  • v0.3.0
  • v0.2.0
  • v0.1.3
  • v0.1.2
  • v0.1.1
41 results

lofar.cc

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    lofar.cc 5.81 KiB
    #include "lofar.h"
    #include "./../common/MathUtil.h"
    #include "./../common/casa_utils.h"
    #include <cassert>
    
    using namespace everybeam;
    using namespace everybeam::telescope;
    using namespace casacore;
    
    // LOFAR Telescope specific utils
    namespace {
    
    constexpr Antenna::CoordinateSystem::Axes lofar_antenna_orientation = {
        {
            -std::sqrt(.5),
            -std::sqrt(.5),
            0.0,
        },
        {
            std::sqrt(.5),
            -std::sqrt(.5),
            0.0,
        },
        {0.0, 0.0, 1.0},
    };
    
    // TODO: move to common utils?
    vector3r_t transformToFieldCoordinates(
        const vector3r_t &position, const Antenna::CoordinateSystem::Axes &axes) {
      const vector3r_t result{dot(position, axes.p), dot(position, axes.q),
                              dot(position, axes.r)};
      return result;
    }
    
    // // Seems LOFAR specific?
    // void transformToFieldCoordinates(TileConfig &config,
    //                                  const Antenna::CoordinateSystem::Axes &axes)
    //                                  {
    //   for (unsigned int i = 0; i < config.size(); ++i) {
    //     const vector3r_t position = config[i];
    //     config[i][0] = dot(position, axes.p);
    //     config[i][1] = dot(position, axes.q);
    //     config[i][2] = dot(position, axes.r);
    //   }
    // }
    
    // LOFAR specific? Or is this generic for each telescope?
    BeamFormer::Ptr readAntennaField(const Table &table, std::size_t id,
                                     ElementResponse::Ptr element_response) {
      Antenna::CoordinateSystem coordinate_system =
          common::readCoordinateSystem(table, id);
    
      BeamFormer::Ptr beam_former(new BeamFormer(coordinate_system));
    
      ROScalarColumn<String> c_name(table, "NAME");
      ROArrayQuantColumn<Double> c_offset(table, "ELEMENT_OFFSET", "m");
      ROArrayColumn<Bool> c_flag(table, "ELEMENT_FLAG");
    
      const string &name = c_name(id);
    
      // Read element offsets and flags.
      Matrix<Quantity> aips_offset = c_offset(id);
      assert(aips_offset.shape().isEqual(IPosition(2, 3, aips_offset.ncolumn())));
    
      Matrix<Bool> aips_flag = c_flag(id);
      assert(aips_flag.shape().isEqual(IPosition(2, 2, aips_offset.ncolumn())));
    
      //     TileConfig tile_config;
      //     if(name != "LBA") readTileConfig(table, id);
      //     transformToFieldCoordinates(tile_config, coordinate_system.axes);