27 #ifndef _CASA_BLPARAMETER_PARSER_H_
28 #define _CASA_BLPARAMETER_PARSER_H_
40 #include <libsakura/sakura.h>
47 std::vector<size_t>
const &edges=std::vector<size_t>(2,0),
48 size_t const chavglim=0)
53 for (
size_t iedge=0; iedge < 2; ++ iedge) {
54 edge[iedge] = edges[iedge % edges.size()] ;
65 float const clipthres=3.0,
68 uint16_t
const fit_order = USHRT_MAX,
69 size_t const num_piece = USHRT_MAX,
70 std::vector<size_t>
const &nwaves = std::vector<size_t>()
97 << casacore::LogIO::POST;
135 void parse(
string const file_name);
137 void SplitLine(
string const &linestr,
char const separator,
138 std::vector<string> &strvec);
169 template<
typename DataType>
173 std::istringstream istr(svalue.data());
187 size_t const scanid,
size_t const beamid,
188 size_t const antid,
size_t const spwid,
size_t &idx);
190 bool &
apply, std::vector<float> &coeff,
191 std::vector<double> &boundary,
std::vector< size_t > nwave
void apply(const Jones &j1, VisVector &v, const Jones &j2)
Apply a pair of Jones to a VisVector:
uint16_t get_max_order(size_t const bltype)
Returns the maximum fit order of specified baseline type to construct BaselineContext.
DataType ConvertString(string const &svalue)
ABSTRACT TOOL CLASSES A PlotTool is a higher level event handler for a PlotCanvas The idea is to take common tasks which may require multiple events and put them in one place PlotTools also provide additional functionality in that they can be active and blocking non blocking The PlotCanvas will only send events to active and will not send events to later tools or event handlers if the latest tool was blocking In this way a single tool can be used to handle ALL user interaction via the GUI at one time
std::vector< size_t > get_function_types()
Returns a list of baseline type in the file.
bool GetFitParameterIdx(double const time, double const interval, size_t const scanid, size_t const beamid, size_t const antid, size_t const spwid, size_t &idx)
std::map< string, std::vector< double > > sortedTimes_
ostream-like interface to creating log messages.
uint16_t GetTypeOrder(size_t const &baseline_type, casacore::uInt const irow, casacore::uInt const ipol)
Returns order or npiece in BLParameterSet structure depending on datatype.
void GetFitParameterByIdx(size_t const idx, size_t const ipol, bool &apply, std::vector< float > &coeff, std::vector< double > &boundary, BLParameterSet &bl_param)
BLParameters
The enum for columns in fitting parameter file.
bool GetFitParameter(size_t const rowid, size_t const polid, BLParameterSet &bl_param)
Returns false if there is no fitting parameters for the row and pol.
std::vector< size_t > baseline_types_
float clip_threshold_sigma
void initialize()
private:
std::map< const std::pair< size_t, size_t >, BLParameterSet * > bl_parameters_
std::map< string, std::vector< casacore::uInt > > timeSortedIdx_
std::map< string, size_t > numRows_
BLTableParser(string const file_name)
void SplitLine(string const &linestr, char const separator, std::vector< string > &strvec)
split string by separator character
LineFinderParameter(bool const use_lf=false, float const thresh=5.0, std::vector< size_t > const &edges=std::vector< size_t >(2, 0), size_t const chavglim=0)
void parse(string const file_name)
parse a file
BLParameterParser(string const file_name)
string get_file_name()
Returns the name of file that stores.
BLParameterSet(string const blmask="", uint16_t const nfit_max=0, float const clipthres=3.0, LineFinderParameter lf_param=LineFinderParameter(), size_t const bl_type=BaselineType_kNumElements, uint16_t const fit_order=USHRT_MAX, size_t const num_piece=USHRT_MAX, std::vector< size_t > const &nwaves=std::vector< size_t >())
Post the accumulated message.
LogOrigin: The source code location of the originator of a LogMessage.
uint16_t max_orders_[BaselineType_kNumElements]
string blparam_file_
Member variables.
LineFinderParameter line_finder
void ConvertLineToParam(string const &linestr, size_t &rowid, size_t &polid, BLParameterSet ¶mset)
convert a line of string to a BLParameterSet data structure
#define BaselineType_kNumElements
uint16_t GetTypeOrder(BLParameterSet const &bl_param)
Returns order or npiece in BLParameterSet structure depending on datatype.