Changeset 27817
- Timestamp:
- May 2, 2010, 11:23:11 AM (16 years ago)
- Location:
- trunk/Ohana/src
- Files:
-
- 1 added
- 10 edited
-
libdvo/include/dvo.h (modified) (1 diff)
-
libdvo/src/dvosorts.c (modified) (1 diff)
-
libkapa/src/KapaColors.c (modified) (1 diff)
-
opihi/cmd.basic/break.c (modified) (2 diffs)
-
opihi/cmd.data/Makefile (modified) (1 diff)
-
opihi/cmd.data/create.c (modified) (2 diffs)
-
opihi/cmd.data/fit1d.c (modified) (1 diff)
-
opihi/cmd.data/fit2d.c (modified) (1 diff)
-
opihi/cmd.data/histogram.c (modified) (2 diffs)
-
opihi/cmd.data/init.c (modified) (2 diffs)
-
opihi/cmd.data/match2d.c (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libdvo/include/dvo.h
r27580 r27817 443 443 void sort_image_subset (Image *image, off_t *subset, off_t N); 444 444 void sort_coords_index (double *X, double *Y, off_t *S, off_t N); 445 void sort_coords_indexonly (double *X, double *Y, off_t *S, off_t N); 445 446 void sort_regions (SkyRegion *region, off_t N); 446 447 -
trunk/Ohana/src/libdvo/src/dvosorts.c
r27435 r27817 46 46 } 47 47 48 /* sort a coordinate pair (X,Y) and the associated index (S) */ 49 void sort_coords_indexonly (double *X, double *Y, off_t *S, off_t N) { 50 51 # define SWAPFUNC(A,B){ off_t itmp; \ 52 itmp = S[A]; S[A] = S[B]; S[B] = itmp; \ 53 } 54 # define COMPARE(A,B)(X[S[A]] < X[S[B]]) 55 56 OHANA_SORT (N, COMPARE, SWAPFUNC); 57 58 # undef SWAPFUNC 59 # undef COMPARE 60 61 } 62 48 63 void sort_regions (SkyRegion *region, off_t N) { 49 64 -
trunk/Ohana/src/libkapa/src/KapaColors.c
r7080 r27817 37 37 } 38 38 } 39 if (!strcasecmp (name, "none")) return (-1); 40 39 41 fprintf (stderr, "color may be one of:\n"); 40 42 for (i = 0; i < N_KAPA_COLORS; i++) { -
trunk/Ohana/src/opihi/cmd.basic/break.c
r23582 r27817 1 1 # include "basic.h" 2 2 3 // auto_break is currently a global 3 4 int exec_break (int argc, char **argv) { 4 5 5 6 int N, value; 6 7 8 if ((N = get_argument (argc, argv, "-h"))) goto usage; 9 if ((N = get_argument (argc, argv, "-help"))) goto usage; 10 if ((N = get_argument (argc, argv, "--help"))) goto usage; 11 7 12 if ((N = get_argument (argc, argv, "-auto"))) { 8 13 remove_argument (N, &argc, argv); 9 value = -1; 10 if (!strcasecmp (argv[N], "on")) value = 1; 11 if (!strcasecmp (argv[N], "off")) value = 0; 12 if (value == -1) { 13 gprint (GP_ERR, "USAGE: break -auto [on / off]\n"); 14 if (N == argc) { 14 15 if (auto_break) 15 16 gprint (GP_ERR, "auto break on\n"); … … 18 19 return (FALSE); 19 20 } 21 value = -1; 22 if (!strcasecmp (argv[N], "on")) value = 1; 23 if (!strcasecmp (argv[N], "off")) value = 0; 24 if (value == -1) goto usage; 20 25 auto_break = value; 21 26 return (TRUE); 22 27 } 23 28 24 29 loop_break = TRUE; 25 30 return (FALSE); 26 31 32 usage: 33 gprint (GP_ERR, "USAGE: break -auto [on / off]\n"); 34 return (FALSE); 27 35 } -
trunk/Ohana/src/opihi/cmd.data/Makefile
r26891 r27817 72 72 $(SRC)/lookup.$(ARCH).o \ 73 73 $(SRC)/matrix.$(ARCH).o \ 74 $(SRC)/match2d.$(ARCH).o \ 74 75 $(SRC)/mkrgb.$(ARCH).o \ 75 76 $(SRC)/mcreate.$(ARCH).o \ -
trunk/Ohana/src/opihi/cmd.data/create.c
r20936 r27817 14 14 15 15 if ((argc != 5) && (argc != 4)) { 16 gprint (GP_ERR, "USAGE: create vector start end [delta]\n"); 16 gprint (GP_ERR, "USAGE: create vector start end [delta] [-int]\n"); 17 gprint (GP_ERR, " -int : resulting vector is integer type (delta must be integer)\n"); 17 18 return (FALSE); 18 19 } … … 20 21 if ((vec = SelectVector (argv[1], ANYVECTOR, TRUE)) == NULL) return (FALSE); 21 22 23 delta = 1; 22 24 start = atof (argv[2]); 23 25 end = atof (argv[3]); 24 delta = 1;25 26 if (argc == 5) delta = atof (argv[4]); 27 26 28 if ((start == end) || (delta == 0)) { 27 29 gprint (GP_ERR, "error in value: %f to %f, %f\n", start, end, delta); -
trunk/Ohana/src/opihi/cmd.data/fit1d.c
r24081 r27817 53 53 return (FALSE); 54 54 } 55 REQUIRE_VECTOR_FLT (xvec, FALSE);56 REQUIRE_VECTOR_FLT (yvec, FALSE);55 CastVector (xvec, OPIHI_FLT); 56 CastVector (yvec, OPIHI_FLT); 57 57 58 58 if (Weight) { 59 REQUIRE_VECTOR_FLT (dyvec, FALSE);59 CastVector (dyvec, OPIHI_FLT); 60 60 if (xvec[0].Nelements != dyvec[0].Nelements) { 61 61 gprint (GP_ERR, "vectors must have same length\n"); -
trunk/Ohana/src/opihi/cmd.data/fit2d.c
r20936 r27817 64 64 return (FALSE); 65 65 } 66 REQUIRE_VECTOR_FLT (xvec, FALSE);67 REQUIRE_VECTOR_FLT (yvec, FALSE);68 REQUIRE_VECTOR_FLT (zvec, FALSE);66 CastVector (xvec, OPIHI_FLT); 67 CastVector (yvec, OPIHI_FLT); 68 CastVector (zvec, OPIHI_FLT); 69 69 70 70 if (Weight) { 71 REQUIRE_VECTOR_FLT (dzvec, FALSE);71 CastVector (dzvec, OPIHI_FLT); 72 72 if (xvec[0].Nelements != dzvec[0].Nelements) { 73 73 gprint (GP_ERR, "vectors must have same length\n"); -
trunk/Ohana/src/opihi/cmd.data/histogram.c
r20936 r27817 3 3 int histogram (int argc, char **argv) { 4 4 5 int i, bin, Nbins;5 int i, N, bin, Nbins; 6 6 opihi_int *OUT; 7 7 opihi_flt start, end, delta; 8 Vector *xvec, *yvec; 8 Vector *xvec, *yvec, *range; 9 10 range = NULL; 11 if ((N = get_argument (argc, argv, "-range"))) { 12 remove_argument (N, &argc, argv); 13 if ((range = SelectVector (argv[N], ANYVECTOR, TRUE)) == NULL) return (FALSE); 14 remove_argument (N, &argc, argv); 15 } 9 16 10 17 if ((argc != 6) && (argc != 5)) { 11 gprint (GP_ERR, "USAGE: hist invec outvec start end [delta] \n");18 gprint (GP_ERR, "USAGE: hist invec outvec start end [delta] [-range range]\n"); 12 19 return (FALSE); 13 20 } … … 31 38 if ((xvec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE); 32 39 if ((yvec = SelectVector (argv[2], ANYVECTOR, TRUE)) == NULL) return (FALSE); 40 41 if (range) { 42 ResetVector (range, OPIHI_FLT, Nbins); 43 for (i = 0; i < range[0].Nelements; i++) { 44 range[0].elements.Flt[i] = start + i*delta; 45 } 46 } 33 47 34 48 ResetVector (yvec, OPIHI_INT, Nbins); -
trunk/Ohana/src/opihi/cmd.data/init.c
r26891 r27817 61 61 int lookup PROTO((int, char **)); 62 62 int matrix PROTO((int, char **)); 63 int match2d PROTO((int, char **)); 63 64 int mkrgb PROTO((int, char **)); 64 65 int mcreate PROTO((int, char **)); … … 201 202 {1, "iminterp", minterp, "interpolate image pixels"}, 202 203 {1, "matrix", matrix, "matrix math operations"}, 204 {1, "match2d", match2d, "match 2 pairs of X,Y vectors and return matched indexes"}, 203 205 {1, "mkrgb", mkrgb, "convert 3 images to rgb jpeg (use Kapa for better control)"}, 204 206 {1, "mset", mset, "insert a vector in an image"},
Note:
See TracChangeset
for help on using the changeset viewer.
