PURIFY
Next-generation radio interferometric imaging
read_measurements.h
Go to the documentation of this file.
1 #ifndef READ_MEASUREMENTS_H
2 #define READ_MEASUREMENTS_H
3 #include "purify/config.h"
4 
5 #include "purify/types.h"
6 
7 #include "purify/distribute.h"
8 #include "purify/uvw_utilities.h"
9 #ifdef PURIFY_MPI
10 #include <sopt/mpi/communicator.h>
11 #endif
12 
13 namespace purify {
14 namespace read_measurements {
15 enum class format { vis, h5, uvfits, ms };
18  const std::string &name, const bool w_term = false, const stokes pol = stokes::I,
22  const std::vector<std::string> &names, const bool w_term = false, const stokes pol = stokes::I,
24 #ifdef PURIFY_MPI
27  const std::string &name, sopt::mpi::Communicator const &comm,
28  const distribute::plan plan = distribute::plan::radial, const bool w_term = false,
32  const std::vector<std::string> &names, sopt::mpi::Communicator const &comm,
33  const distribute::plan plan = distribute::plan::radial, const bool w_term = false,
35 #endif
37 bool file_exists(const std::string &path);
39 bool dir_exists(const std::string &path);
40 } // namespace read_measurements
42 void mkdir_recursive(const std::string &path);
44 template <class T>
45 void mkdir_recursive(const T &path) {
46  mkdir_recursive(path.native());
47 }
49 template <typename T>
50 void split(const std::string &s, char delim, T result) {
51  std::stringstream ss(s);
52  std::string item;
53  while (std::getline(ss, item, delim)) {
54  *(result++) = item;
55  }
56 };
58 std::vector<std::string> split(const std::string &s, char delim);
59 } // namespace purify
60 #endif
bool dir_exists(const std::string &path)
check that directory path exists
bool file_exists(const std::string &path)
check that file path exists
utilities::vis_params read_measurements(const std::string &name, const bool w_term, const stokes pol, const utilities::vis_units units)
read in single measurement file
void mkdir_recursive(const std::string &path)
recursively create directories when they do not exist
std::vector< std::string > split(const std::string &s, char delim)
splits string into vector
stokes
Definition: types.h:44