|
DP3
|
Namespaces | |
| phase_fitting | |
| stringtools | |
| Useful string manipulation methods and classes. | |
| test | |
| This file has generic helper code for tests. | |
Classes | |
| class | BaseTimer |
| Very accurate timer for elapsed times. More... | |
| class | ClusterDesc |
| Description of a cluster and the nodes in it. More... | |
| class | DynSpecFitsWriter |
| class | Fields |
| class | Indent |
| Useful stream manipulation methods. More... | |
| class | KVpair |
| Implements a KV pair as a pair<string, string>. More... | |
| class | lane_read_buffer |
| class | lane_write_buffer |
| class | NodeDesc |
| Description of a node in a cluster. More... | |
| class | ParameterRecord |
| A record of parameter values. The only difference with a ParameterSet is the output operator. More... | |
| class | ParameterSet |
| Implements a map of Key-Value pairs. More... | |
| class | ParameterSetImpl |
| Implements a map of Key-Value pairs. Description of class. The ParameterSetImpl class is a key-value implementation of the type map<string, string, KeyCompare>. This means that values are stored as a string which allows easy merging and splitting of ParameterSetImpls because no conversions have to be done. A couple of getXxx routines are provided to convert the strings to the desired type. More... | |
| class | ParameterValue |
| The value of a parameter. More... | |
| class | PrettyFrequency |
| Print frequency in a human-readable way. More... | |
| class | PrettyTime |
| Print time in a human-readable way. More... | |
| class | PrettyUnits |
| Print units in a human-readable way. More... | |
| class | ProximityClustering |
| class | ScopedMicroSecondAccumulator |
| class | VdsDesc |
| Describe an entire visibility data set. More... | |
| class | VdsMaker |
| Class to create the description of an MS. More... | |
| class | VdsPartDesc |
| Description of a visibility data set or part thereof. More... | |
Typedefs | |
| using | NSTimer = BaseTimer< std::chrono::steady_clock > |
| typedef unsigned int | rownr_t |
Enumerations | |
| enum class | BaselineOrder { kColumnMajor , kRowMajor } |
| enum | DataFormat { LittleEndian = 0 , BigEndian = 1 } |
| This file defines an enum for the possible machine data formats. More... | |
Functions | |
| template<typename ValueType > | |
| void | AssignStationValues (std::span< ValueType > result, ValueType value, const std::string pattern_string, std::span< const std::string > station_names) |
| double | AvailableMemory (const double memory=0, const double memory_percentage=0, const bool clip=true) |
| unsigned int | bitToBool (void *to, const void *from, unsigned int nvalues, unsigned int startbit=0) |
| unsigned int | boolToBit (void *to, const void *from, unsigned int nvalues, unsigned int startbit=0) |
| std::pair< size_t, size_t > | ComputeBaseline (size_t baseline_index, size_t n_antennas, BaselineOrder order) |
| size_t | ComputeBaselineIndex (size_t antenna_a, size_t antenna_b, size_t n_antennas, BaselineOrder order) |
| std::vector< size_t > | ComputeBaselineList (size_t antenna, size_t n_antennas, BaselineOrder order) |
| size_t | ComputeNBaselines (size_t n_antennas) |
| void | dataConvert (DataFormat fmt, std::complex< int16_t > *inout, unsigned int nrval) |
| DataFormat | dataFormat () |
| Get the endian type on this machine. More... | |
| template<class T > | |
| bool | EpsilonEqual (const std::vector< T > &left, const std::vector< T > &right, const T &epsilon) |
| const std::string | formatString (const char *format,...) |
| std::ostream & | indent (std::ostream &os) |
| unsigned int | lskipws (const std::string &value, unsigned int st, unsigned int end) |
| template<class T > | |
| T | Median (std::vector< T > &v) |
| std::ostream & | operator<< (std::ostream &os, const KVpair &kv) |
| template<typename T , typename U > | |
| std::ostream & | operator<< (std::ostream &os, const std::map< T, U > &m) |
| template<typename T , typename U > | |
| std::ostream & | operator<< (std::ostream &os, const std::pair< T, U > &p) |
| Write a std::pair. More... | |
| template<typename T > | |
| std::ostream & | operator<< (std::ostream &os, const std::set< T > &v) |
| template<typename T > | |
| std::ostream & | operator<< (std::ostream &os, const std::vector< T > &v) |
| template<typename ValueType > | |
| void | ParseValuePerStation (std::span< ValueType > result, std::span< const std::string > string_list, std::span< const std::string > station_names) |
| std::string | PatternToRegex (const std::string &pattern) |
| template<typename ITER > | |
| void | print (std::ostream &os, ITER begin, ITER end, const char *separator=",", const char *prefix="[", const char *postfix="]") |
| Write any container to the given std::ostream. More... | |
| unsigned int | rskipws (const std::string &value, unsigned int st, unsigned int end) |
| unsigned int | skipBalanced (const std::string &str, unsigned int st, unsigned int end, char endChar) |
| An exception is thrown if the delimiters are not balanced, thus if no. More... | |
| unsigned int | skipQuoted (const std::string &str, unsigned int st) |
Convert the possible native types. | |
These functions can be used in templates. | |
| void | dataConvert (DataFormat, char *inout, unsigned int nrval) |
| void | dataConvert (DataFormat, int8_t *inout, unsigned int nrval) |
| void | dataConvert (DataFormat, uint8_t *inout, unsigned int nrval) |
| void | dataConvert (DataFormat, int16_t *inout, unsigned int nrval) |
| void | dataConvert (DataFormat, uint16_t *inout, unsigned int nrval) |
| void | dataConvert (DataFormat, int32_t *inout, unsigned int nrval) |
| void | dataConvert (DataFormat, uint32_t *inout, unsigned int nrval) |
| void | dataConvert (DataFormat, int64_t *inout, unsigned int nrval) |
| void | dataConvert (DataFormat, uint64_t *inout, unsigned int nrval) |
| void | dataConvert (DataFormat, float *inout, unsigned int nrval) |
| void | dataConvert (DataFormat, double *inout, unsigned int nrval) |
| template<class T > | |
| void | dataConvert (DataFormat, std::complex< T > *inout, unsigned int nrval) |
| LFDC_TMPL_FP void | dataConvert (DataFormat, std::complex< float > *inout, unsigned int nrval) |
| LFDC_TMPL_FP void | dataConvert (DataFormat, std::complex< double > *inout, unsigned int nrval) |
Convert char, int8, or uint8. | |
Currently it simply returns the input. | |
| char | dataConvert (DataFormat, char in) |
| int8_t | dataConvert (DataFormat, int8_t in) |
| uint8_t | dataConvert (DataFormat, uint8_t in) |
Convert 16 bit integers. | |
| int16_t | dataConvert (DataFormat, int16_t in) |
| uint16_t | dataConvert (DataFormat, uint16_t in) |
| void | dataConvert16 (DataFormat, void *out, const void *in) |
| void | dataConvert16 (DataFormat, void *inout) |
| void | dataConvert16 (DataFormat, void *out, const void *in, unsigned int nrval) |
| void | dataConvert16 (DataFormat, void *inout, unsigned int nrval) |
Convert 32 bit integers. | |
| int32_t | dataConvert (DataFormat, int32_t in) |
| uint32_t | dataConvert (DataFormat, uint32_t in) |
| void | dataConvert32 (DataFormat, void *out, const void *in) |
| void | dataConvert32 (DataFormat, void *inout) |
| void | dataConvert32 (DataFormat, void *out, const void *in, unsigned int nrval) |
| void | dataConvert32 (DataFormat, void *inout, unsigned int nrval) |
Convert 64 bit integers. | |
| int64_t | dataConvert (DataFormat, int64_t in) |
| uint64_t | dataConvert (DataFormat, uint64_t in) |
| void | dataConvert64 (DataFormat, void *out, const void *in) |
| void | dataConvert64 (DataFormat, void *inout) |
| void | dataConvert64 (DataFormat, void *out, const void *in, unsigned int nrval) |
| void | dataConvert64 (DataFormat, void *inout, unsigned int nrval) |
Convert 32 bit floats. | |
| void | dataConvertFloat (DataFormat, void *out, const void *in) |
| void | dataConvertFloat (DataFormat, void *inout) |
| void | dataConvertFloat (DataFormat, void *out, const void *in, unsigned int nrval) |
| void | dataConvertFloat (DataFormat, void *inout, unsigned int nrval) |
Convert 64 bit floats. | |
| void | dataConvertDouble (DataFormat, void *out, const void *in) |
| void | dataConvertDouble (DataFormat, void *inout) |
| void | dataConvertDouble (DataFormat, void *out, const void *in, unsigned int nrval) |
| void | dataConvertDouble (DataFormat, void *inout, unsigned int nrval) |
Swap bytes in 16 bit values. | |
| int16_t | byteSwap (int16_t in) |
| uint16_t | byteSwap (uint16_t in) |
| void | byteSwap16 (void *out, const void *in) |
| void | byteSwap16 (void *inout) |
| void | byteSwap16 (void *out, const void *in, unsigned int nrval) |
| void | byteSwap16 (void *inout, unsigned int nrval) |
Swap bytes in 32 bit values. | |
| int32_t | byteSwap (int32_t in) |
| uint32_t | byteSwap (uint32_t in) |
| void | byteSwap32 (void *out, const void *in) |
| void | byteSwap32 (void *inout) |
| void | byteSwap32 (void *out, const void *in, unsigned int nrval) |
| void | byteSwap32 (void *inout, unsigned int nrval) |
Swap bytes in 64 bit values. | |
| int64_t | byteSwap (int64_t in) |
| uint64_t | byteSwap (uint64_t in) |
| void | byteSwap64 (void *out, const void *in) |
| void | byteSwap64 (void *inout) |
| void | byteSwap64 (void *out, const void *in, unsigned int nrval) |
| void | byteSwap64 (void *inout, unsigned int nrval) |
| blob::BlobOStream & | operator<< (blob::BlobOStream &, const ParameterSet &) |
| blob::BlobIStream & | operator>> (blob::BlobIStream &, ParameterSet &) |
Strict conversion of string to numeric value | |
| bool | strToBool (const std::string &aString) |
| long | strToLong (const std::string &aString) |
| int | strToInt (const std::string &aString) |
| int32_t | strToInt32 (const std::string &aString) |
| int16_t | strToInt16 (const std::string &aString) |
| unsigned long | strToUlong (const std::string &aString) |
| unsigned int | strToUint (const std::string &aString) |
| uint32_t | strToUint32 (const std::string &aString) |
| uint16_t | strToUint16 (const std::string &aString) |
| int64_t | strToInt64 (const std::string &aString) |
| uint64_t | strToUint64 (const std::string &aString) |
| float | strToFloat (const std::string &aString) |
| double | strToDouble (const std::string &aString) |
Manipulate strings containing a array specification | |
| std::string | expandRangeString (const std::string &) |
| std::string | expandMultString (const std::string &) |
| std::string | expandArrayString (const std::string &) |
| const std::string & | typeName (const void *) |
| Return a string giving the type name to be stored in blobs. More... | |
| const std::string & | typeName (const bool *) |
| const std::string & | typeName (const char *) |
| const std::string & | typeName (const int8_t *) |
| const std::string & | typeName (const uint8_t *) |
| const std::string & | typeName (const int16_t *) |
| const std::string & | typeName (const uint16_t *) |
| const std::string & | typeName (const int32_t *) |
| const std::string & | typeName (const uint32_t *) |
| const std::string & | typeName (const int64_t *) |
| const std::string & | typeName (const uint64_t *) |
| const std::string & | typeName (const float *) |
| const std::string & | typeName (const double *) |
| const std::string & | typeName (const std::complex< float > *) |
| const std::string & | typeName (const std::complex< double > *) |
| template<typename T > | |
| const std::string & | typeName (T const *const *) |
| blob::BlobOStream & | operator<< (blob::BlobOStream &bs, const VdsPartDesc &vpd) |
| blob::BlobIStream & | operator>> (blob::BlobIStream &bs, VdsPartDesc &vpd) |
| typedef common::stringtools::Compare | KeyCompare |
| typedef std::map< std::string, ParameterValue, KeyCompare > | KVMap |
| const char | PC_QUAL_STABLE [] = {"stable"} |
| Implements a map of Key-Value pairs. More... | |
| const char | PC_QUAL_TEST [] = {"test"} |
| const char | PC_QUAL_DEVELOP [] = {"development"} |
| const char | PC_KEY_VERSIONNR [] = {"versionnr"} |
| const char | PC_KEY_QUAL [] = {"qualification"} |
| bool | isValidVersionNr (const std::string &versionNr) |
| Checks if the given string is a valid versionnumber (x.y.z) More... | |
| bool | isValidVersionNrRef (const std::string &versionNr) |
| std::string | keyName (const std::string &fullKeyName) |
| std::string | moduleName (const std::string &fullKeyName) |
| std::string | keyPart (const std::string ¶meterLine) |
| std::string | valuePart (const std::string ¶meterLine) |
| int32_t | indexValue (const std::string &label, const char indexMarker[2]) |
| typedef std::map<std::string, ParameterValue, KeyCompare> dp3::common::KVMap |
A key/value map is defined as a map of strings. The third template parameter, KeyCompare, is the string comparison functor that will be used to compare keys.
| using dp3::common::NSTimer = typedef BaseTimer<std::chrono::steady_clock> |
| typedef unsigned int dp3::common::rownr_t |
|
strong |
This file defines an enum for the possible machine data formats.
Get the data format (endian type). This file defines an enum for the possible machine data formats. Currently only little and big endian is possible with floating point numbers as IEEE and characters in the ASCII representation. It is used in the Blob classes and the DataConvert functions.
Furthermore it contains a function giving the data format in use on the machine in use.
| Enumerator | |
|---|---|
| LittleEndian | |
| BigEndian | |
| void dp3::common::AssignStationValues | ( | std::span< ValueType > | result, |
| ValueType | value, | ||
| const std::string | pattern_string, | ||
| std::span< const std::string > | station_names | ||
| ) |
Helper function for ParseValuePerStation(). This function finds all stations that match a given pattern, and assigns the associated values for these stations to the given value. Example: AssignStationValues({0,0,0}, 3, {"a*"}, {"aa", "ab", "b"}) will set the result values to {3,3,0}.
| double dp3::common::AvailableMemory | ( | const double | memory = 0, |
| const double | memory_percentage = 0, |
||
| const bool | clip = true |
||
| ) |
Determines the available memory that can be used by the program. It takes two (optional) inputs.
If memory_percentage the result will be the maximum amount of available memory of the system * percentage / 100. It will be clipped to memory if set.
If memory is set, the system that value will be returned, unless it is greater than the available memory of the system in which case that number will be returned.
If no parameters are set, the returned value will be the available system memoery minus a small margin of max 2GB.
| memory,amount | of wanted memory in GB. |
| memory_percentage,>= | 0 && <= 100, percentage of the available system memory to use. |
| clip,if | true, no more memory will be used than available on the system. Limit can still be exceeded if multiple steps use 100% for example. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get the endian type on this machine.
| bool dp3::common::EpsilonEqual | ( | const std::vector< T > & | left, |
| const std::vector< T > & | right, | ||
| const T & | epsilon | ||
| ) |
Check if two vectors are equal, given an epsilon.
| T | Base type, typically float or double. |
| std::string dp3::common::expandArrayString | ( | const std::string & | ) |
| std::string dp3::common::expandMultString | ( | const std::string & | ) |
| std::string dp3::common::expandRangeString | ( | const std::string & | ) |
| const std::string dp3::common::formatString | ( | const char * | format, |
| ... | |||
| ) |
|
inline |
Print an indentation that depends on the number of Indent objects currently in existence.
| int32_t dp3::common::indexValue | ( | const std::string & | label, |
| const char | indexMarker[2] | ||
| ) |
Returns the value of the index if the string contains an index otherwise 0 is returned. The indexMarker argument must be used to pass the two chars that are used to delimeter the index. The index must be a literal value not an expression. For example:
returns the value 25. When more indexdelimiters are found in the string the last pair is used.
| bool dp3::common::isValidVersionNr | ( | const std::string & | versionNr | ) |
Checks if the given string is a valid versionnumber (x.y.z)
| bool dp3::common::isValidVersionNrRef | ( | const std::string & | versionNr | ) |
Checks if the given string is a valid versionnumber reference. This may be of the form x.y.z or the words stable, test or development (defined as PC_QUAL_STABLE, PC_QUAL_TEST and PC_QUAL_DEVELOP).
| std::string dp3::common::keyName | ( | const std::string & | fullKeyName | ) |
the last part of the keyname. For example:
returns "leaf". When a keyname without dots is passed the whole key is returned.
keyName is a kind of dirname function for keys.
| std::string dp3::common::keyPart | ( | const std::string & | parameterLine | ) |
Returns the raw keypart of a parameterline that contains a key-value pair. The returned string is not trimmed for whitespace.
| unsigned int dp3::common::lskipws | ( | const std::string & | value, |
| unsigned int | st, | ||
| unsigned int | end | ||
| ) |
| T dp3::common::Median | ( | std::vector< T > & | v | ) |
Find the median value in vector v @tparm T Base type, typically float or double
| std::string dp3::common::moduleName | ( | const std::string & | fullKeyName | ) |
all but the last part of the keyname. For example:
returns "base.sub". When a keyname without dots is passed and empty string is returned.
moduleName is a kind of basename function for keys.
| blob::BlobOStream& dp3::common::operator<< | ( | blob::BlobOStream & | , |
| const ParameterSet & | |||
| ) |
Write/read a ParameterSet into/from a blob.
|
inline |
Put/get the object to/from a blob.
| std::ostream& dp3::common::operator<< | ( | std::ostream & | os, |
| const KVpair & | kv | ||
| ) |
|
inline |
Print the contents of a map enclosed in braces, using a comma as separator.
T.
|
inline |
Write a std::pair.
Declare the functions. Write a std::pair.
|
inline |
Print the contents of a set enclosed in square brackets, using a comma as separator.
T.
|
inline |
Print the contents of a vector enclosed in square brackets, using a comma as separator.
T. | blob::BlobIStream& dp3::common::operator>> | ( | blob::BlobIStream & | , |
| ParameterSet & | |||
| ) |
|
inline |
| void dp3::common::ParseValuePerStation | ( | std::span< ValueType > | result, |
| std::span< const std::string > | string_list, | ||
| std::span< const std::string > | station_names | ||
| ) |
This function parses a configuration string list that specifies a value per station. Wildcards like "CS*" can be used to ease specifying multiple stations. The station pattern and the value are separated by a colon. In result, the value for stations for which no pattern is matching will be unchanged, hence the result value should be initialized to sensible default values before this call.
| [in,out] | result | On input, an array equal in size to station_names with the default values for the stations. On output, it will be set according to string_list. |
| string_list | A list of values in the form of patterns:value. The 'patterns' part can be an array enclosed by square brackets, e.g. [RS_017, CS*, ^CS_001]:3 would set the value to 3 for the stations RS_017, stations whose name start with the text "CS", but not for CS_001. |
| std::string dp3::common::PatternToRegex | ( | const std::string & | pattern | ) |
Converts a pattern matching expression to a regular expression such that users can use patterns in the parset, as opposed to regular expressions.
|
inline |
Write any container to the given std::ostream.
Write any container to the given ostream.
| unsigned int dp3::common::rskipws | ( | const std::string & | value, |
| unsigned int | st, | ||
| unsigned int | end | ||
| ) |
| unsigned int dp3::common::skipBalanced | ( | const std::string & | str, |
| unsigned int | st, | ||
| unsigned int | end, | ||
| char | endChar | ||
| ) |
An exception is thrown if the delimiters are not balanced, thus if no.
For example, it will skip something like '[[1,2,3],[4,5,6]]'.
| unsigned int dp3::common::skipQuoted | ( | const std::string & | str, |
| unsigned int | st | ||
| ) |
| bool dp3::common::strToBool | ( | const std::string & | aString | ) |
| double dp3::common::strToDouble | ( | const std::string & | aString | ) |
| float dp3::common::strToFloat | ( | const std::string & | aString | ) |
| int dp3::common::strToInt | ( | const std::string & | aString | ) |
| int16_t dp3::common::strToInt16 | ( | const std::string & | aString | ) |
| int32_t dp3::common::strToInt32 | ( | const std::string & | aString | ) |
| int64_t dp3::common::strToInt64 | ( | const std::string & | aString | ) |
| long dp3::common::strToLong | ( | const std::string & | aString | ) |
| unsigned int dp3::common::strToUint | ( | const std::string & | aString | ) |
| uint16_t dp3::common::strToUint16 | ( | const std::string & | aString | ) |
| uint32_t dp3::common::strToUint32 | ( | const std::string & | aString | ) |
| uint64_t dp3::common::strToUint64 | ( | const std::string & | aString | ) |
| unsigned long dp3::common::strToUlong | ( | const std::string & | aString | ) |
| const std::string& dp3::common::typeName | ( | const bool * | ) |
| const std::string& dp3::common::typeName | ( | const char * | ) |
| const std::string& dp3::common::typeName | ( | const double * | ) |
| const std::string& dp3::common::typeName | ( | const float * | ) |
| const std::string& dp3::common::typeName | ( | const int16_t * | ) |
| const std::string& dp3::common::typeName | ( | const int32_t * | ) |
| const std::string& dp3::common::typeName | ( | const int64_t * | ) |
| const std::string& dp3::common::typeName | ( | const int8_t * | ) |
| const std::string& dp3::common::typeName | ( | const std::complex< double > * | ) |
| const std::string& dp3::common::typeName | ( | const std::complex< float > * | ) |
| const std::string& dp3::common::typeName | ( | const uint16_t * | ) |
| const std::string& dp3::common::typeName | ( | const uint32_t * | ) |
| const std::string& dp3::common::typeName | ( | const uint64_t * | ) |
| const std::string& dp3::common::typeName | ( | const uint8_t * | ) |
| const std::string& dp3::common::typeName | ( | const void * | ) |
Return a string giving the type name to be stored in blobs.
These global functions return the name of the basic types. They are meant to get the full id of a templated class when such an object is stored in a blob. As much as possible std::complex and builtin complex types get the same name, so they can be read back from a blob in both ways.
| const std::string& dp3::common::typeName | ( | T const *const * | ) |
| std::string dp3::common::valuePart | ( | const std::string & | parameterLine | ) |
Returns the raw value-part of a parameterline that contains a key-value pair. This means that the string is not trimmed for whitespace and that comments at the end of the line are also returned.
It simply returns everything behind the first = sign.
| const char dp3::common::PC_KEY_QUAL[] = {"qualification"} |
| const char dp3::common::PC_KEY_VERSIONNR[] = {"versionnr"} |
| const char dp3::common::PC_QUAL_DEVELOP[] = {"development"} |
| const char dp3::common::PC_QUAL_STABLE[] = {"stable"} |
Implements a map of Key-Value pairs.
| const char dp3::common::PC_QUAL_TEST[] = {"test"} |