IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42685


Ignore:
Timestamp:
Jun 1, 2024, 3:19:28 PM (2 years ago)
Author:
eugene
Message:

add usage info; fix end-point error in vgroup

Location:
branches/eam_branches/ipp-20230313/Ohana/src/opihi/cmd.data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20230313/Ohana/src/opihi/cmd.data/interpolate_presort.c

    r41341 r42685  
    1717  /** check basic syntax **/
    1818  if (argc != 5) {
    19     gprint (GP_ERR, "USAGE: interpolate Xi Yi Xo Yo\n");
     19    gprint (GP_ERR, "USAGE: interpolate Xi Yi Xo Yo [-fill-ends]\n");
    2020    gprint (GP_ERR, "  Xi Yi - sorted reference vectors\n");
    2121    gprint (GP_ERR, "  Xo    - output positions (vector)\n");
     
    2323    gprint (GP_ERR, "  (vectors must be pre-sorted)\n");
    2424    gprint (GP_ERR, "  (use 'threshold' to interpolate to a value)\n");
     25    gprint (GP_ERR, "  -fill-ends : values outside of range are set to end-point values\n");
    2526    return (FALSE);
    2627  }
  • branches/eam_branches/ipp-20230313/Ohana/src/opihi/cmd.data/vgroup.c

    r33963 r42685  
    7070  ALLOCATE (values, double, xin[0].Nelements);
    7171
    72   for (i = 0; i < xout[0].Nelements - 1; i++) {
     72  // if we specify binsize, then we need to examine all bins
     73  int Nout = isnan(binsize) ? xout[0].Nelements - 1 : xout[0].Nelements;
     74  for (i = 0; i < Nout; i++) {
    7375    if (isnan(binsize)) {
    7476      xmin = xout[0].elements.Flt[i];
     
    8183    N = 0;
    8284    for (j = 0; j < xin[0].Nelements; j++) {
    83       if (xin[0].elements.Flt[j] < xmin) continue;
    84       if (xin[0].elements.Flt[j] > xmax) continue;
     85      if (xin[0].elements.Flt[j] <  xmin) continue;
     86      if (xin[0].elements.Flt[j] >= xmax) continue;
    8587      if (yin) {
    8688        values[N] = yin[0].elements.Flt[j];
Note: See TracChangeset for help on using the changeset viewer.