IMP logo
IMP Reference Guide  develop.63b38c487d,2024/12/21
The Integrative Modeling Platform
IMP::bff::DecayCurve Class Reference

Class for fluorescence decay curves. More...

#include <IMP/bff/DecayCurve.h>

Detailed Description

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...
 
DecayCurveoperator* (double v) const
 Overloads the multiplication operator to multiply the decay curve by a constant value. More...
 
DecayCurveoperator* (const DecayCurve &other) const
 Overloads the '*' operator to multiply two DecayCurve objects. More...
 
DecayCurveoperator*= (double v)
 Multiplies the decay curve by a value. More...
 
DecayCurveoperator+ (double v) const
 Overloads the addition operator to add a constant value to the decay curve. More...
 
DecayCurveoperator+ (const DecayCurve &other) const
 Overloads the '+' operator to add two DecayCurve objects. More...
 
DecayCurveoperator+= (double v)
 Adds a value to the decay curve. More...
 
DecayCurveoperator- (double v) const
 Overloads the subtraction operator to subtract a constant value from the decay curve. More...
 
DecayCurveoperator- (const DecayCurve &other) const
 Overloads the '-' operator to subtract two DecayCurve objects. More...
 
DecayCurveoperator-= (double v)
 Subtracts a value from the decay curve. More...
 
DecayCurveoperator/ (double v) const
 Overloads the division operator to divide the decay curve by a constant value. More...
 
DecayCurveoperator/ (const DecayCurve &other) const
 Overloads the '/' operator to divide two DecayCurve objects. More...
 
DecayCurveoperator/= (double v)
 Divides the decay curve by a value. More...
 
DecayCurveoperator<< (double v)
 Shifts the curve by a float value. More...
 
DecayCurveoperator= (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...
 

Member Function Documentation

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.

Parameters
startThe start index.
stopThe stop index.
n_windowThe window size for the SMA filter.
normalizeFlag 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.

Returns
True if the curve is empty, false otherwise
double IMP::bff::DecayCurve::get_acquisition_time ( ) const

Returns the acquisition time of the decay curve.

Returns
The acquisition time.
double IMP::bff::DecayCurve::get_average_dx ( )

Get the average x-value difference.

This function returns the average difference between consecutive x-values.

Returns
The average x-value difference
std::vector<double> IMP::bff::DecayCurve::get_dx ( )

Get the x-value differences.

This function returns the differences between consecutive x-values.

Returns
The x-value differences
std::vector<double>& IMP::bff::DecayCurve::get_ey ( )

Returns the error values of the decay curve.

Returns
The error values.
std::string IMP::bff::DecayCurve::get_json ( ) const

Returns the JSON representation of the decay curve.

Returns
The JSON string.
double IMP::bff::DecayCurve::get_shift ( )

Returns the time shift of the decay curve.

Returns
The time shift.
std::vector<double>& IMP::bff::DecayCurve::get_x ( )

Get the x-values of the curve.

This function returns the x-values of the curve.

Returns
The x-values of the curve
std::vector<double>& IMP::bff::DecayCurve::get_y ( )

Returns the y values of the decay curve.

Returns
The y values.
DecayCurve& IMP::bff::DecayCurve::operator* ( double  v) const

Overloads the multiplication operator to multiply the decay curve by a constant value.

Parameters
vThe constant value to be multiplied by.
Returns
A new DecayCurve object representing the result of the multiplication.
DecayCurve& IMP::bff::DecayCurve::operator* ( const DecayCurve other) const

Overloads the '*' operator to multiply two DecayCurve objects.

Parameters
otherThe DecayCurve object to be multiplied.
Returns
A new DecayCurve object that is the result of the multiplication.
DecayCurve& IMP::bff::DecayCurve::operator*= ( double  v)

Multiplies the decay curve by a value.

Parameters
vThe value to be multiplied by.
Returns
A reference to the modified DecayCurve object.
DecayCurve& IMP::bff::DecayCurve::operator+ ( double  v) const

Overloads the addition operator to add a constant value to the decay curve.

Parameters
vThe constant value to be added.
Returns
A new DecayCurve object representing the result of the addition.
DecayCurve& IMP::bff::DecayCurve::operator+ ( const DecayCurve other) const

Overloads the '+' operator to add two DecayCurve objects.

Parameters
otherThe DecayCurve object to be added.
Returns
A new DecayCurve object that is the result of the addition.
DecayCurve& IMP::bff::DecayCurve::operator+= ( double  v)

Adds a value to the decay curve.

Parameters
vThe value to be added.
Returns
A reference to the modified DecayCurve object.
DecayCurve& IMP::bff::DecayCurve::operator- ( double  v) const

Overloads the subtraction operator to subtract a constant value from the decay curve.

Parameters
vThe constant value to be subtracted.
Returns
A new DecayCurve object representing the result of the subtraction.
DecayCurve& IMP::bff::DecayCurve::operator- ( const DecayCurve other) const

Overloads the '-' operator to subtract two DecayCurve objects.

Parameters
otherThe DecayCurve object to be subtracted.
Returns
A new DecayCurve object that is the result of the subtraction.
DecayCurve& IMP::bff::DecayCurve::operator-= ( double  v)

Subtracts a value from the decay curve.

Parameters
vThe value to be subtracted.
Returns
A reference to the modified DecayCurve object.
DecayCurve& IMP::bff::DecayCurve::operator/ ( double  v) const

Overloads the division operator to divide the decay curve by a constant value.

Parameters
vThe constant value to be divided by.
Returns
A new DecayCurve object representing the result of the division.
DecayCurve& IMP::bff::DecayCurve::operator/ ( const DecayCurve other) const

Overloads the '/' operator to divide two DecayCurve objects.

Parameters
otherThe DecayCurve object to be divided.
Returns
A new DecayCurve object that is the result of the division.
DecayCurve& IMP::bff::DecayCurve::operator/= ( double  v)

Divides the decay curve by a value.

Parameters
vThe value to be divided by.
Returns
A reference to the modified DecayCurve object.
DecayCurve& IMP::bff::DecayCurve::operator<< ( double  v)

Shifts the curve by a float value.

Parameters
vThe value to shift the curve by.
Returns
A reference to the modified DecayCurve object.
DecayCurve& IMP::bff::DecayCurve::operator= ( const DecayCurve other)

Assignment operator.

Parameters
otherThe DecayCurve object to be assigned.
Returns
A reference to the assigned DecayCurve object.
int IMP::bff::DecayCurve::read_json ( std::string  json_string)

Reads the decay curve from a JSON string.

Parameters
json_stringThe JSON string.
Returns
0 if successful, -1 otherwise.
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.

Parameters
nThe new size of the curve
vThe value to initialize the new elements with (default: 0.0)
dxThe x-value difference (default: 1.0)
void IMP::bff::DecayCurve::set_acquisition_time ( double  v)

Sets the acquisition time of the decay curve.

Parameters
vThe acquisition time.
void IMP::bff::DecayCurve::set_ey ( std::vector< double > &  v)

Sets the error values of the decay curve.

Parameters
vThe error values.
void IMP::bff::DecayCurve::set_ey ( double *  input,
int  n_input 
)

Sets the error values of the decay curve.

Parameters
inputThe array of error values.
n_inputThe number of error values.
void IMP::bff::DecayCurve::set_shift ( double  v)

Sets the time shift of the decay curve.

Parameters
vThe time shift.
void IMP::bff::DecayCurve::set_x ( double *  input,
int  n_input 
)

Sets the x values of the decay curve.

Parameters
inputThe array of x values.
n_inputThe number of x values.
void IMP::bff::DecayCurve::set_y ( std::vector< double > &  v)

Sets the y values of the decay curve.

Parameters
vThe y values.
void IMP::bff::DecayCurve::set_y ( double *  input,
int  n_input 
)

Sets the y values of the decay curve.

Parameters
inputThe array of y values.
n_inputThe number of y values.
static std::vector<double> IMP::bff::DecayCurve::shift_array ( double *  input,
int  n_input,
double  shift 
)
static

Shift an array by a given value.

This static function shifts the elements of an array by a given value.

Parameters
inputThe input array
n_inputThe size of the input array
shiftThe shift value
Returns
The shifted array
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.

Returns
The size of the curve
double IMP::bff::DecayCurve::sum ( int  start = 0,
int  stop = -1 
)

Calculates the sum of y values within a given range.

Parameters
startThe start index.
stopThe stop index.
Returns
The sum of y values.

The documentation for this class was generated from the following file: