OPERA
1.0
Open source echelle spectrograph reduction pipeline
|
Go to the source code of this file.
Defines | |
#define | M_PI 3.14159265358979323846264338327950288 |
#define | ELEM_SWAP(a, b) {register float t=(a);(a)=(b);(b)=t;} |
Functions | |
float | operaArrayMean (unsigned np, const float *array) |
Calculate arithmetic mean of float array. | |
float | operaArrayWeightedMean (unsigned np, const float *array, const float *weigh) |
Calculate weighted mean of float array. | |
float | operaArrayAvgSigClip (unsigned np, const float *array, unsigned nsig) |
Calculate average of array clipped by nsig x sdtdev of original array. | |
float | operaArraySig (unsigned np, const float *array) |
Calculate standard deviation around mean of array. | |
float | operaArrayWeightedSig (unsigned np, const float *array, const float *weigh) |
Calculate weighted standard deviation of weighted mean of array. | |
float | operaArrayMedian (unsigned np, const float *array) |
This function non-destructively finds the median of an array. | |
float | operaArrayMedSig (unsigned np, const float *array, float median) |
Calculate median deviation of float array. | |
float | operaArrayMaxValue (unsigned np, const float *array) |
Find maximum value of float array. | |
float | operaArrayMinValue (unsigned np, const float *array) |
Find minimum value of float array. | |
void | operaArrayHeapSort (unsigned np, float *arr) |
This function destructively heap sorts an array. | |
void | operaArrayIndexSort (unsigned np, const float *array, unsigned *sindex) |
This function sorts a float array in increasing order using index association (doesn't change original array) | |
float | operaUniformRand (float xcen, float xmax, float xmin) |
This function produces a random number with uniform distribution. | |
float | operaGaussRand (float xcen, float sig) |
This function produces a random number with normal distribution. | |
unsigned | operaCountPixels (unsigned np, const float *array, float minvalue, float maxvalue) |
Count number of elements in array lying between minvalue and maxvalue. | |
void | operaArrayIndexedMeanQuick (unsigned np, const float *array, const float *indexmask, unsigned nb, float *meanbin) |
This function .... | |
void | operaArrayIndexedSigQuick (unsigned np, const float *array, const float *indexmask, unsigned nb, float *sigbin) |
This function .... | |
float | operaArrayMeanQuick (unsigned np, const float *array) |
This function .... | |
float | operaArrayWeightedMeanQuick (unsigned np, const float *array, const float *weigh) |
This function .... | |
float | operaArraySigQuick (unsigned np, const float *array) |
This function ,,. | |
float | operaArrayWeightedSigQuick (unsigned np, const float *array, const float *weigh) |
This function.... | |
float | operaArrayAvgSigClipQuick (unsigned np, const float *array, unsigned nsig) |
This function does an average sigma clip of an array. | |
float | operaArrayMedianQuick (unsigned np, float *arr) |
Optimized inline function returning a median -- WARNING: DESTRUCTIVE -- the input is modified. | |
unsigned short | operaArrayMedianQuickUSHORT (unsigned np, unsigned short *arr) |
Optimized inline function returning a median -- WARNING: DESTRUCTIVE -- the input is modified. |
#define ELEM_SWAP | ( | a, | |
b | |||
) | {register float t=(a);(a)=(b);(b)=t;} |
#define M_PI 3.14159265358979323846264338327950288 |
float operaArrayAvgSigClip | ( | unsigned | np, |
const float * | array, | ||
unsigned | nsig | ||
) |
Calculate average of array clipped by nsig x sdtdev of original array.
float operaArrayAvgSigClip(unsigned np, const float *array, unsigned nsig)
np | is an unsigned for the number of elements in array |
array | is a float pointer with data |
nsig | is an unsigned for size for which data is clipped in sigma units |
float operaArrayAvgSigClipQuick | ( | unsigned | np, |
const float * | array, | ||
unsigned | nsig | ||
) | [inline] |
This function does an average sigma clip of an array.
float operaArrayAvgSigClipQuick(unsigned np, const float *array, unsigned nsig)
np | is an unsigned that .., |
array | is a const float pointer that .., |
nsig | is n unsigned that .., |
void operaArrayHeapSort | ( | unsigned | np, |
float * | arr | ||
) |
This function destructively heap sorts an array.
void operaArrayHeapSort(unsigned np, float *arr)
np | is an unsigned for the number of elements in array |
array | is a float pointer with data |
void operaArrayIndexedMeanQuick | ( | unsigned | np, |
const float * | array, | ||
const float * | indexmask, | ||
unsigned | nb, | ||
float * | meanbin | ||
) | [inline] |
This function ....
float operaArrayIndexedMeanQuick(unsigned np, const float *array, const float *weigh)
np | is an unsigned that .., |
array | is a const float pointer that .., |
weigh | is a const float pointer that .., |
void operaArrayIndexedSigQuick | ( | unsigned | np, |
const float * | array, | ||
const float * | indexmask, | ||
unsigned | nb, | ||
float * | sigbin | ||
) | [inline] |
This function ....
float operaArrayIndexedSigQuick(unsigned np, const float *array, const float *weigh)
np | is an unsigned that .., |
array | is a const float pointer that .., |
weigh | is a const float pointer that .., |
void operaArrayIndexSort | ( | unsigned | np, |
const float * | array, | ||
unsigned * | sindex | ||
) |
This function sorts a float array in increasing order using index association (doesn't change original array)
void operaArrayIndexSort(unsigned n, const float *x, unsigned *sindex)
np | is an unsigned for the number of elements in array |
array | is a float pointer with data |
sindex | is an unsigned pointer for the index association of the sorted array |
float operaArrayMaxValue | ( | unsigned | np, |
const float * | array | ||
) |
Find maximum value of float array.
float operaArrayMaxValue(unsigned np, const float *array)
np | is an unsigned for the number of elements in array |
array | is a float pointer with data |
float operaArrayMean | ( | unsigned | np, |
const float * | array | ||
) |
Calculate arithmetic mean of float array.
float operaArrayMean(unsigned np, const float *array)
np | is an unsigned for the number of elements in array |
array | is a float pointer with data |
float operaArrayMeanQuick | ( | unsigned | np, |
const float * | array | ||
) | [inline] |
This function ....
float operaArrayMeanQuick(unsigned np, const float *array)
np | is an unsigned that .., |
array | is a const float pointer that .., |
float operaArrayMedian | ( | unsigned | np, |
const float * | array | ||
) |
This function non-destructively finds the median of an array.
float operaArrayMedian(unsigned np, const float *array)
np | is an unsigned for the number of elements in array |
array | is a float pointer with data |
float operaArrayMedianQuick | ( | unsigned | np, |
float * | arr | ||
) | [inline] |
Optimized inline function returning a median -- WARNING: DESTRUCTIVE -- the input is modified.
inline float operaArrayMedianQuick(unsigned np, float *arr)
arr | - the array to get median from |
np | - number of pixels |
unsigned short operaArrayMedianQuickUSHORT | ( | unsigned | np, |
unsigned short * | arr | ||
) | [inline] |
Optimized inline function returning a median -- WARNING: DESTRUCTIVE -- the input is modified.
inline unsigned short operaArrayMedianQuickUSHORT(unsigned np, float *arr)
arr | - the array to get median from |
np | - number of pixels |
float operaArrayMedSig | ( | unsigned | np, |
const float * | array, | ||
float | median | ||
) |
Calculate median deviation of float array.
float operaArrayMedSig(unsigned np, const float *array, float median)
np | is an unsigned for the number of elements in array |
array | is a float pointer with data |
median | is a float input for the median of array |
float operaArrayMinValue | ( | unsigned | np, |
const float * | array | ||
) |
Find minimum value of float array.
float operaArrayMinValue(unsigned np, const float *array)
np | is an unsigned for the number of elements in array |
array | is a float pointer with data |
float operaArraySig | ( | unsigned | np, |
const float * | array | ||
) |
Calculate standard deviation around mean of array.
float operaArraySig(unsigned np, const float *array)
np | is an unsigned for the number of elements in array |
array | is a float pointer with data |
float operaArraySigQuick | ( | unsigned | np, |
const float * | array | ||
) | [inline] |
This function ,,.
float operaArraySigQuick(unsigned np, const float *array)
np | is an unsigned that .., |
array | is a const float pointer that .., |
float operaArrayWeightedMean | ( | unsigned | np, |
const float * | array, | ||
const float * | weigh | ||
) |
Calculate weighted mean of float array.
float operaArrayWeightedMean(unsigned np, const float *array, const float *weigh)
np | is an unsigned for the number of elements in array |
array | is a float pointer with data |
weigh | is a float pointer with weights |
float operaArrayWeightedMeanQuick | ( | unsigned | np, |
const float * | array, | ||
const float * | weigh | ||
) | [inline] |
This function ....
float operaArrayWeightedMeanQuick(unsigned np, const float *array, const float *weigh)
np | is an unsigned that .., |
array | is a const float pointer that .., |
weigh | is a const float pointer that .., |
float operaArrayWeightedSig | ( | unsigned | np, |
const float * | array, | ||
const float * | weigh | ||
) |
Calculate weighted standard deviation of weighted mean of array.
float operaArrayWeightedSig(unsigned np, const float *array, const float *weigh)
np | is an unsigned for the number of elements in array |
array | is a float pointer with data |
weigh | is a float pointer with weights |
float operaArrayWeightedSigQuick | ( | unsigned | np, |
const float * | array, | ||
const float * | weigh | ||
) | [inline] |
This function....
float operaArrayWeightedSigQuick(unsigned np, const float *array, const float *weigh)
np | is an unsigned that .., |
array | is a const float pointer that .., |
weigh | is a const float pointer that .., |
unsigned operaCountPixels | ( | unsigned | np, |
const float * | array, | ||
float | minvalue, | ||
float | maxvalue | ||
) |
Count number of elements in array lying between minvalue and maxvalue.
operaCountPixels(unsigned np, const float *array, float minvalue, float maxvalue)
np | is an unsigned for the number of elements in array |
array | is a float pointer with data |
minvalue | is a float for the minimum value to count an element |
maxvalue | is a float for the maximum value to count an element |
float operaGaussRand | ( | float | xcen, |
float | sig | ||
) |
This function produces a random number with normal distribution.
float operaGaussRand(float xcen, float sig)
xcen | is a float to define the center of the distribution |
sig | is a float to define the spread of the distribution (symmetric) |
float operaUniformRand | ( | float | xcen, |
float | xmin, | ||
float | xmax | ||
) |
This function produces a random number with uniform distribution.
float operaUniformRand(float xcen, float xmax, float xmin)
xcen | is a float for the center of the distribution |
xmin | is a float to define the lower limit of the distribution (rand > xcen - xmin) |
xmax | is a float to define the higher limit of the distribution (rand < xcen + xmax) |