Changeset 16059
- Timestamp:
- Jan 14, 2008, 1:50:11 PM (18 years ago)
- Location:
- trunk/Ohana/src/opihi
- Files:
-
- 14 edited
-
cmd.astro/multifit.c (modified) (1 diff)
-
cmd.basic/shell.c (modified) (2 diffs)
-
cmd.basic/test/list.sh (modified) (1 diff)
-
cmd.basic/test/output.sh (modified) (1 diff)
-
cmd.basic/test/scan.sh (modified) (1 diff)
-
cmd.data/fit.c (modified) (1 diff)
-
cmd.data/fit2d.c (modified) (1 diff)
-
cmd.data/gaussj.c (modified) (1 diff)
-
cmd.data/tvcolors.c (modified) (1 diff)
-
lib.data/mrq2dmin.c (modified) (2 diffs)
-
lib.data/mrqmin.c (modified) (2 diffs)
-
lib.shell/expand_vectors.c (modified) (1 diff)
-
lib.shell/parse.c (modified) (1 diff)
-
mana/fitcontour.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.astro/multifit.c
r8297 r16059 141 141 } 142 142 } 143 dgaussj (a, Ndim, b, 1);143 dgaussjordan (a, b, Ndim, 1); 144 144 145 145 Ny = 0; -
trunk/Ohana/src/opihi/cmd.basic/shell.c
r15868 r16059 1 1 # include "basic.h" 2 3 static char *defshell = "/bin/sh"; 4 static char *cmdflag = "-c"; 2 5 3 6 int shell (int argc, char **argv) { … … 6 9 int exit_status; 7 10 int wait_status; 8 int result ;9 char **args ;11 int result, length; 12 char **args, *shell; 10 13 11 ALLOCATE (args, char *, argc); 14 shell = getenv ("SHELL"); 15 if (shell == NULL) shell = defshell; 16 17 // we are creating a command of the form /bin/sh -c argv[1] argv[2] etc, where 18 // the argv[1], etc elements are concatenated into a single string 19 ALLOCATE (args, char *, 4); 20 args[0] = shell; 21 args[1] = cmdflag; 22 23 length = 0; 12 24 for (i = 1; i < argc; i++) { 13 args[i-1] = argv[i];25 length += strlen(argv[i]) + 1; 14 26 } 15 args[i-1] = NULL; 27 28 ALLOCATE (args[2], char, length); 29 args[2][0] = 0; 30 for (i = 1; i < argc; i++) { 31 strcat (args[2], argv[i]); 32 if (i < argc - 1) strcat (args[2], " "); 33 } 34 args[3] = NULL; 35 36 // send the commands to the shell specified in the env variable SHELL, or else /bin/sh 16 37 17 38 // use execvp to enable a timeout on the system call 18 39 pid = fork (); 19 40 if (!pid) { /* must be child process */ 20 execvp ( args[0], args);41 execvp (shell, args); 21 42 exit (1); 22 43 } -
trunk/Ohana/src/opihi/cmd.basic/test/list.sh
r14176 r16059 75 75 echo "Number of list elements: $check4:n" 76 76 end 77 if (("$check4:0" != "This ") || ("$check4:1" != "is ") || ("$check4:2" != "a ") || ("$check4:3" != "list"))77 if (("$check4:0" != "This") || ("$check4:1" != "is") || ("$check4:2" != "a") || ("$check4:3" != "list")) 78 78 $PASS = 0 79 79 echo "List element does not return correctly!" -
trunk/Ohana/src/opihi/cmd.basic/test/output.sh
r14176 r16059 23 23 output stdout 24 24 $line = `cat testout.txt` 25 if ("$line" == "This is a test. ")25 if ("$line" == "This is a test.") 26 26 $PASS = 1 27 27 else -
trunk/Ohana/src/opihi/cmd.basic/test/scan.sh
r14176 r16059 20 20 output stdout 21 21 scan test_file.txt fscan 22 if ("$fscan" != "This ")22 if ("$fscan" != "This") 23 23 $PASS = 0 24 24 echo "Default not working!" 25 25 end 26 26 scan test_file.txt fscan 4 27 if ("$fscan" != "test ")27 if ("$fscan" != "test") 28 28 $PASS = 0 29 29 echo "Scan failure!" -
trunk/Ohana/src/opihi/cmd.data/fit.c
r8297 r16059 118 118 } 119 119 } 120 if (!dgaussj (c, nterm, b, 1)) goto escape;120 if (!dgaussjordan (c, b, nterm, 1)) goto escape; 121 121 122 122 /* generate fitted values */ -
trunk/Ohana/src/opihi/cmd.data/fit2d.c
r8871 r16059 161 161 } 162 162 163 dgaussj (c, wterm, b, 1);163 dgaussjordan (c, b, wterm, 1); 164 164 165 165 /** test print **/ -
trunk/Ohana/src/opihi/cmd.data/gaussj.c
r14914 r16059 34 34 } 35 35 36 status = dgaussj (a, N, b, 1);36 status = dgaussjordan (a, b, N, 1); 37 37 38 38 for (i = 0; i < N; i++) { -
trunk/Ohana/src/opihi/cmd.data/tvcolors.c
r16013 r16059 3 3 int tvcolors (int argc, char **argv) { 4 4 5 int N, kapa , Nchannel;5 int N, kapa; 6 6 char *name; 7 7 KapaImageData data; -
trunk/Ohana/src/opihi/lib.data/mrq2dmin.c
r7917 r16059 90 90 91 91 /* keep this test in here? */ 92 if (!fgaussj (talpha, Npar, tbeta, 1)) {92 if (!fgaussjordan (talpha, tbeta, Npar, 1)) { 93 93 lambda *= 10.0; 94 94 return (ochisq); … … 183 183 float **mrq2dcovar (int Npar) { 184 184 185 fgaussj (alpha, Npar, beta, 1);185 fgaussjordan (alpha, beta, Npar, 1); 186 186 return (alpha); 187 187 -
trunk/Ohana/src/opihi/lib.data/mrqmin.c
r7917 r16059 60 60 } 61 61 62 fgaussj (talpha, Npar, tbeta, 1);62 fgaussjordan (talpha, tbeta, Npar, 1); 63 63 64 64 for (j = 0; j < Npar; j++) partry[j] = par[j] - tbeta[j][0]; … … 137 137 /* don't invoke this in the middle of a run, only near the end */ 138 138 float **mrqcovar (int Npar) { 139 fgaussj (alpha, Npar, beta, 1);139 fgaussjordan (alpha, beta, Npar, 1); 140 140 return (alpha); 141 141 } -
trunk/Ohana/src/opihi/lib.shell/expand_vectors.c
r16003 r16059 113 113 if (J < 0) J += buf[0].header.Naxis[1]; 114 114 ptr = (float *) buf[0].matrix.buffer; 115 f1 = ptr[I + J*buf[0].header.Naxis[ 1]];115 f1 = ptr[I + J*buf[0].header.Naxis[0]]; 116 116 } else { 117 117 if ((vec = SelectVector (tmpline, OLDVECTOR, TRUE)) == NULL) goto dumpline; -
trunk/Ohana/src/opihi/lib.shell/parse.c
r16003 r16059 177 177 178 178 fptr = (float *) buf[0].matrix.buffer; 179 fptr[Nx + Ny*buf[0].header.Naxis[ 1]] = atof (val);179 fptr[Nx + Ny*buf[0].header.Naxis[0]] = atof (val); 180 180 } else { 181 181 if ((vec = SelectVector (V0, OLDVECTOR, TRUE)) == NULL) goto error; -
trunk/Ohana/src/opihi/mana/fitcontour.c
r8297 r16059 57 57 C[1][2] = C[2][1]; 58 58 59 dgaussj (C, NTERM, B, 1);59 dgaussjordan (C, B, NTERM, 1); 60 60 61 61 /** this is somewhat weak: if the object is too elongated, Rmin can be < 0 **/
Note:
See TracChangeset
for help on using the changeset viewer.
