sfof
Public Member Functions | List of all members
Astro Class Reference

Class containing basic functions required for astronomy. More...

#include <astro.hpp>

Public Member Functions

int find_bin (double, double, double)
 This method finds a bin corresponding to the input value given the minimum value in range and the bin size. More...
 
int num_bins (double, double, double)
 This method finds the number of bins in a given range for a given bin size. More...
 
bool within (double, double, double)
 This method deterimines whether or not a value is within the limits provided. More...
 
double deg2rad (double)
 This method converts the input angle from degrees to radians. More...
 
double rad2deg (double)
 This method converts the input angle from radians to degrees. More...
 
double angsep (double, double, double, double)
 This method calculates the angular separation in radians between two points. More...
 
double angsep (const Point &, const Point &)
 This method calculates the angular separation in radians between two points. More...
 
double mean (const std::vector< double > &)
 This method calculates the mean value of a vector of doubles. More...
 
double median (std::vector< double >)
 This method calculates the median value of a vector of doubles. More...
 
double variance (const std::vector< double > &)
 This method calculates the variance of a vector of doubles. More...
 
double stdev (const std::vector< double > &)
 This method calculates the standard deviation of a vector of doubles. More...
 
double stderr_mean (const std::vector< double > &)
 This method calculates the standard error on the mean of a vector
of doubles. More...
 
double stderr_median (const std::vector< double > &)
 This method calculates the standard error on the median of a
vector of doubles. More...
 
double min (const std::vector< double > &)
 This method calculates the minimum value of a vector of doubles. More...
 
double max (const std::vector< double > &)
 This method calculates the maximum value of a vector of doubles. More...
 

Detailed Description

Class containing basic functions required for astronomy.

This class encompasses a selection of functions that perform some basic calculations that often required for astronomy or cosmology.

Member Function Documentation

◆ angsep() [1/2]

double Astro::angsep ( const Point P1,
const Point P2 
)

This method calculates the angular separation in radians between two points.

Parameters
[in]P1Right ascension and Declination of first point.
[in]P2Right ascension and Declination of second point.
Returns
Anugular separation in radians.

Function that returns the angular separation (in radians) between two points.

◆ angsep() [2/2]

double Astro::angsep ( double  ra1,
double  dec1,
double  ra2,
double  dec2 
)

This method calculates the angular separation in radians between two points.

Parameters
[in]ra1Right ascension of first point.
[in]dec1Declination of first point.
[in]ra2Right ascension of second point.
[in]dec2Declination of second point.
Returns
Anugular separation in radians.

◆ deg2rad()

double Astro::deg2rad ( double  angle)

This method converts the input angle from degrees to radians.

Parameters
[in]angleInput angle in degrees.
Returns
Angle in radians.

◆ find_bin()

int Astro::find_bin ( double  value,
double  min_value,
double  bin_size 
)

This method finds a bin corresponding to the input value given the minimum value in range and the bin size.

Parameters
[in]valueInput value.
[in]min_valueMinimum value in the range.
[in]bin_sizeBin size.
Returns
Bin number corresponding to the input value.

◆ max()

double Astro::max ( const std::vector< double > &  elements)

This method calculates the maximum value of a vector of doubles.

Parameters
[in]elementsVector of double floating point values.
Returns
Maximum value.

◆ mean()

double Astro::mean ( const std::vector< double > &  elements)

This method calculates the mean value of a vector of doubles.

Parameters
[in]elementsVector of double floating point values.
Returns
Mean value.

◆ median()

double Astro::median ( std::vector< double >  elements)

This method calculates the median value of a vector of doubles.

Parameters
[in]elementsVector of double floating point values.
Returns
Median value.

◆ min()

double Astro::min ( const std::vector< double > &  elements)

This method calculates the minimum value of a vector of doubles.

Parameters
[in]elementsVector of double floating point values.
Returns
Minimum value.

◆ num_bins()

int Astro::num_bins ( double  min_value,
double  max_value,
double  bin_size 
)

This method finds the number of bins in a given range for a given bin size.

Parameters
[in]min_valueMaximum value in the range.
[in]max_valueMinimum value in the range.
[in]bin_sizeBin size.
Returns
Number of bins in the relevant range.

◆ rad2deg()

double Astro::rad2deg ( double  angle)

This method converts the input angle from radians to degrees.

Parameters
[in]angleInput angle in radians.
Returns
Angle in degrees.

◆ stderr_mean()

double Astro::stderr_mean ( const std::vector< double > &  elements)

This method calculates the standard error on the mean of a vector
of doubles.

Parameters
[in]elementsVector of double floating point values.
Returns
Standard error on the mean.

◆ stderr_median()

double Astro::stderr_median ( const std::vector< double > &  elements)

This method calculates the standard error on the median of a
vector of doubles.

Parameters
[in]elementsVector of double floating point values.
Returns
Standard error on the median.

◆ stdev()

double Astro::stdev ( const std::vector< double > &  elements)

This method calculates the standard deviation of a vector of doubles.

Parameters
[in]elementsVector of double floating point values.
Returns
Standard deviation.

◆ variance()

double Astro::variance ( const std::vector< double > &  elements)

This method calculates the variance of a vector of doubles.

Parameters
[in]elementsVector of double floating point values.
Returns
Variance.

◆ within()

bool Astro::within ( double  value,
double  min_value,
double  max_value 
)

This method deterimines whether or not a value is within the limits provided.

Parameters
[in]valueInput value.
[in]min_valueMaximum value in the range.
[in]max_valueMinimum value in the range.

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