Changeset 29816
- Timestamp:
- Nov 24, 2010, 12:01:46 PM (15 years ago)
- Location:
- branches/eam_branches/ipp-20101103/Ohana/src/opihi
- Files:
-
- 1 added
- 6 edited
-
cmd.astro/region.c (modified) (1 diff)
-
cmd.data/Makefile (modified) (1 diff)
-
cmd.data/densify.c (added)
-
cmd.data/init.c (modified) (2 diffs)
-
cmd.data/resize.c (modified) (1 diff)
-
cmd.data/section.c (modified) (4 diffs)
-
lib.data/starfuncs.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20101103/Ohana/src/opihi/cmd.astro/region.c
r27435 r29816 55 55 if ((argc != 4) && (argc != 5)) { 56 56 gprint (GP_ERR, "USAGE: region Ra Dec Radius [projection] [orientation]\n"); 57 gprint (GP_ERR, " [-image] [-ew] [+ew] [-ns] [+ns] [-no-clear]\n"); 57 58 gprint (GP_ERR, " current: %f %f (%f x %f) (%s)\n", 58 59 graphmode.coords.crval1, graphmode.coords.crval2, -
branches/eam_branches/ipp-20101103/Ohana/src/opihi/cmd.data/Makefile
r29540 r29816 36 36 $(SRC)/cut.$(ARCH).o \ 37 37 $(SRC)/delete.$(ARCH).o \ 38 $(SRC)/densify.$(ARCH).o \ 38 39 $(SRC)/device.$(ARCH).o \ 39 40 $(SRC)/dimendown.$(ARCH).o \ -
branches/eam_branches/ipp-20101103/Ohana/src/opihi/cmd.data/init.c
r29540 r29816 25 25 int dbselect PROTO((int, char **)); 26 26 int delete PROTO((int, char **)); 27 int densify PROTO((int, char **)); 27 28 int device PROTO((int, char **)); 28 29 int dimendown PROTO((int, char **)); … … 161 162 {1, "dbselect", dbselect, "extract vectors from mysql database table"}, 162 163 {1, "delete", delete, "delete vectors or images"}, 164 {1, "densify", densify, "create an image histogram from a set of vectors"}, 163 165 {1, "device", device, "set / get current graphics device"}, 164 166 {1, "dimendown", dimendown, "convert image to vector"}, -
branches/eam_branches/ipp-20101103/Ohana/src/opihi/cmd.data/resize.c
r13479 r29816 17 17 if (!GetImage (NULL, &kapa, name)) return (FALSE); 18 18 FREE (name); 19 20 if ((N = get_argument (argc, argv, "-by-image"))) { 21 remove_argument (N, &argc, argv); 22 KiiResizeByImage (kapa); 23 return (TRUE); 24 } 19 25 20 26 if (argc != 3) { -
branches/eam_branches/ipp-20101103/Ohana/src/opihi/cmd.data/section.c
r27790 r29816 1 1 # include "data.h" 2 2 3 enum {NONE, LIST, UP, DOWN, TOP, BOTTOM, TOOL, BG };3 enum {NONE, LIST, UP, DOWN, TOP, BOTTOM, TOOL, BG, IMAGE}; 4 4 5 5 int section (int argc, char **argv) { … … 49 49 remove_argument (N, &argc, argv); 50 50 action = BG; 51 } 52 53 if ((N = get_argument (argc, argv, "-image"))) { 54 remove_argument (N, &argc, argv); 55 action = IMAGE; 51 56 } 52 57 … … 130 135 } 131 136 137 if (argc == 4) { 138 /* set section */ 139 section.name = argv[1]; 140 section.x = atof (argv[2]); 141 section.y = atof (argv[3]); 142 section.bg = background; 143 KapaSetSectionByImage (kapa, §ion); 144 return (TRUE); 145 } 146 132 147 if (argc == 6) { 133 148 /* set section */ … … 142 157 } 143 158 gprint (GP_ERR, "USAGE: section name [x y dx dy]\n"); 159 gprint (GP_ERR, "USAGE: section name [-image x y] : width based on current image\n"); 144 160 gprint (GP_ERR, "USAGE: section name [-list] [-up] [-down] [-top] [-bottom]\n"); 145 161 return (FALSE); -
branches/eam_branches/ipp-20101103/Ohana/src/opihi/lib.data/starfuncs.c
r20936 r29816 5 5 double *ring; 6 6 double x, y, x2, y2, xy, I, sky, FWHMx, FWHMy, value, mag, Sxy; 7 int i, j, n, Npix2, Nring, Nmax;7 int i, j, n, Radius, Nring, Nmax; 8 8 double Npts, gain, dsky2, dmag, peak, offset; 9 9 char *string; … … 19 19 Nborder = MIN (1000, Nborder); 20 20 21 Npix2= (int)(0.5*Npix);22 Npix = 2 * Npix2+ 1;21 Radius = (int)(0.5*Npix); 22 Npix = 2 * Radius + 1; 23 23 Nring = 4*Nborder*(Nborder + Npix); 24 24 ALLOCATE (ring, double, Nring); … … 27 27 n = 0; 28 28 for (j = 0; j < Nborder; j++) { 29 for (i = X - Npix2 - Nborder; i < X + Npix2+ Nborder + 1; i++, n+=2) {30 ring[n] = gfits_get_matrix_value (matrix, i, (int)(Y - Npix2- j));31 ring[n+1] = gfits_get_matrix_value (matrix, i, (int)(Y + Npix2+ j));32 } 33 for (i = Y - Npix2; i < Y + Npix2+ 1; i++, n+=2) {34 ring[n] = gfits_get_matrix_value (matrix, (int)(X - Npix2- j), i);35 ring[n+1] = gfits_get_matrix_value (matrix, (int)(X + Npix2+ j), i);29 for (i = X - Radius - Nborder; i < X + Radius + Nborder + 1; i++, n+=2) { 30 ring[n] = gfits_get_matrix_value (matrix, i, (int)(Y - Radius - j)); 31 ring[n+1] = gfits_get_matrix_value (matrix, i, (int)(Y + Radius + j)); 32 } 33 for (i = Y - Radius; i < Y + Radius + 1; i++, n+=2) { 34 ring[n] = gfits_get_matrix_value (matrix, (int)(X - Radius - j), i); 35 ring[n+1] = gfits_get_matrix_value (matrix, (int)(X + Radius + j), i); 36 36 } 37 37 } … … 50 50 Npts = Nmax = 0; 51 51 x = y = x2 = y2 = xy = I = 0; 52 for (i = X - Npix2; i < X + Npix2 + 1; i++) { 53 for (j = Y - Npix2; j < Y + Npix2 + 1; j++) { 52 for (i = X - Radius; i < X + Radius + 1; i++) { 53 for (j = Y - Radius; j < Y + Radius + 1; j++) { 54 if (hypot((i-X), (j-Y)) > Radius) continue; 54 55 value = gfits_get_matrix_value (matrix, i, j); 55 56 offset = value - sky; … … 92 93 set_variable ("Zpk", peak); 93 94 set_int_variable ("Nsat", Nmax); 95 set_int_variable ("Npts", Npts); 94 96 95 97 gprint (GP_LOG, "%f %f %f %f %f %f %f %f\n", x, y, FWHMx, FWHMy, sky, I, mag, dmag);
Note:
See TracChangeset
for help on using the changeset viewer.
