.. _newlofarlbaresponse: New LOFAR LBA response =============================================== The new interface can calculate a batch of responses from multiple types of telescopes. This demo illustrates in a step-by-step manner a minimal example of doing this for LOFAR-LBA. Feel free to edit this example to suit your needs by requesting the response from multiple stations at the same time for example. The complete code is shown at the bottom of this page. It all starts with including the the required header files, this is the bare minimum you will need. .. code-block:: cpp #include #include #include #include #include Then, use casacore to load the measurement set. .. code-block:: cpp const casacore::MeasurementSet ms(LOFARLBA_MS_PATH); The telescope can now be loaded using the ``everybeam::facade::Load`` function. .. code-block:: cpp std::unique_ptr lofar_telescope = everybeam::facade::Load(ms); In order to calculate the response, some parameters must be given. Feel free to change these to suit your needs. In this case the directions are given in J2000, but ITRF is supported as well using ``everybeam::vector3r_t``. .. code-block:: cpp std::vector stations({0}); std::vector freqs({57812500.0}); std::vector> directions({{-1.44194878, 0.85078091}}); std::vector time({4.92183348e+09}); The final step is calling the ``everybeam::facade::Response`` function in order to calculate the responses. .. code-block:: cpp xt::xtensor responses = everybeam::facade::Response( *lofar_telescope, stations, freqs, directions, time); A complete overview of the code is shown below: .. code-block:: cpp #include #include #include #include #include int main() { const casacore::MeasurementSet ms(LOFARLBA_MS_PATH); std::unique_ptr lofar_telescope = everybeam::facade::Load(ms); std::vector stations({0}); std::vector freqs({57812500.0}); std::vector> directions({{-1.44194878, 0.85078091}}); std::vector time({4.92183348e+09}); xt::xtensor responses = everybeam::facade::Response( *lofar_telescope, stations, freqs, directions, time); }