IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 19, 2019, 5:31:16 PM (7 years ago)
Author:
eugene
Message:

avoid NANs in peak detection; do not allow splines with < 3 pts; add vgauss -apply option

File:
1 edited

Legend:

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

    r40813 r40836  
    2828  if (xvec->Nelements != yvec->Nelements) {
    2929    gprint (GP_ERR, "x and y vectors must be the same length\n");
     30    return FALSE;
     31  }
     32
     33  if (xvec->Nelements < 3) {
     34    gprint (GP_ERR, "cannot make a spline with fewer than 3 knots\n");
    3035    return FALSE;
    3136  }
     
    132137
    133138  int N, status;
    134   Spline *spline;
    135139
    136140  int QUIET = FALSE;
     
    145149  }
    146150
    147   spline = FindSpline (argv[1]);
     151  Spline *spline = FindSpline (argv[1]);
    148152  if (spline == NULL) {
    149153    if (QUIET) return TRUE;
     
    159163int spline_rename (int argc, char **argv) {
    160164
    161   Spline *spline;
    162 
    163165  if (argc != 3) {
    164166    gprint (GP_ERR, "USAGE: spline rename (spline) (newname)\n");
     
    166168  }
    167169
    168   spline = FindSpline (argv[1]);
     170  Spline *spline = FindSpline (argv[1]);
    169171  if (spline == NULL) {
    170172    gprint (GP_ERR, "spline %s not found\n", argv[1]);
    171173    return FALSE;
     174  }
     175
     176  Spline *newname = FindSpline (argv[2]);
     177  if (newname != NULL) {
     178    DeleteSpline (newname);
    172179  }
    173180
     
    176183  return TRUE;
    177184}
    178 
    179 /*
    180 int spline_listspline (int argc, char **argv) {
    181 
    182   Spline *spline;
    183 
    184   if (argc != 2) {
    185     gprint (GP_ERR, "USAGE: spline listspline (spline)\n");
    186     return FALSE;
    187   }
    188 
    189   spline = FindSpline (argv[1]);
    190   if (spline == NULL) {
    191     gprint (GP_ERR, "spline %s not found\n", argv[1]);
    192     return FALSE;
    193   }
    194 
    195   ListPages (spline);
    196   return TRUE;
    197 }
    198 */
    199 
Note: See TracChangeset for help on using the changeset viewer.