IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40752


Ignore:
Timestamp:
May 25, 2019, 8:59:46 AM (7 years ago)
Author:
eugene
Message:

add functions to fit a sigmoid to a vector and to match two vectors in 1D; allow vtransitions to be restricted to a value range

Location:
branches/eam_branches/ohana.20190329/src/opihi/cmd.data
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20190329/src/opihi/cmd.data/Makefile

    r40733 r40752  
    9090$(SRC)/lookup.$(ARCH).o \
    9191$(SRC)/matrix.$(ARCH).o \
     92$(SRC)/match1d.$(ARCH).o        \
    9293$(SRC)/match2d.$(ARCH).o        \
    9394$(SRC)/mkrgb.$(ARCH).o  \
     
    170171$(SRC)/vgauss.$(ARCH).o            \
    171172$(SRC)/vlorentz.$(ARCH).o          \
     173$(SRC)/vsigmoid.$(ARCH).o          \
    172174$(SRC)/vellipse.$(ARCH).o          \
    173175$(SRC)/vmaxwell.$(ARCH).o          \
  • branches/eam_branches/ohana.20190329/src/opihi/cmd.data/init.c

    r40733 r40752  
    8080int lookup           PROTO((int, char **));
    8181int matrix           PROTO((int, char **));
     82int match1d          PROTO((int, char **));
    8283int match2d          PROTO((int, char **));
    8384int mkrgb            PROTO((int, char **));
     
    157158int vgauss           PROTO((int, char **));
    158159int vlorentz         PROTO((int, char **));
     160int vsigmoid         PROTO((int, char **));
    159161int vellipse         PROTO((int, char **));
    160162int vmaxwell         PROTO((int, char **));
     
    279281  {1, "medimage",     medimage_command, "median image manipulation"},
    280282  {1, "matrix",       matrix,           "matrix math operations"},
     283  {1, "match1d",      match1d,          "match 2 vectors and return matched indexes"},
    281284  {1, "match2d",      match2d,          "match 2 pairs of X,Y vectors and return matched indexes"},
    282285  {1, "mkrgb",        mkrgb,            "convert 3 images to rgb jpeg (use Kapa for better control)"},
     
    353356  {1, "vgauss",       vgauss,           "fit a Gaussian to a vector"},
    354357  {1, "vlorentz",     vlorentz,         "fit a Lorentzian to a vector"},
     358  {1, "vsigmoid",     vsigmoid,         "fit a Sigmoid to a vector"},
    355359  {1, "vellipse",     vellipse,         "fit a Ellipse to a vector pair"},
    356360  {1, "vgrid",        vgrid,            "generate an image from a triplet of vectors"},
  • branches/eam_branches/ohana.20190329/src/opihi/cmd.data/threshold.c

    r40664 r40752  
    2525    remove_argument (N, &argc, argv);
    2626    BinMax = atoi (argv[N]);
     27    remove_argument (N, &argc, argv);
     28  }
     29
     30  float ValMin = NAN;
     31  float ValMax = NAN;
     32  if ((N = get_argument (argc, argv, "-vrange"))) {
     33    remove_argument (N, &argc, argv);
     34    ValMin = atof (argv[N]);
     35    remove_argument (N, &argc, argv);
     36    ValMax = atof (argv[N]);
    2737    remove_argument (N, &argc, argv);
    2838  }
     
    6272    }
    6373    if (BinMax < 0) BinMax += vecx[0].Nelements;
     74  }
     75
     76  // ValMin, ValMax not compatible with BinMin, BinMax
     77  if (isfinite(ValMin)) {
     78    int binTest = ohana_bisection_double (vecx[0].elements.Flt, vecx[0].Nelements, ValMin);
     79    BinMin = (vecx[0].elements.Flt[binTest+1] == ValMin) ? binTest : binTest + 1;
     80    // XXX dangerous: check that this does not run off the end, etc
     81  }
     82  if (isfinite(ValMax)) {
     83    int binTest = ohana_bisection_double (vecx[0].elements.Flt, vecx[0].Nelements, ValMax);
     84    BinMax = (vecx[0].elements.Flt[binTest+1] == ValMax) ? binTest : binTest + 1;
     85    // XXX dangerous: check that this does not run off the end, etc
    6486  }
    6587
  • branches/eam_branches/ohana.20190329/src/opihi/cmd.data/vtransitions.c

    r40665 r40752  
    137137  ResetVector (outpos, OPIHI_FLT,    Nout);
    138138
    139   if (!QUIET) gprint (GP_LOG, "found %d transitions)\n", Nout);
     139  if (!QUIET) gprint (GP_LOG, "found %d transitions\n", Nout);
    140140
    141141  return (TRUE);
Note: See TracChangeset for help on using the changeset viewer.