Changeset 16119
- Timestamp:
- Jan 17, 2008, 1:21:51 PM (18 years ago)
- Location:
- trunk/Ohana/src/opihi
- Files:
-
- 1 deleted
- 5 edited
-
cmd.data/init.c (modified) (2 diffs)
-
cmd.data/spline_apply.c (modified) (2 diffs)
-
cmd.data/spline_construct.c (modified) (2 diffs)
-
include/data.h (modified) (3 diffs)
-
lib.data/powell.c (deleted)
-
lib.data/spline.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.data/init.c
r16117 r16119 87 87 int shift PROTO((int, char **)); 88 88 int sort_vectors PROTO((int, char **)); 89 int spline_apply PROTO((int, char **));90 int spline_construct PROTO((int, char **));89 int spline_apply_cmd PROTO((int, char **)); 90 int spline_construct_cmd PROTO((int, char **)); 91 91 int stats PROTO((int, char **)); 92 92 int style PROTO((int, char **)); … … 208 208 {"shift", shift, "shift data in an image"}, 209 209 {"sort", sort_vectors, "sort list of vectors"}, 210 {"spline.apply", spline_apply ,"apply spline fit to generate an image"},211 {"spline.const", spline_construct , "create spline 2nd deriv. terms"},210 {"spline.apply", spline_apply_cmd, "apply spline fit to generate an image"}, 211 {"spline.const", spline_construct_cmd, "create spline 2nd deriv. terms"}, 212 212 {"stats", stats, "give statistics on a portion of a buffer"}, 213 213 {"style", style, "set the style for graph plots"}, -
trunk/Ohana/src/opihi/cmd.data/spline_apply.c
r7917 r16119 1 1 # include "data.h" 2 2 3 void spline (float *x, float *y, int N, float *y2); 4 float splint (float *x, float *y, float *y2, int N, float X); 5 6 int spline_apply (int argc, char **argv) { 3 // need to rename this as an image function 4 int spline_apply_cmd (int argc, char **argv) { 7 5 8 6 int i, j, I, J; … … 77 75 Ty2[j] = *V2; 78 76 } 79 Tx1[i] = splin t(Tyc, Ty1, Ty2, Ny, y);77 Tx1[i] = spline_apply (Tyc, Ty1, Ty2, Ny, y); 80 78 } 81 spline (Txc, Tx1, Nx, Tx2);79 spline_construct (Txc, Tx1, Nx, Tx2); 82 80 83 81 /* apply x-dir spline to new image */ 84 82 for (I = 0; I < nx; I++, V++) { 85 83 x = I * rx; 86 *V = splin t(Txc, Tx1, Tx2, Nx, x);84 *V = spline_apply (Txc, Tx1, Tx2, Nx, x); 87 85 } 88 86 } -
trunk/Ohana/src/opihi/cmd.data/spline_construct.c
r7917 r16119 1 1 # include "data.h" 2 2 3 int spline_construct (int argc, char **argv) { 3 // need to rename this as an image function 4 int spline_construct_cmd (int argc, char **argv) { 4 5 5 6 int i, j, Nx, Ny, xdir; … … 54 55 } 55 56 56 spline (Tx, Ty, Ny, Ty2);57 spline_construct (Tx, Ty, Ny, Ty2); 57 58 58 59 /* copy derivatives to output buffer */ -
trunk/Ohana/src/opihi/include/data.h
r16117 r16119 73 73 int PrintQueue (Queue *queue); 74 74 75 /* in sort.c */76 void sort (double *value, int N);77 void fsort (float *value, int N);78 void sortpair (double *value1, double *value2, int N);79 void fsortpair (float *X, float *Y, int N);80 void sortthree (float *X, float *Y, float *Z, int N);81 void sort_lists (float *X, float *Y, int *S, int N);82 void dsort_lists (double *X, double *Y, int *S, int N);83 void isort_pair (int *X, int *Y, int N);84 85 75 /* in fft.c */ 86 76 void fft1D (float *dataRe, float *dataIm, int N, int Nbit, int forward); … … 88 78 int IsBinary (int N, int *Nbit); 89 79 90 /* in gaussj.c */91 int gaussj (double **a, int n, double **b, int m);92 int fgaussj (float **a, int n, float **b, int m);80 /* in spline.c */ 81 void spline_construct (float *x, float *y, int N, float *y2); 82 float spline_apply (float *x, float *y, float *y2, int N, float X); 93 83 94 84 /* in svdcmp.c */ 95 85 int svdcmp (float *a, float *w, float *v, int Nx, int Ny); 96 97 /* in spline.c */98 void spline (float *x, float *y, int N, float *y2);99 float splint (float *x, float *y, float *y2, int N, float X);100 86 101 87 /* mrqmin.c */ … … 139 125 void mrq2dfree (int Npar); 140 126 141 /* powell.c */142 void powell (float *p, int Npar, float (func)() );143 144 127 /* gaussian.c */ 145 128 double gaussian (double x, double mean, double sigma); -
trunk/Ohana/src/opihi/lib.data/spline.c
r2598 r16119 2 2 3 3 /* construct the natural spline for x, y in y2 */ 4 void spline (float *x, float *y, int N, float *y2) {4 void spline_construct (float *x, float *y, int N, float *y2) { 5 5 6 6 int i; … … 27 27 28 28 /* evaluate spline for x, y, y2 at X */ 29 float splin t(float *x, float *y, float *y2, int N, float X) {29 float spline_apply (float *x, float *y, float *y2, int N, float X) { 30 30 31 31 int i, lo, hi; … … 36 36 hi = N-1; 37 37 while (hi - lo > 1) { 38 i = (hi+lo) >> 1;39 if (x[i] > X) 38 i = 0.5*(hi+lo); 39 if (x[i] > X) { 40 40 hi = i; 41 else41 } else { 42 42 lo = i; 43 } 43 44 } 44 45
Note:
See TracChangeset
for help on using the changeset viewer.
