27 #ifndef GIT_COMMIT_HASH 28 #define GIT_COMMIT_HASH "unknown" 35 #include <boost/date_time.hpp> 36 #include <boost/format.hpp> 37 #include <boost/property_tree/ptree.hpp> 81 std::vector<std::string>
getStationNames(
const boost::property_tree::ptree &xml );
93 std::string
ra2dms(
double angle );
117 std::string
dc2hms(
double angle );
173 double wrap2pi(
double angle );
184 int duration(
const boost::posix_time::ptime &
start,
const boost::posix_time::ptime &
end );
207 template <
typename T>
209 return ( a > b ) ? ( a - b ) : ( b - a );
223 template <
typename T>
226 std::vector<int> idx( v.size() );
227 std::iota( idx.begin(), idx.end(), 0 );
230 std::sort( idx.begin(), idx.end(), [&v](
int i1,
int i2 ) {
return v[i1] < v[i2]; } );
246 template <
typename K,
typename V>
248 auto it = mapOfElemen.begin();
250 while ( it != mapOfElemen.end() ) {
252 if ( it->second == value ) {
271 void outputObjectList(
const std::string &title,
const std::vector<std::string> &names, std::ofstream &of,
272 unsigned long indents = 4 );
308 template <
typename A,
typename B>
310 return std::pair<B, A>( p.second, p.first );
320 template <
typename A,
typename B>
321 std::map<B, A>
flip_map(
const std::map<A, B> &src ) {
323 for (
const auto &any : src ) dst[any.second] = any.first;
364 std::string
simplify(
const std::string &str );
T absDiff(const T &a, const T &b)
absolute difference between two points
Definition: util.h:208
void simplify_inline(std::string &str)
simplifies the string inline
namespace util for utility functions.
std::string dc2hms_astFormat(double angle)
convert declination to string
Definition: util.cpp:67
std::vector< int > sortIndexes(const std::vector< T > &v)
indices of sorted vector elements
Definition: util.h:224
void outputObjectList(const std::string &title, const std::vector< std::string > &names, std::ofstream &of, unsigned long indents=4)
outputs list of objects
Definition: util.cpp:107
double freqency2wavelenth(double frequency)
transforms frequency to wavelength
Definition: util.cpp:145
double wrap2pi(double angle)
wrap angle to interval [-pi, pi)
Definition: util.cpp:95
std::string milliseconds2string(long long int usec, bool forceSeconds=false)
converts microseconds to string
Definition: util.cpp:326
unsigned long getNumberOfStations(const boost::property_tree::ptree &xml)
get number of stations from xml file
Definition: util.cpp:151
constants used in this program
bool valueExists(std::map< K, V > mapOfElemen, V value)
checks if a value already exists in a map
Definition: util.h:247
std::string ra2dms(double angle)
convert right ascension to string
Definition: util.cpp:26
std::string numberOfScans2char_header()
translation table for number of scans (within 900 sec) to character for output tables ...
Definition: util.cpp:291
std::vector< std::string > getStationNames(const boost::property_tree::ptree &xml)
get station names from xml file
Definition: util.cpp:163
char numberOfScans2char(long n)
converts number of scans (within 900 sec) to character for output tables
Definition: util.cpp:276
double wavelength2frequency(double wavelength)
transforms wavelength to frequency
Definition: util.cpp:148
std::string weekDay2string(int weekday)
convert weekday integer to string
Definition: util.cpp:178
std::string version2prefix(int version)
version number to prefix
Definition: util.cpp:351
std::string dc2hms(double angle)
convert declination to string
Definition: util.cpp:48
double wrap2twoPi(double angle)
wrap angle to interval [0, 2*pi)
Definition: util.cpp:86
std::string month2string(int month)
convert month integer to string
Definition: util.cpp:218
std::string ra2dms_astFormat(double angle)
convert right ascension to string
Definition: util.cpp:37
int duration(const boost::posix_time::ptime &start, const boost::posix_time::ptime &end)
calculate duration between two time points
Definition: util.cpp:101
std::map< B, A > flip_map(const std::map< A, B > &src)
flip map
Definition: util.h:321
namespace VieVS is used for all defined classes.
Definition: FocusCorners.h:32
std::pair< B, A > flip_pair(const std::pair< A, B > &p)
flip pair
Definition: util.h:309
std::string version()
software version number
Definition: util.cpp:137
Timestamp
Definition: util.h:50
std::string simplify(const std::string &str)
generates simplified version of string