- Timestamp:
- Jul 17, 2014, 12:32:26 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-ops-20130712/Ohana
- Files:
-
- 9 edited
- 3 copied
-
. (modified) (1 prop)
-
src/opihi (modified) (1 prop)
-
src/opihi/cmd.astro (modified) (1 prop)
-
src/opihi/cmd.astro/Makefile (modified) (2 diffs)
-
src/opihi/cmd.astro/cdensify.c (copied) (copied from trunk/Ohana/src/opihi/cmd.astro/cdensify.c )
-
src/opihi/cmd.astro/fitplx.c (modified) (6 diffs)
-
src/opihi/cmd.astro/fitpm.c (copied) (copied from trunk/Ohana/src/opihi/cmd.astro/fitpm.c )
-
src/opihi/cmd.astro/gauss.c (modified) (3 diffs)
-
src/opihi/cmd.astro/init.c (modified) (4 diffs)
-
src/opihi/cmd.astro/region.c (modified) (1 diff)
-
src/opihi/cmd.astro/sersic.c (copied) (copied from trunk/Ohana/src/opihi/cmd.astro/sersic.c )
-
src/opihi/cmd.astro/star.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-ops-20130712/Ohana
- Property svn:mergeinfo deleted
-
branches/eam_branches/ipp-ops-20130712/Ohana/src/opihi
- Property svn:mergeinfo deleted
-
branches/eam_branches/ipp-ops-20130712/Ohana/src/opihi/cmd.astro
- Property svn:mergeinfo deleted
-
branches/eam_branches/ipp-ops-20130712/Ohana/src/opihi/cmd.astro/Makefile
r35416 r37067 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 \ … … 60 62 $(SRC)/scale.$(ARCH).o \ 61 63 $(SRC)/sexigesimal.$(ARCH).o \ 64 $(SRC)/sersic.$(ARCH).o \ 62 65 $(SRC)/spec.$(ARCH).o \ 63 66 $(SRC)/specpairfit.$(ARCH).o \ -
branches/eam_branches/ipp-ops-20130712/Ohana/src/opihi/cmd.astro/fitplx.c
r35416 r37067 41 41 remove_argument (N, &argc, argv); 42 42 VERBOSE = TRUE; 43 } 44 if ((N = get_argument (argc, argv, "-vv"))) { 45 remove_argument (N, &argc, argv); 46 VERBOSE = 2; 43 47 } 44 48 … … 108 112 coords.pc1_2 = coords.pc2_1 = 0.0; 109 113 coords.Npolyterms = 1; 110 strcpy (coords.ctype, " RA---SIN");114 strcpy (coords.ctype, "DEC--SIN"); 111 115 112 116 double *X, *Y, *t, *pX, *pY, *dX, *dY; … … 145 149 146 150 PlxFit fit; 147 FitPMandPar (&fit, X, dX, Y, dY, t, pX, pY, n, VERBOSE); 151 if (!FitPMandPar (&fit, X, dX, Y, dY, t, pX, pY, n, VERBOSE)) { 152 return FALSE; 153 } 148 154 149 155 // fprintf (stderr, "Roff, Doff: %f, %f; dRo, dDo: %f, %f\n", fit.Ro, fit.Do, fit.dRo, fit.dDo); … … 204 210 for (i = 0; i < Npts; i++) { 205 211 206 if (VERBOSE ) fprintf (stderr, "%f %f : %f %f : %f : %f %f\n", X[i], dX[i], Y[i], dY[i], T[i], pR[i], pD[i]);212 if (VERBOSE == 2) fprintf (stderr, "%f %f : %f %f : %f : %f %f\n", X[i], dX[i], Y[i], dY[i], T[i], pR[i], pD[i]); 207 213 208 214 /* handle case where dX or dY = 0.0 */ 209 wx = 1.0 / SQ(dX[i]);210 wy = 1.0 / SQ(dY[i]);215 wx = (fabs(dX[i]) < 0.0001) ? 1.0 : 1.0 / SQ(dX[i]); 216 wy = (fabs(dY[i]) < 0.0001) ? 1.0 : 1.0 / SQ(dY[i]); 211 217 212 218 Wx += wx; … … 266 272 B[4][0] = PRX + PDY; 267 273 268 dgaussjordan ((double **)A, (double **)B, 5, 1); 274 if (!dgaussjordan ((double **)A, (double **)B, 5, 1)) { 275 if (VERBOSE) fprintf (stderr, "error in fit\n"); 276 if (VERBOSE == 2) { 277 int j; 278 for (i = 0; i < 5; i++) { 279 for (j = 0; j < 5; j++) { 280 fprintf (stderr, "%e ", A[i][j]); 281 } 282 fprintf (stderr, " : %e\n", A[i][0]); 283 } 284 } 285 return FALSE; 286 } 269 287 270 288 fit[0].Ro = B[0][0]; … … 285 303 Xf = fit[0].Ro + fit[0].uR*T[i] + fit[0].p*pR[i]; 286 304 Yf = fit[0].Do + fit[0].uD*T[i] + fit[0].p*pD[i]; 287 chisq += SQ(X[i] - Xf) / SQ(dX[i]); 288 chisq += SQ(Y[i] - Yf) / SQ(dY[i]); 289 if (VERBOSE) fprintf (stderr, "chisq contrib : %f %f : %f %f : %f %f : %f %f : %f\n", Xf, Yf, X[i] - Xf, Y[i] - Yf, dX[i], dY[i], (X[i] - Xf) / dX[i], (Y[i] - Yf) / dY[i], chisq); 305 wx = (fabs(dX[i]) < 0.0001) ? 1.0 : 1.0 / SQ(dX[i]); 306 wy = (fabs(dY[i]) < 0.0001) ? 1.0 : 1.0 / SQ(dY[i]); 307 chisq += SQ(X[i] - Xf) * wx; 308 chisq += SQ(Y[i] - Yf) * wy; 309 // if (VERBOSE) fprintf (stderr, "chisq contrib : %f %f : %f %f : %f %f : %f %f : %f\n", Xf, Yf, X[i] - Xf, Y[i] - Yf, dX[i], dY[i], (X[i] - Xf) / dX[i], (Y[i] - Yf) / dY[i], chisq); 290 310 } 291 311 fit[0].Nfit = Npts; -
branches/eam_branches/ipp-ops-20130712/Ohana/src/opihi/cmd.astro/gauss.c
r34088 r37067 10 10 Buffer *buf; 11 11 KapaImageData data; 12 int VERBOSE; 13 14 VERBOSE = TRUE; 15 if ((N = get_argument (argc, argv, "-q"))) { 16 VERBOSE = FALSE; 17 remove_argument (N, &argc, argv); 18 } 19 if ((N = get_argument (argc, argv, "-quiet"))) { 20 VERBOSE = FALSE; 21 remove_argument (N, &argc, argv); 22 } 12 23 13 24 name = NULL; … … 58 69 KiiCursorRead (kapa, &X, &Y, &ZP, &RA, &DEC, key); 59 70 if (!strcasecmp (key, "Q")) break; 60 get_aperture_stats (&buf[0].matrix, (int)(X+0.5), (int)(Y+0.5), Npix, Nborder, max );71 get_aperture_stats (&buf[0].matrix, (int)(X+0.5), (int)(Y+0.5), Npix, Nborder, max, VERBOSE); 61 72 } 62 73 KiiCursorOff (kapa); … … 64 75 } 65 76 77 -
branches/eam_branches/ipp-ops-20130712/Ohana/src/opihi/cmd.astro/init.c
r35757 r37067 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 **)); … … 49 51 int scale PROTO((int, char **)); 50 52 int sexigesimal PROTO((int, char **)); 53 int sersic PROTO((int, char **)); 51 54 int spec PROTO((int, char **)); 52 55 int specpairfit PROTO((int, char **)); … … 72 75 {1, "czplot", czplot, "plot scaled vectors in sky coordinates"}, 73 76 {1, "czcplot", czcplot, "plot color-scaled vectors in sky coordinates"}, 77 {1, "cdensify", cdensify, "vectors to density history on projection"}, 74 78 {1, "drizzle", drizzle, "transform image to image"}, 75 79 {1, "flux", flux, "flux in a convex contour"}, 76 80 {1, "fitplx", fitplx, "fit proper motion and parallax"}, 81 {1, "fitpm", fitpm, "fit proper motion only"}, 77 82 {1, "fixwrap", fixwrap, "fix megacam over-wrapped pixels"}, 78 83 {1, "fiximage", fiximage, "fix pixels in an image by interpolation"}, … … 107 112 {1, "scale", scale, "get / set real bzero / bscale values"}, 108 113 {1, "sexigesimal", sexigesimal, "convert to/from sexigesimal/decimal"}, 114 {1, "sersic", sersic, "generate sub-pixel resolved sersic model"}, 109 115 {1, "spec", spec, "extract a spectrum"}, 110 116 {1, "specpairfit", specpairfit, "fit spectrum to another spectrum"}, -
branches/eam_branches/ipp-ops-20130712/Ohana/src/opihi/cmd.astro/region.c
r31160 r37067 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 -
branches/eam_branches/ipp-ops-20130712/Ohana/src/opihi/cmd.astro/star.c
r34088 r37067 6 6 double max; 7 7 Buffer *buf; 8 int VERBOSE; 9 10 VERBOSE = TRUE; 11 if ((N = get_argument (argc, argv, "-q"))) { 12 VERBOSE = FALSE; 13 remove_argument (N, &argc, argv); 14 } 15 if ((N = get_argument (argc, argv, "-quiet"))) { 16 VERBOSE = FALSE; 17 remove_argument (N, &argc, argv); 18 } 8 19 9 20 Nborder = 3; … … 36 47 } 37 48 38 get_aperture_stats (&buf[0].matrix, x, y, dx, Nborder, max );49 get_aperture_stats (&buf[0].matrix, x, y, dx, Nborder, max, VERBOSE); 39 50 40 51 return (TRUE);
Note:
See TracChangeset
for help on using the changeset viewer.
