Skip to content
Snippets Groups Projects
Select Git revision
  • d623a3eb68d99c945f87f71ddda87426f153d4fb
  • master default protected
  • 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
  • just-testing
  • v0.7.2
  • 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
41 results

options.cc

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    options.cc 852 B
    // Copyright (C) 2020 ASTRON (Netherlands Institute for Radio Astronomy)
    // SPDX-License-Identifier: GPL-3.0-or-later
    
    #include "options.h"
    
    #include "config.h"
    
    #include <cstdlib>
    #include <cstring>
    
    namespace everybeam {
    
    // TODO(RAP-260) Improve this path lookup.
    std::filesystem::path GetDataDirectory() {
      const char* envvar;
      if (std::strcmp(EVERYBEAM_DATADIR, EVERYBEAM_ABSOLUTE_DATADIR) == 0)
        return std::filesystem::path(EVERYBEAM_DATADIR);
      if ((envvar = std::getenv("EVERYBEAM_DATADIR")))
        return std::filesystem::path(envvar);
      if ((envvar = std::getenv("CONDA_PREFIX")))
        return std::filesystem::path(envvar) / EVERYBEAM_DATADIR;
      if ((envvar = std::getenv("VIRTUAL_ENV")))
        return std::filesystem::path(envvar) / EVERYBEAM_DATADIR;
      return std::filesystem::path(EVERYBEAM_ABSOLUTE_DATADIR);
    }
    }  // namespace everybeam