Profile class
Profile class
back to menu
This class is designed to analyse intensity profiles we extract in bet extension. Most of its features are lazy.
The new points MUST be added by monotonous abscisse
pro_pair is the structure for a basic point of a profile
struct pro_pair
{
double abs; abscisse of the point
double val; value of the point
};
class Profile
{
public:
vector<pro_pair > v; data of the profile
Profile(); constructor - set lroi and rroi to default
~Profile(); destructor
int size() const; number of point in the whole profile
void print() const; display the profile
void add (const double a, const double v&); add a new point with abscisse a and value v to the profile, and update rroi
void init_roi(); set the region of interest to the whole profile
void set_lroi(const double); set lroi to the indicated abscisse
void set_rroi(const double); set rroi to the indicated abscisse
const double value(const double) const; return the value corresponding to the designated abscisse (or to the closest point)
const double min(); return the minimum value within roi (lazy)
const double max(); return the minimum value within roi (lazy)
const double minabs(); return an abscisse where minimum value is reached (lazy)
const double maxabs(); return an abscisse where maximum value is reached (lazy)
const double threshold(const double d); return min() + d * (max() - min())
const double begin(); return abscisse of the first point
const double end(); return abscisse of the last point
const double next_point_over (const double abs, const double thr); return the abscisse of the next point over a thr threshold, starting from abscisse abs (-500 if it does not exist)
const double next_point_under (const double abs, const double thr); return the abscisse of the next point under a thr threshold, starting from abscisse abs (-500 if it does not exist)
const double last_point_over (const double abs, const double thr); return the abscisse of the last point over a thr threshold, starting from abscisse abs (-500 if it does not exist)
const double last_point_under (const double abs, const double thr); return the abscisse of the last point under a thr threshold, starting from abscisse abs (-500 if it does not exist)
};
see an example
back to menu