Changeset 36489
- Timestamp:
- Feb 6, 2014, 12:43:34 PM (12 years ago)
- Location:
- trunk/Ohana/src/opihi
- Files:
-
- 17 edited
- 3 copied
-
. (modified) (1 prop)
-
cmd.astro (modified) (1 prop)
-
cmd.astro/Makefile (modified) (1 diff)
-
cmd.astro/cdensify.c (copied) (copied from branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.astro/cdensify.c )
-
cmd.astro/fitplx.c (modified) (1 diff)
-
cmd.astro/fitpm.c (copied) (copied from branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.astro/fitpm.c )
-
cmd.astro/init.c (modified) (2 diffs)
-
cmd.astro/region.c (modified) (1 diff)
-
cmd.data (modified) (1 prop)
-
cmd.data/Makefile (modified) (1 diff)
-
cmd.data/cast.c (copied) (copied from branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.data/cast.c )
-
cmd.data/densify.c (modified) (5 diffs)
-
cmd.data/init.c (modified) (2 diffs)
-
cmd.data/vgauss.c (modified) (2 diffs)
-
dvo/find_matches.c (modified) (1 diff)
-
dvo/gimages.c (modified) (1 diff)
-
dvo/showtile.c (modified) (1 diff)
-
dvo/simage.c (modified) (1 diff)
-
lib.shell/convert_to_RPN.c (modified) (1 diff)
-
lib.shell/stack_math.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20131211/Ohana/src/opihi (added) merged: 36387,36398-36399,36449,36469,36480
- Property svn:mergeinfo changed
-
trunk/Ohana/src/opihi/cmd.astro
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.astro (added) merged: 36387,36398,36449,36480
- Property svn:mergeinfo changed
-
trunk/Ohana/src/opihi/cmd.astro/Makefile
r36084 r36489 28 28 $(SRC)/cval.$(ARCH).o \ 29 29 $(SRC)/czplot.$(ARCH).o \ 30 $(SRC)/cdensify.$(ARCH).o \ 30 31 $(SRC)/drizzle.$(ARCH).o \ 31 32 $(SRC)/flux.$(ARCH).o \ 32 33 $(SRC)/fitplx.$(ARCH).o \ 34 $(SRC)/fitpm.$(ARCH).o \ 33 35 $(SRC)/fixwrap.$(ARCH).o \ 34 36 $(SRC)/fixcols.$(ARCH).o \ -
trunk/Ohana/src/opihi/cmd.astro/fitplx.c
r36375 r36489 112 112 coords.pc1_2 = coords.pc2_1 = 0.0; 113 113 coords.Npolyterms = 1; 114 strcpy (coords.ctype, " RA---SIN");114 strcpy (coords.ctype, "DEC--SIN"); 115 115 116 116 double *X, *Y, *t, *pX, *pY, *dX, *dY; -
trunk/Ohana/src/opihi/cmd.astro/init.c
r36084 r36489 13 13 int czplot PROTO((int, char **)); 14 14 int czcplot PROTO((int, char **)); 15 int cdensify PROTO((int, char **)); 15 16 int drizzle PROTO((int, char **)); 16 17 int flux PROTO((int, char **)); 17 18 int fitplx PROTO((int, char **)); 19 int fitpm PROTO((int, char **)); 18 20 int fixwrap PROTO((int, char **)); 19 21 int fiximage PROTO((int, char **)); … … 73 75 {1, "czplot", czplot, "plot scaled vectors in sky coordinates"}, 74 76 {1, "czcplot", czcplot, "plot color-scaled vectors in sky coordinates"}, 77 {1, "cdensify", cdensify, "vectors to density history on projection"}, 75 78 {1, "drizzle", drizzle, "transform image to image"}, 76 79 {1, "flux", flux, "flux in a convex contour"}, 77 80 {1, "fitplx", fitplx, "fit proper motion and parallax"}, 81 {1, "fitpm", fitpm, "fit proper motion only"}, 78 82 {1, "fixwrap", fixwrap, "fix megacam over-wrapped pixels"}, 79 83 {1, "fiximage", fiximage, "fix pixels in an image by interpolation"}, -
trunk/Ohana/src/opihi/cmd.astro/region.c
r31160 r36489 80 80 if (!ohana_str_to_radec (&Ra, &Dec, argv[1], argv[2])) return (FALSE); 81 81 Radius = atof (argv[3]); 82 strcpy (graphmode.coords.ctype, " RA---TAN");82 strcpy (graphmode.coords.ctype, "DEC--TAN"); 83 83 if (argc == 5) { 84 84 if (!strcasecmp (argv[4], "TAN")) 85 strcpy (graphmode.coords.ctype, " RA---TAN");85 strcpy (graphmode.coords.ctype, "DEC--TAN"); 86 86 if (!strcasecmp (argv[4], "SIN")) 87 strcpy (graphmode.coords.ctype, " RA---SIN");87 strcpy (graphmode.coords.ctype, "DEC--SIN"); 88 88 if (!strcasecmp (argv[4], "ARC")) 89 strcpy (graphmode.coords.ctype, " RA---ARC");89 strcpy (graphmode.coords.ctype, "DEC--ARC"); 90 90 if (!strcasecmp (argv[4], "STG")) 91 strcpy (graphmode.coords.ctype, " RA---STG");91 strcpy (graphmode.coords.ctype, "DEC--STG"); 92 92 if (!strcasecmp (argv[4], "ZEA")) 93 strcpy (graphmode.coords.ctype, " RA---ZEA");93 strcpy (graphmode.coords.ctype, "DEC--ZEA"); 94 94 if (!strcasecmp (argv[4], "AIT")) 95 strcpy (graphmode.coords.ctype, " RA---AIT");95 strcpy (graphmode.coords.ctype, "DEC--AIT"); 96 96 if (!strcasecmp (argv[4], "GLS")) 97 strcpy (graphmode.coords.ctype, " RA---GLS");97 strcpy (graphmode.coords.ctype, "DEC--GLS"); 98 98 if (!strcasecmp (argv[4], "PAR")) 99 strcpy (graphmode.coords.ctype, " RA---PAR");99 strcpy (graphmode.coords.ctype, "DEC--PAR"); 100 100 } 101 101 -
trunk/Ohana/src/opihi/cmd.data
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.data (added) merged: 36387,36399,36469,36480
- Property svn:mergeinfo changed
-
trunk/Ohana/src/opihi/cmd.data/Makefile
r36375 r36489 25 25 $(SRC)/book.$(ARCH).o \ 26 26 $(SRC)/book_commands.$(ARCH).o \ 27 $(SRC)/cast.$(ARCH).o \ 27 28 $(SRC)/center.$(ARCH).o \ 28 29 $(SRC)/clear.$(ARCH).o \ -
trunk/Ohana/src/opihi/cmd.data/densify.c
r34088 r36489 2 2 3 3 # define CHECKVAL(ARG) if (!isfinite(ARG)) { gprint (GP_ERR, "illegal value for %s: %f\n", #ARG, ARG); return (FALSE); } 4 enum {IS_DOT, IS_SQUARE, IS_CIRCLE, IS_GAUSS}; 4 5 5 6 int densify (int argc, char **argv) { 6 7 7 int i, Nx, Ny, Xb, Yb, N, Xpix, Ypix, good, UseGraph;8 int i, Nx, Ny, Xb, Yb, ix, iy, N, Xpix, Ypix, good, UseGraph; 8 9 double Xmin, Xmax, dX, Ymin, Ymax, dY; 9 10 float *val; … … 24 25 } 25 26 27 float scale = 0.0; 28 if ((N = get_argument (argc, argv, "-scale"))) { 29 remove_argument (N, &argc, argv); 30 scale = atof(argv[N]); 31 remove_argument (N, &argc, argv); 32 } 33 34 int PSFTYPE = IS_DOT; 35 if ((N = get_argument (argc, argv, "-psf"))) { 36 remove_argument (N, &argc, argv); 37 if (!strcasecmp(argv[N], "dot")) PSFTYPE = IS_DOT; 38 if (!strcasecmp(argv[N], "square")) PSFTYPE = IS_SQUARE; 39 if (!strcasecmp(argv[N], "circle")) PSFTYPE = IS_CIRCLE; 40 if (!strcasecmp(argv[N], "gauss")) PSFTYPE = IS_GAUSS; 41 remove_argument (N, &argc, argv); 42 } 43 26 44 good = UseGraph ? (argc == 4) : (argc == 10); 27 45 if (!good) { 28 46 gprint (GP_ERR, "USAGE: densify buffer x y Xmin Xmax dX Ymin Ymax dY\n"); 29 47 gprint (GP_ERR, " OR: densify buffer x y -graph\n"); 48 gprint (GP_ERR, " option: -psf [dot] (circle) (square) (gauss)\n"); 30 49 return (FALSE); 31 50 } … … 69 88 CHECKVAL(dY); 70 89 90 float scaleX = (scale > 0.0) ? scale / dX : 3.0; 91 float scaleY = (scale > 0.0) ? scale / dY : 3.0; 92 71 93 Nx = (Xmax - Xmin) / dX + 1; 72 94 Ny = (Ymax - Ymin) / dY + 1; … … 76 98 CreateBuffer (bf, Nx, Ny, -32, 0.0, 1.0); 77 99 strcpy (bf[0].file, "(empty)"); 100 101 float scale2 = (scaleX + 1.0) * (scaleY + 1.0); 102 float fSquare = 1.0 / scale2; 103 float fCircle = 1.0 / (3.141592 * scale2); 104 float fSigma = 0.5 / scale2; 105 float fGauss = 1.0 / (2.0 * 3.141592 * scale2); 78 106 79 107 x = vx[0].elements.Flt; … … 83 111 Xb = (*x - Xmin) / dX; 84 112 Yb = (*y - Ymin) / dY; 85 if (Xb >= Nx) continue; 86 if (Yb >= Ny) continue; 87 if (Xb < 0) continue; 88 if (Yb < 0) continue; 89 val[Xb + Yb*Nx] ++; 113 switch (PSFTYPE) { 114 case IS_DOT: 115 if (Xb >= Nx) continue; 116 if (Yb >= Ny) continue; 117 if (Xb < 0) continue; 118 if (Yb < 0) continue; 119 val[Xb + Yb*Nx] ++; 120 break; 121 case IS_SQUARE: 122 for (ix = Xb - scaleX; ix <= Xb + scaleX; ix++) { 123 for (iy = Yb - scaleY; iy <= Yb + scaleY; iy++) { 124 if (ix >= Nx) continue; 125 if (iy >= Ny) continue; 126 if (ix < 0) continue; 127 if (iy < 0) continue; 128 val[ix + iy*Nx] += fSquare; 129 } 130 } 131 break; 132 case IS_CIRCLE: 133 for (ix = Xb - scaleX; ix <= Xb + scaleX; ix++) { 134 float dX = ix - Xb; 135 for (iy = Yb - scaleY; iy <= Yb + scaleY; iy++) { 136 float dY = iy - Yb; 137 float r2 = dX*dX + dY*dY; 138 if (r2 > 9) continue; 139 if (ix >= Nx) continue; 140 if (iy >= Ny) continue; 141 if (ix < 0) continue; 142 if (iy < 0) continue; 143 val[ix + iy*Nx] += fCircle; 144 } 145 } 146 break; 147 case IS_GAUSS: 148 for (ix = Xb - scaleX; ix <= Xb + scaleX; ix++) { 149 float dX = ix - Xb; 150 for (iy = Yb - scaleY; iy <= Yb + scaleY; iy++) { 151 float dY = iy - Yb; 152 float r2 = dX*dX + dY*dY; 153 if (ix >= Nx) continue; 154 if (iy >= Ny) continue; 155 if (ix < 0) continue; 156 if (iy < 0) continue; 157 val[ix + iy*Nx] += fGauss*exp(-fSigma*r2); 158 } 159 } 160 break; 161 } 90 162 } 91 163 return (TRUE); -
trunk/Ohana/src/opihi/cmd.data/init.c
r36375 r36489 10 10 int center PROTO((int, char **)); 11 11 int parity PROTO((int, char **)); 12 int cast PROTO((int, char **)); 12 13 int circstats PROTO((int, char **)); 13 14 int clear PROTO((int, char **)); … … 164 165 {1, "buffers", list_buffers, "list the currently allocated buffers (images)"}, 165 166 {1, "center", center, "center image on coords"}, 167 {1, "cast", cast, "cast input vector to specified type"}, 166 168 {1, "circstats", circstats, "circular statistics"}, 167 169 {1, "clear", clear, "erase plot"}, -
trunk/Ohana/src/opihi/cmd.data/vgauss.c
r35109 r36489 48 48 if ((ovec = SelectVector (argv[4], ANYVECTOR, TRUE)) == NULL) return (FALSE); 49 49 50 CastVector (xvec, OPIHI_FLT); 51 CastVector (yvec, OPIHI_FLT); 52 50 53 int Nsvec = strlen(argv[3]); 51 54 … … 69 72 } 70 73 71 CastVector (xvec, OPIHI_FLT);72 CastVector (yvec, OPIHI_FLT);73 74 CastVector (svec, OPIHI_FLT); 74 75 // XXX Cast is failing. -
trunk/Ohana/src/opihi/dvo/find_matches.c
r29759 r36489 50 50 tcoords.pc1_2 = tcoords.pc2_1 = 0.0; 51 51 tcoords.Npolyterms = 1; 52 strcpy (tcoords.ctype, " RA---ARC");52 strcpy (tcoords.ctype, "DEC--ARC"); 53 53 54 54 // this region includes a boundary layer of size RADIUS -
trunk/Ohana/src/opihi/dvo/gimages.c
r34844 r36489 136 136 local.pc2_1 = local.pc1_2 = 0.0; 137 137 local.Npolyterms = 1; 138 strcpy (local.ctype, " RA---TAN");138 strcpy (local.ctype, "DEC--TAN"); 139 139 140 140 if (typehash == DistortImage) { -
trunk/Ohana/src/opihi/dvo/showtile.c
r34584 r36489 34 34 coords.pc1_2 = coords.pc2_1 = 0.0; 35 35 coords.Npolyterms = 0; 36 strcpy (coords.ctype, " RA---TAN");36 strcpy (coords.ctype, "DEC--TAN"); 37 37 38 38 /* fill in top-left region */ -
trunk/Ohana/src/opihi/dvo/simage.c
r34584 r36489 43 43 /* get astrometry information */ 44 44 strcpy (coords.ctype, "NONE"); 45 gfits_scan (&header, "CTYPE 1", "%s", 1, coords.ctype);46 if (strcmp (coords.ctype, " RA---PLY")) {45 gfits_scan (&header, "CTYPE2", "%s", 1, coords.ctype); 46 if (strcmp (coords.ctype, "DEC--PLY")) { 47 47 gprint (GP_ERR, "ERROR: wrong astrometric info in header\n"); 48 48 return (FALSE); -
trunk/Ohana/src/opihi/lib.shell/convert_to_RPN.c
r36375 r36489 30 30 if (!strcmp (argv[i], "abs")) { type = ST_UNARY; goto gotit; } 31 31 if (!strcmp (argv[i], "int")) { type = ST_UNARY; goto gotit; } 32 if (!strcmp (argv[i], "floor")) { type = ST_UNARY; goto gotit; } 33 if (!strcmp (argv[i], "round")) { type = ST_UNARY; goto gotit; } 34 if (!strcmp (argv[i], "ceil")) { type = ST_UNARY; goto gotit; } 35 if (!strcmp (argv[i], "rint")) { type = ST_UNARY; goto gotit; } 32 36 if (!strcmp (argv[i], "exp")) { type = ST_UNARY; goto gotit; } 33 37 if (!strcmp (argv[i], "ten")) { type = ST_UNARY; goto gotit; } -
trunk/Ohana/src/opihi/lib.shell/stack_math.c
r36375 r36489 1123 1123 if (!strcmp (op, "abs")) S_FUNC(fabs(M1), ST_SCALAR_INT); 1124 1124 if (!strcmp (op, "int")) S_FUNC((long long)(M1), ST_SCALAR_INT); 1125 if (!strcmp (op, "floor")) S_FUNC(floor (M1), ST_SCALAR_FLT); 1126 if (!strcmp (op, "ceil")) S_FUNC(ceil (M1), ST_SCALAR_FLT); 1127 if (!strcmp (op, "rint")) S_FUNC(nearbyint (M1), ST_SCALAR_FLT); 1125 1128 if (!strcmp (op, "exp")) S_FUNC(exp (M1), ST_SCALAR_FLT); 1126 1129 if (!strcmp (op, "ten")) S_FUNC(pow (10.0,M1), ST_SCALAR_FLT); … … 1202 1205 if (!strcmp (op, "abs")) V_FUNC(fabs(*M1), ST_SCALAR_INT); 1203 1206 if (!strcmp (op, "int")) V_FUNC((long long)(*M1), ST_SCALAR_INT); 1207 if (!strcmp (op, "floor")) V_FUNC(floor (*M1), ST_SCALAR_FLT); 1208 if (!strcmp (op, "ceil")) V_FUNC(ceil (*M1), ST_SCALAR_FLT); 1209 if (!strcmp (op, "rint")) V_FUNC(nearbyint (*M1), ST_SCALAR_FLT); 1204 1210 if (!strcmp (op, "exp")) V_FUNC(exp(*M1), ST_SCALAR_FLT); 1205 1211 if (!strcmp (op, "ten")) V_FUNC(pow(10.0,*M1), ST_SCALAR_FLT); … … 1273 1279 if (!strcmp (op, "abs")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = fabs(*M1); }} 1274 1280 if (!strcmp (op, "int")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = (opihi_flt)(long long)(*M1); }} 1281 1282 if (!strcmp (op, "floor")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = floor (*M1); }} 1283 if (!strcmp (op, "ceil")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = ceil (*M1); }} 1284 if (!strcmp (op, "rint")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = nearbyint (*M1); }} 1285 1275 1286 if (!strcmp (op, "exp")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = exp(*M1); }} 1276 1287 if (!strcmp (op, "ten")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = pow(10.0,*M1); }}
Note:
See TracChangeset
for help on using the changeset viewer.
