Functions | ||||||||||||||||
cpl_image * | sinfo_vector_to_image (const cpl_vector *vector, cpl_type type) | |||||||||||||||
Convert a vector to a 1d image. | ||||||||||||||||
long | sinfo_round_double (double x) | |||||||||||||||
Round a number to the nearest integer. | ||||||||||||||||
int | sinfo_parameter_get_default_flag (const cpl_parameter *p) | |||||||||||||||
Check if an input parameter has been changed by the user. | ||||||||||||||||
sinfo_fftn | ||||||||||||||||
This routine is a public domain FFT. See extract of Usenet article below. Found on { http://www.tu-chemnitz.de/~arndt/joerg.html}. {verbatim} From: alee@tybalt.caltech.edu (Andrew Lee) Newsgroups: comp.sources.misc Subject: N-dimensional, Radix 2 FFT Routine Date: 17 Jul 87 22:26:29 GMT Approved: allbery@ncoast.UUCP X-Archive: comp.sources.misc/8707/48 [..] Now for the usage (finally): data[] is the array of complex numbers to be transformed, nn[] is the array giving the dimensions (I mean size) of the array, ndim is the number of dimensions of the array, and isign is +1 for a forward transform, and -1 for an inverse transform. data[] and nn[] are stored in the "natural" order for C: nn[0] gives the number of elements along the leftmost index, nn[ndim - 1] gives the number of elements along the rightmost index, and data should be declared along the lines of struct (f)complex data[nn[0], nn[1], ..., nn[ndim - 1]] Additional notes: The routine does NO NORMALIZATION, so if you do a forward, and then an inverse transform on an array, the result will be identical to the original array MULTIPLIED BY THE NUMBER OF ELEMENTS IN THE ARRAY. Also, of course, the dimensions of data[] must all be powers of 2. {verbatim} | ||||||||||||||||
void | sinfo_fftn (dcomplex data[], unsigned nn[], int ndim, int isign) | |||||||||||||||
sinfo_is_power_of_2 | ||||||||||||||||
Find if a given integer is a power of 2.
If the given number is a power of 2, the power is returned. Otherwise -1 is returned. Example: {verbatim} sinfo_is_power_of_2(1024) returns 10 sinfo_is_power_of_2(1023) returns -1 {verbatim} | ||||||||||||||||
int | sinfo_is_power_of_2 (int p) | |||||||||||||||
sinfo_file_exists | ||||||||||||||||
Find if a given file name corresponds to an existing file.
Find out if the given character string corresponds to a file that can be stat()'ed. | ||||||||||||||||
int | sinfo_file_exists (const char *filename) | |||||||||||||||
sinfo_ipow | ||||||||||||||||
Same as pow(x,y) but for integer values of y only (faster).
This is much faster than the math function due to the integer. Some compilers make this optimization already, some do not. p can be positive, negative or null. | ||||||||||||||||
double | sinfo_ipow (double x, int p) | |||||||||||||||
sinfo_create_mx | ||||||||||||||||
Allocates a new sinfo_eclipse_matrix.
Allocates a new sinfo_eclipse_matrix. | ||||||||||||||||
Matrix | sinfo_create_mx (int nr, int nc) | |||||||||||||||
sinfo_copy_mx | ||||||||||||||||
Copy a sinfo_eclipse_matrix. | ||||||||||||||||
Matrix | sinfo_copy_mx (Matrix a) | |||||||||||||||
sinfo_close_mx | ||||||||||||||||
Frees memory associated to a sinfo_eclipse_matrix.
Free a sinfo_eclipse_matrix. | ||||||||||||||||
void | sinfo_close_mx (Matrix a) | |||||||||||||||
sinfo_mul_mx | ||||||||||||||||
Multiply matrices. | ||||||||||||||||
Matrix | sinfo_mul_mx (Matrix a, Matrix b) | |||||||||||||||
sinfo_invert_mx | ||||||||||||||||
Inverts a sinfo_eclipse_matrix.
The sinfo_eclipse_matrix inversion procedure is hardcoded for optimized speed in the case of 1x1, 2x2 and 3x3 matrices. This function is not suitable for large matrices. | ||||||||||||||||
Matrix | sinfo_invert_mx (Matrix aa) | |||||||||||||||
sinfo_transp_mx | ||||||||||||||||
Transposes a sinfo_eclipse_matrix.
Transpose a sinfo_eclipse_matrix. | ||||||||||||||||
Matrix | sinfo_transp_mx (Matrix a) | |||||||||||||||
sinfo_least_sq_mx | ||||||||||||||||
Compute the solution of an equation using a pseudo-inverse.
The equation is XA=B. The pseudo-inverse solution to this equation is defined as: {verbatim} P = B.tA.inv(A.tA) {verbatim} P is solving the equation using a least-squares criterion. Demonstration left to the reader. | ||||||||||||||||
Matrix | sinfo_least_sq_mx (Matrix A, Matrix B) | |||||||||||||||
sinfo_print_mx | ||||||||||||||||
Prints out a sinfo_eclipse_matrix on stdout.
The sinfo_eclipse_matrix name is printed out, then all values row by row. Used for debugging purposes mostly. | ||||||||||||||||
void | sinfo_print_mx (Matrix M, const char *name) | |||||||||||||||
sinfo_kth_smallest | ||||||||||||||||
Find the kth smallest element in an array.
Provide an array of n pixelvalues and the rank of the value you want to find. A rank of 0 means the minimum element, a rank of n-1 is the maximum element, and a rank of n/2 is the sinfo_median. Use the median_WIRTH macro to find the sinfo_median directly. NB: The input array is modified. Some elements are swapped, until the requested value is found. The array is left in an undefined sorted state. This algorithm was taken from the following book: {verbatim} Author: Wirth, Niklaus Title: Algorithms + data structures = programs Publisher: Englewood Cliffs: Prentice-Hall, 1976 Physical description: 366 p. Series: Prentice-Hall Series in Automatic Computation {verbatim} | ||||||||||||||||
pixelvalue | sinfo_kth_smallest (pixelvalue a[], int n, int k) | |||||||||||||||
sinfo_kth_smallest_double | ||||||||||||||||
Find the kth smallest element in a double array.
See sinfo_kth_smallest() function in the same file. NB: THE INPUT ARRAY IS MODIFIED. | ||||||||||||||||
double | sinfo_kth_smallest_double (double a[], int n, int k) | |||||||||||||||
#define | PIX_SWAP(a, b) { register pixelvalue t=(a);(a)=(b);(b)=t; } | |||||||||||||||
#define | PIX_SWAP(a, b) { pixelvalue temp=(a);(a)=(b);(b)=temp; } | |||||||||||||||
#define | DBL_SWAP(a, b) { register double t=(a);(a)=(b);(b)=t; } | |||||||||||||||
#define | PIX_SORT(a, b) { if ((a)>(b)) PIX_SWAP((a),(b)); } | |||||||||||||||
sinfo_opt_med3 | ||||||||||||||||
Optimized search of the sinfo_median of 3 values.
Found on sci.image.processing. Cannot go faster unless some assumptions are made about the nature of the input signal, or the underlying hardware. The input array is modified. | ||||||||||||||||
pixelvalue | sinfo_opt_med3 (pixelvalue *p) | |||||||||||||||
sinfo_opt_med5 | ||||||||||||||||
Optimized search of the sinfo_median of 5 values.
Found on sci.image.processing. Cannot go faster unless some assumptions are made about the nature of the input signal, or the underlying hardware. The input array is modified. | ||||||||||||||||
pixelvalue | sinfo_opt_med5 (pixelvalue *p) | |||||||||||||||
sinfo_opt_med7 | ||||||||||||||||
Optimized search of the sinfo_median of 7 values.
Found on sci.image.processing. Cannot go faster unless some assumptions are made about the nature of the input signal, or the underlying hardware. The input array is modified. | ||||||||||||||||
pixelvalue | sinfo_opt_med7 (pixelvalue *p) | |||||||||||||||
sinfo_opt_med9 | ||||||||||||||||
Optimized search of the sinfo_median of 9 values.
Formula from: {verbatim} XILINX XCELL magazine, vol. 23 by John L. Smith {verbatim} The result array is guaranteed to contain the sinfo_median value in middle position, but other elements are NOT sorted. The input array is modified. | ||||||||||||||||
pixelvalue | sinfo_opt_med9 (pixelvalue *p) | |||||||||||||||
sinfo_opt_med25 | ||||||||||||||||
Optimized search of the sinfo_median of 25 values.
Formula from: {verbatim} Graphic Gems source code {verbatim} The result array is guaranteed to contain the sinfo_median value in middle position, but other elements are NOT sorted. The input array is modified. | ||||||||||||||||
pixelvalue | sinfo_opt_med25 (pixelvalue *p) | |||||||||||||||
sinfo_median_pixelvalue | ||||||||||||||||
Compute the sinfo_median pixel value of an array.
This is the generic method that should be called to get the sinfo_median out of an array of pixelvalues. It calls in turn the most efficient method depending on the number of values in the array. The input array is always modified. | ||||||||||||||||
pixelvalue | sinfo_median_pixelvalue (pixelvalue *a, int n) | |||||||||||||||
sinfo_sinfo_merge_images() | ||||||||||||||||
merges the rows of two image frames in a way that the resulting image has double length in y-direction
| ||||||||||||||||
cpl_image * | sinfo_sinfo_merge_images (cpl_image *im1, cpl_image *im2, cpl_image *res_image) | |||||||||||||||
sinfo_new_remove_general_offset() | ||||||||||||||||
removes the offset between two images
adds general offset between two frames to the second image and delivers the residual image, assuming that the background cancellation did not work perfectly well. | ||||||||||||||||
cpl_image * | sinfo_new_remove_general_offset (cpl_image *im1, cpl_image *im2, cpl_image *res_image, int n) | |||||||||||||||
sinfo_new_remove_regional_tilt() | ||||||||||||||||
removes a general tilt from the spectra , created e.g. by different emissivities of the telescope itself and delivers the residual image
| ||||||||||||||||
cpl_image * | sinfo_new_remove_regional_tilt (cpl_image *im1, cpl_image *im2, cpl_image *res_image) | |||||||||||||||
sinfo_new_remove_column_offset() | ||||||||||||||||
removes individual column offset, created e.g. by imperfect guiding. The offset is divided out. The ratio is derived from the medians of the contributions.
| ||||||||||||||||
cpl_image * | sinfo_new_remove_column_offset (cpl_image *im1, cpl_image *im2, cpl_image *res_image) | |||||||||||||||
sinfo_new_remove_residual_tilt() | ||||||||||||||||
removes a residual column tilt (determined from the residual image) created by previous operations
| ||||||||||||||||
cpl_image * | sinfo_new_remove_residual_tilt (cpl_image *im2, cpl_image *res_image) | |||||||||||||||
sinfo_new_remove_residual_offset() | ||||||||||||||||
removes the residual offset by adding the median of the residual image to each column
| ||||||||||||||||
cpl_image * | sinfo_new_remove_residual_offset (cpl_image *im2, cpl_image *res_image) | |||||||||||||||
sinfo_pixel_qsort | ||||||||||||||||
Sort an array of pixels by increasing pixelvalue.
Optimized implementation of a fast pixel sort. The input array is modified. | ||||||||||||||||
void | sinfo_pixel_qsort (pixelvalue *pix_arr, int npix) | |||||||||||||||
#define | PIX_SWAP(a, b) { pixelvalue temp=(a);(a)=(b);(b)=temp; } | |||||||||||||||
#define | PIX_STACK_SIZE 50 | |||||||||||||||
sinfo_poly2d_compute | ||||||||||||||||
Compute the value of a poly2d at a given point.
This computes the value of a poly2d in a single point. To compute many values in a row, see sinfo_poly2d_compute_array(). | ||||||||||||||||
double | sinfo_poly2d_compute (poly2d *p, double x, double y) | |||||||||||||||
sinfo_table_shift_column_spline3 | ||||||||||||||||
| ||||||||||||||||
cpl_table * | sinfo_table_shift_column_spline3 (cpl_table *t, const char *col, const double shift) | |||||||||||||||
sinfo_table_shift_column_int | ||||||||||||||||
| ||||||||||||||||
cpl_table * | sinfo_table_shift_column_int (const cpl_table *t, const char *col, const double s, double *r) | |||||||||||||||
sinfo_table_shift_column_poly | ||||||||||||||||
| ||||||||||||||||
cpl_table * | sinfo_table_shift_column_poly (cpl_table *t, const char *col, const double shift, const int order) | |||||||||||||||
void | sinfo_new_array_set_value (float *array, float value, int i) | |||||||||||||||
float | sinfo_new_array_get_value (float *array, int i) | |||||||||||||||
void | sinfo_new_destroy_array (float **array) | |||||||||||||||
void | sinfo_new_destroy_stringarray (char **array, int size_x) | |||||||||||||||
void | sinfo_new_destroy_2Dintarray (int ***array, int size_x) | |||||||||||||||
void | sinfo_new_intarray_set_value (int *array, int value, int i) | |||||||||||||||
float | sinfo_new_array2D_get_value (float **array, int x, int y) | |||||||||||||||
int ** | sinfo_new_2Dintarray (int size_x, int size_y) | |||||||||||||||
float * | sinfo_new_floatarray (int size) | |||||||||||||||
void | sinfo_new_destroy_2Dfloatarray (float ***array, int size_x) | |||||||||||||||
void | sinfo_new_destroy_2Ddoublearray (double ***array, int size_x) | |||||||||||||||
void | sinfo_new_array2D_set_value (float **array, float value, int x, int y) | |||||||||||||||
double | sinfo_new_doublearray_get_value (double *array, int i) | |||||||||||||||
void | sinfo_new_doublearray_set_value (double *array, double value, int i) | |||||||||||||||
void | sinfo_new_destroy_doublearray (double *array) | |||||||||||||||
double * | sinfo_new_doublearray (int size) | |||||||||||||||
double ** | sinfo_new_2Ddoublearray (int size_x, int size_y) | |||||||||||||||
float ** | sinfo_new_2Dfloatarray (int size_x, int size_y) | |||||||||||||||
int * | sinfo_new_intarray (int size) | |||||||||||||||
void | sinfo_new_destroy_intarray (int **array) | |||||||||||||||
int | sinfo_new_intarray_get_value (int *array, int i) | |||||||||||||||
float | sinfo_new_Stats_get_cleanstdev (Stats *stats) | |||||||||||||||
float | sinfo_new_Stats_get_cleanmean (Stats *stats) | |||||||||||||||
char * | sinfo_new_get_basename (const char *filename) | |||||||||||||||
char * | sinfo_new_get_rootname (const char *filename) | |||||||||||||||
cpl_imagelist * | sinfo_new_frameset_to_iset (cpl_frameset *fset) | |||||||||||||||
Convert a NACO frameset to an images set. | ||||||||||||||||
cpl_imagelist * | sinfo_new_imagelist_load_frameset (const cpl_frameset *frameset, cpl_type type, int pnum, int extnum) | |||||||||||||||
Load an imagelist from a frameset. | ||||||||||||||||
char ** | sinfo_new_frameset_to_filenames (cpl_frameset *set, int *nfiles) | |||||||||||||||
Get the list of filenames from a cpl_frameset. | ||||||||||||||||
double | sinfo_spline_hermite (double xp, const double *x, const double *y, int n, int *istart) | |||||||||||||||
Spline interpolation based on Hermite polynomials. | ||||||||||||||||
cpl_error_code | update_bad_pixel_map (cpl_image *im) | |||||||||||||||
Update the bad pixel map for the image - mark all pixels with NaN value as a bad. | ||||||||||||||||
cpl_polynomial * | sinfo_polynomial_fit_2d_create (cpl_bivector *xy_pos, cpl_vector *values, int degree, double *mse) | |||||||||||||||
cpl_polynomial * | sinfo_polynomial_fit_1d_create (const cpl_vector *x_pos, const cpl_vector *values, int degree, double *mse) | |||||||||||||||
cpl_image * | sinfo_image_filter_median (const cpl_image *img, const cpl_matrix *mx) | |||||||||||||||
cpl_image * | sinfo_image_filter_linear (const cpl_image *img, const cpl_matrix *mx) |
TBD
char** sinfo_new_frameset_to_filenames | ( | cpl_frameset * | set, | |
int * | nfiles | |||
) |
Get the list of filenames from a cpl_frameset.
set | input frame set | |
nfiles | the number of file names returned |
Definition at line 822 of file sinfo_utilities.c.
Referenced by sinfo_new_frameset_to_iset().
cpl_imagelist* sinfo_new_frameset_to_iset | ( | cpl_frameset * | fset | ) |
Convert a NACO frameset to an images set.
fset | input frames set |
The first plane of the primary unit of each frame is loaded
Definition at line 720 of file sinfo_utilities.c.
References sinfo_msg_error, sinfo_new_frameset_to_filenames(), and sinfo_new_imagelist_load_frameset().
cpl_imagelist* sinfo_new_imagelist_load_frameset | ( | const cpl_frameset * | frameset, | |
cpl_type | type, | |||
int | pnum, | |||
int | extnum | |||
) |
Load an imagelist from a frameset.
frameset | A frameset containing name(s) of image FITS files | |
type | cpl_type | |
pnum | The plane (FITS NAXIS3) number (0 for all planes) | |
extnum | The required FITS extension (-1 for all) |
Definition at line 763 of file sinfo_utilities.c.
Referenced by sinfo_new_frameset_to_iset().
int sinfo_parameter_get_default_flag | ( | const cpl_parameter * | p | ) |
Check if an input parameter has been changed by the user.
p | input parameter |
Definition at line 99 of file sinfo_utils.c.
long sinfo_round_double | ( | double | x | ) |
Round a number to the nearest integer.
x | The number to round |
This is implemented as a function rather than a macro to avoid multiple evaluations of expressions that have side effects.
Definition at line 89 of file sinfo_utils.c.
Referenced by sinfo_select_table_rows().
double sinfo_spline_hermite | ( | double | xp, | |
const double * | x, | |||
const double * | y, | |||
int | n, | |||
int * | istart | |||
) |
Spline interpolation based on Hermite polynomials.
xp | x-value to interpolate | |
x | x-values | |
y | y-values | |
n | array length | |
istart | (input/output) initial row (set to 0 to search all row) |
The x column must be sorted (ascending or descending) and all x column values must be different.
Adopted from: Cristian Levin - ESO La Silla, 1-Apr-1991
Definition at line 879 of file sinfo_utilities.c.
cpl_image* sinfo_vector_to_image | ( | const cpl_vector * | vector, | |
cpl_type | type | |||
) |
Convert a vector to a 1d image.
vector | to convert | |
type | of image |
Definition at line 47 of file sinfo_utilities.c.
References sinfo_free_image().
cpl_error_code update_bad_pixel_map | ( | cpl_image * | im | ) |
Update the bad pixel map for the image - mark all pixels with NaN value as a bad.
im | Image with pixel-type float or double |
Definition at line 944 of file sinfo_utilities.c.