IMP Reference Guide
develop.63b38c487d,2024/12/21
The Integrative Modeling Platform
|
Class for fluorescence decay curves. More...
#include <IMP/bff/DecayCurve.h>
Class for fluorescence decay curves.
This class represents fluorescence decay curves. It stores the x-values, y-values, and error values of the curve. It also provides various operations and transformations on the curve.
Definition at line 38 of file DecayCurve.h.
Public Member Functions | |
DecayCurve (std::vector< double > x=std::vector< double >(), std::vector< double > y=std::vector< double >(), std::vector< double > ey=std::vector< double >(), double acquisition_time=std::numeric_limits< double >::max(), int noise_model=NOISE_POISSON, int size=-1) | |
void | apply_simple_moving_average (int start, int stop, int n_window=5, bool normalize=false) |
Applies a simple moving average (SMA) filter to the data. More... | |
bool | empty () |
Check if the curve is empty. More... | |
double | get_acquisition_time () const |
Returns the acquisition time of the decay curve. More... | |
double | get_average_dx () |
Get the average x-value difference. More... | |
std::vector< double > | get_dx () |
Get the x-value differences. More... | |
std::vector< double > & | get_ey () |
Returns the error values of the decay curve. More... | |
std::string | get_json () const |
Returns the JSON representation of the decay curve. More... | |
double | get_shift () |
Returns the time shift of the decay curve. More... | |
std::vector< double > & | get_x () |
Get the x-values of the curve. More... | |
std::vector< double > & | get_y () |
Returns the y values of the decay curve. More... | |
DecayCurve & | operator* (double v) const |
Overloads the multiplication operator to multiply the decay curve by a constant value. More... | |
DecayCurve & | operator* (const DecayCurve &other) const |
Overloads the '*' operator to multiply two DecayCurve objects. More... | |
DecayCurve & | operator*= (double v) |
Multiplies the decay curve by a value. More... | |
DecayCurve & | operator+ (double v) const |
Overloads the addition operator to add a constant value to the decay curve. More... | |
DecayCurve & | operator+ (const DecayCurve &other) const |
Overloads the '+' operator to add two DecayCurve objects. More... | |
DecayCurve & | operator+= (double v) |
Adds a value to the decay curve. More... | |
DecayCurve & | operator- (double v) const |
Overloads the subtraction operator to subtract a constant value from the decay curve. More... | |
DecayCurve & | operator- (const DecayCurve &other) const |
Overloads the '-' operator to subtract two DecayCurve objects. More... | |
DecayCurve & | operator-= (double v) |
Subtracts a value from the decay curve. More... | |
DecayCurve & | operator/ (double v) const |
Overloads the division operator to divide the decay curve by a constant value. More... | |
DecayCurve & | operator/ (const DecayCurve &other) const |
Overloads the '/' operator to divide two DecayCurve objects. More... | |
DecayCurve & | operator/= (double v) |
Divides the decay curve by a value. More... | |
DecayCurve & | operator<< (double v) |
Shifts the curve by a float value. More... | |
DecayCurve & | operator= (const DecayCurve &other) |
Assignment operator. More... | |
int | read_json (std::string json_string) |
Reads the decay curve from a JSON string. More... | |
void | resize (size_t n, double v=0.0, double dx=1.0) |
Resize the curve. More... | |
void | set_acquisition_time (double v) |
Sets the acquisition time of the decay curve. More... | |
void | set_ey (std::vector< double > &v) |
Sets the error values of the decay curve. More... | |
void | set_ey (double *input, int n_input) |
Sets the error values of the decay curve. More... | |
void | set_shift (double v) |
Sets the time shift of the decay curve. More... | |
void | set_x (const std::vector< double > &v) |
void | set_x (double *input, int n_input) |
Sets the x values of the decay curve. More... | |
void | set_y (std::vector< double > &v) |
Sets the y values of the decay curve. More... | |
void | set_y (double *input, int n_input) |
Sets the y values of the decay curve. More... | |
size_t | size () const |
Get the size of the curve. More... | |
double | sum (int start=0, int stop=-1) |
Calculates the sum of y values within a given range. More... | |
Static Public Member Functions | |
static std::vector< double > | shift_array (double *input, int n_input, double shift) |
Shift an array by a given value. More... | |
void IMP::bff::DecayCurve::apply_simple_moving_average | ( | int | start, |
int | stop, | ||
int | n_window = 5 , |
||
bool | normalize = false |
||
) |
Applies a simple moving average (SMA) filter to the data.
start | The start index. |
stop | The stop index. |
n_window | The window size for the SMA filter. |
normalize | Flag indicating whether to normalize the filtered data. |
bool IMP::bff::DecayCurve::empty | ( | ) |
Check if the curve is empty.
This function checks if the curve is empty, i.e., it has no data points.
double IMP::bff::DecayCurve::get_acquisition_time | ( | ) | const |
Returns the acquisition time of the decay curve.
double IMP::bff::DecayCurve::get_average_dx | ( | ) |
Get the average x-value difference.
This function returns the average difference between consecutive x-values.
std::vector<double> IMP::bff::DecayCurve::get_dx | ( | ) |
Get the x-value differences.
This function returns the differences between consecutive x-values.
std::vector<double>& IMP::bff::DecayCurve::get_ey | ( | ) |
Returns the error values of the decay curve.
std::string IMP::bff::DecayCurve::get_json | ( | ) | const |
Returns the JSON representation of the decay curve.
double IMP::bff::DecayCurve::get_shift | ( | ) |
Returns the time shift of the decay curve.
std::vector<double>& IMP::bff::DecayCurve::get_x | ( | ) |
Get the x-values of the curve.
This function returns the x-values of the curve.
std::vector<double>& IMP::bff::DecayCurve::get_y | ( | ) |
Returns the y values of the decay curve.
DecayCurve& IMP::bff::DecayCurve::operator* | ( | double | v | ) | const |
Overloads the multiplication operator to multiply the decay curve by a constant value.
v | The constant value to be multiplied by. |
DecayCurve& IMP::bff::DecayCurve::operator* | ( | const DecayCurve & | other | ) | const |
Overloads the '*' operator to multiply two DecayCurve objects.
other | The DecayCurve object to be multiplied. |
DecayCurve& IMP::bff::DecayCurve::operator*= | ( | double | v | ) |
Multiplies the decay curve by a value.
v | The value to be multiplied by. |
DecayCurve& IMP::bff::DecayCurve::operator+ | ( | double | v | ) | const |
Overloads the addition operator to add a constant value to the decay curve.
v | The constant value to be added. |
DecayCurve& IMP::bff::DecayCurve::operator+ | ( | const DecayCurve & | other | ) | const |
Overloads the '+' operator to add two DecayCurve objects.
other | The DecayCurve object to be added. |
DecayCurve& IMP::bff::DecayCurve::operator+= | ( | double | v | ) |
Adds a value to the decay curve.
v | The value to be added. |
DecayCurve& IMP::bff::DecayCurve::operator- | ( | double | v | ) | const |
Overloads the subtraction operator to subtract a constant value from the decay curve.
v | The constant value to be subtracted. |
DecayCurve& IMP::bff::DecayCurve::operator- | ( | const DecayCurve & | other | ) | const |
Overloads the '-' operator to subtract two DecayCurve objects.
other | The DecayCurve object to be subtracted. |
DecayCurve& IMP::bff::DecayCurve::operator-= | ( | double | v | ) |
Subtracts a value from the decay curve.
v | The value to be subtracted. |
DecayCurve& IMP::bff::DecayCurve::operator/ | ( | double | v | ) | const |
Overloads the division operator to divide the decay curve by a constant value.
v | The constant value to be divided by. |
DecayCurve& IMP::bff::DecayCurve::operator/ | ( | const DecayCurve & | other | ) | const |
Overloads the '/' operator to divide two DecayCurve objects.
other | The DecayCurve object to be divided. |
DecayCurve& IMP::bff::DecayCurve::operator/= | ( | double | v | ) |
Divides the decay curve by a value.
v | The value to be divided by. |
DecayCurve& IMP::bff::DecayCurve::operator<< | ( | double | v | ) |
Shifts the curve by a float value.
v | The value to shift the curve by. |
DecayCurve& IMP::bff::DecayCurve::operator= | ( | const DecayCurve & | other | ) |
Assignment operator.
other | The DecayCurve object to be assigned. |
int IMP::bff::DecayCurve::read_json | ( | std::string | json_string | ) |
Reads the decay curve from a JSON string.
json_string | The JSON string. |
void IMP::bff::DecayCurve::resize | ( | size_t | n, |
double | v = 0.0 , |
||
double | dx = 1.0 |
||
) |
Resize the curve.
This function resizes the curve to a given size. If the new size is larger than the current size, the new elements are initialized with a given value.
n | The new size of the curve |
v | The value to initialize the new elements with (default: 0.0) |
dx | The x-value difference (default: 1.0) |
void IMP::bff::DecayCurve::set_acquisition_time | ( | double | v | ) |
Sets the acquisition time of the decay curve.
v | The acquisition time. |
void IMP::bff::DecayCurve::set_ey | ( | std::vector< double > & | v | ) |
Sets the error values of the decay curve.
v | The error values. |
void IMP::bff::DecayCurve::set_ey | ( | double * | input, |
int | n_input | ||
) |
Sets the error values of the decay curve.
input | The array of error values. |
n_input | The number of error values. |
void IMP::bff::DecayCurve::set_shift | ( | double | v | ) |
Sets the time shift of the decay curve.
v | The time shift. |
void IMP::bff::DecayCurve::set_x | ( | double * | input, |
int | n_input | ||
) |
Sets the x values of the decay curve.
input | The array of x values. |
n_input | The number of x values. |
void IMP::bff::DecayCurve::set_y | ( | std::vector< double > & | v | ) |
Sets the y values of the decay curve.
v | The y values. |
void IMP::bff::DecayCurve::set_y | ( | double * | input, |
int | n_input | ||
) |
Sets the y values of the decay curve.
input | The array of y values. |
n_input | The number of y values. |
|
static |
Shift an array by a given value.
This static function shifts the elements of an array by a given value.
input | The input array |
n_input | The size of the input array |
shift | The shift value |
size_t IMP::bff::DecayCurve::size | ( | ) | const |
Get the size of the curve.
This function returns the size of the curve, i.e., the number of data points.
double IMP::bff::DecayCurve::sum | ( | int | start = 0 , |
int | stop = -1 |
||
) |
Calculates the sum of y values within a given range.
start | The start index. |
stop | The stop index. |