IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 17, 2014, 12:32:26 PM (12 years ago)
Author:
eugene
Message:

merge changes (from past YEAR) into trunk

Location:
branches/eam_branches/ipp-ops-20130712/Ohana
Files:
9 edited
3 copied

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  
    2828$(SRC)/cval.$(ARCH).o              \
    2929$(SRC)/czplot.$(ARCH).o    \
     30$(SRC)/cdensify.$(ARCH).o          \
    3031$(SRC)/drizzle.$(ARCH).o           \
    3132$(SRC)/flux.$(ARCH).o              \
    3233$(SRC)/fitplx.$(ARCH).o    \
     34$(SRC)/fitpm.$(ARCH).o     \
    3335$(SRC)/fixwrap.$(ARCH).o           \
    3436$(SRC)/fixcols.$(ARCH).o           \
     
    6062$(SRC)/scale.$(ARCH).o             \
    6163$(SRC)/sexigesimal.$(ARCH).o       \
     64$(SRC)/sersic.$(ARCH).o    \
    6265$(SRC)/spec.$(ARCH).o              \
    6366$(SRC)/specpairfit.$(ARCH).o       \
  • branches/eam_branches/ipp-ops-20130712/Ohana/src/opihi/cmd.astro/fitplx.c

    r35416 r37067  
    4141    remove_argument (N, &argc, argv);
    4242    VERBOSE = TRUE;
     43  }
     44  if ((N = get_argument (argc, argv, "-vv"))) {
     45    remove_argument (N, &argc, argv);
     46    VERBOSE = 2;
    4347  }
    4448
     
    108112  coords.pc1_2  = coords.pc2_1 = 0.0;
    109113  coords.Npolyterms = 1;
    110   strcpy (coords.ctype, "RA---SIN");
     114  strcpy (coords.ctype, "DEC--SIN");
    111115
    112116  double *X, *Y, *t, *pX, *pY, *dX, *dY;
     
    145149
    146150  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  }
    148154
    149155  // fprintf (stderr, "Roff, Doff: %f, %f; dRo, dDo: %f, %f\n", fit.Ro, fit.Do, fit.dRo, fit.dDo);
     
    204210  for (i = 0; i < Npts; i++) {
    205211
    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]);
    207213
    208214    /* 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]);
    211217
    212218    Wx += wx;
     
    266272  B[4][0] = PRX + PDY;
    267273
    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  }
    269287
    270288  fit[0].Ro = B[0][0];
     
    285303    Xf = fit[0].Ro + fit[0].uR*T[i] + fit[0].p*pR[i];
    286304    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);
    290310  }
    291311  fit[0].Nfit = Npts;
  • branches/eam_branches/ipp-ops-20130712/Ohana/src/opihi/cmd.astro/gauss.c

    r34088 r37067  
    1010  Buffer *buf;
    1111  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  }
    1223
    1324  name = NULL;
     
    5869    KiiCursorRead (kapa, &X, &Y, &ZP, &RA, &DEC, key);
    5970    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);
    6172  }
    6273  KiiCursorOff (kapa);
     
    6475}
    6576
     77
  • branches/eam_branches/ipp-ops-20130712/Ohana/src/opihi/cmd.astro/init.c

    r35757 r37067  
    1313int czplot                  PROTO((int, char **));
    1414int czcplot                 PROTO((int, char **));
     15int cdensify                PROTO((int, char **));
    1516int drizzle                 PROTO((int, char **));
    1617int flux                    PROTO((int, char **));
    1718int fitplx                  PROTO((int, char **));
     19int fitpm                   PROTO((int, char **));
    1820int fixwrap                 PROTO((int, char **));
    1921int fiximage                PROTO((int, char **));
     
    4951int scale                   PROTO((int, char **));
    5052int sexigesimal             PROTO((int, char **));
     53int sersic                  PROTO((int, char **));
    5154int spec                    PROTO((int, char **));
    5255int specpairfit             PROTO((int, char **));
     
    7275  {1, "czplot",      czplot,       "plot scaled vectors in sky coordinates"},
    7376  {1, "czcplot",     czcplot,      "plot color-scaled vectors in sky coordinates"},
     77  {1, "cdensify",    cdensify,      "vectors to density history on projection"},
    7478  {1, "drizzle",     drizzle,      "transform image to image"},
    7579  {1, "flux",        flux,         "flux in a convex contour"},
    7680  {1, "fitplx",      fitplx,       "fit proper motion and parallax"},
     81  {1, "fitpm",       fitpm,        "fit proper motion only"},
    7782  {1, "fixwrap",     fixwrap,      "fix megacam over-wrapped pixels"},
    7883  {1, "fiximage",    fiximage,     "fix pixels in an image by interpolation"},
     
    107112  {1, "scale",       scale,        "get / set real bzero / bscale values"},
    108113  {1, "sexigesimal", sexigesimal,  "convert to/from sexigesimal/decimal"},
     114  {1, "sersic",      sersic,       "generate sub-pixel resolved sersic model"},
    109115  {1, "spec",        spec,         "extract a spectrum"},
    110116  {1, "specpairfit", specpairfit,  "fit spectrum to another spectrum"},
  • branches/eam_branches/ipp-ops-20130712/Ohana/src/opihi/cmd.astro/region.c

    r31160 r37067  
    8080  if (!ohana_str_to_radec (&Ra, &Dec, argv[1], argv[2])) return (FALSE);
    8181  Radius = atof (argv[3]);
    82   strcpy (graphmode.coords.ctype, "RA---TAN");
     82  strcpy (graphmode.coords.ctype, "DEC--TAN");
    8383  if (argc == 5) {
    8484    if (!strcasecmp (argv[4], "TAN"))
    85       strcpy (graphmode.coords.ctype, "RA---TAN");
     85      strcpy (graphmode.coords.ctype, "DEC--TAN");
    8686    if (!strcasecmp (argv[4], "SIN"))
    87       strcpy (graphmode.coords.ctype, "RA---SIN");
     87      strcpy (graphmode.coords.ctype, "DEC--SIN");
    8888    if (!strcasecmp (argv[4], "ARC"))
    89       strcpy (graphmode.coords.ctype, "RA---ARC");
     89      strcpy (graphmode.coords.ctype, "DEC--ARC");
    9090    if (!strcasecmp (argv[4], "STG"))
    91       strcpy (graphmode.coords.ctype, "RA---STG");
     91      strcpy (graphmode.coords.ctype, "DEC--STG");
    9292    if (!strcasecmp (argv[4], "ZEA"))
    93       strcpy (graphmode.coords.ctype, "RA---ZEA");
     93      strcpy (graphmode.coords.ctype, "DEC--ZEA");
    9494    if (!strcasecmp (argv[4], "AIT"))
    95       strcpy (graphmode.coords.ctype, "RA---AIT");
     95      strcpy (graphmode.coords.ctype, "DEC--AIT");
    9696    if (!strcasecmp (argv[4], "GLS"))
    97       strcpy (graphmode.coords.ctype, "RA---GLS");
     97      strcpy (graphmode.coords.ctype, "DEC--GLS");
    9898    if (!strcasecmp (argv[4], "PAR"))
    99       strcpy (graphmode.coords.ctype, "RA---PAR");
     99      strcpy (graphmode.coords.ctype, "DEC--PAR");
    100100  }
    101101
  • branches/eam_branches/ipp-ops-20130712/Ohana/src/opihi/cmd.astro/star.c

    r34088 r37067  
    66  double max;
    77  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  }
    819
    920  Nborder = 3;
     
    3647  }
    3748
    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);
    3950 
    4051  return (TRUE);
Note: See TracChangeset for help on using the changeset viewer.