IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 41715


Ignore:
Timestamp:
Jul 13, 2021, 10:30:23 AM (5 years ago)
Author:
eugene
Message:

improve vector name consistency; remove rotate verbosity

Location:
trunk/Ohana/src/opihi
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.data/rotate.c

    r41341 r41715  
    9292    X1 = NY - Yo;
    9393    Y1 = Xo;
    94     gprint (GP_ERR, "%f %f -> %f %f\n", Xo, Yo, X1, Y1);
     94    // gprint (GP_ERR, "%f %f -> %f %f\n", Xo, Yo, X1, Y1);
    9595    gfits_modify (&buf[0].header, "CRPIX1", "%lf", 1, X1);
    9696    gfits_modify (&buf[0].header, "CRPIX2", "%lf", 1, Y1);
     
    105105    PC21 = pc11;
    106106    PC22 = pc12;
    107     gprint (GP_ERR, "%f %f  ->  %f %f\n", pc11, pc12, PC11, PC12);
    108     gprint (GP_ERR, "%f %f  ->  %f %f\n", pc21, pc22, PC21, PC22);
     107    // gprint (GP_ERR, "%f %f  ->  %f %f\n", pc11, pc12, PC11, PC12);
     108    // gprint (GP_ERR, "%f %f  ->  %f %f\n", pc21, pc22, PC21, PC22);
    109109    gfits_modify (&buf[0].header, "PC001001", "%le", 1, PC11);
    110110    gfits_modify (&buf[0].header, "PC001002", "%le", 1, PC12);
  • trunk/Ohana/src/opihi/include/shell.h

    r40656 r41715  
    77# define ESCAPE(MSG,...) { gprint (GP_ERR, MSG, __VA_ARGS__); return FALSE; }
    88
     9# define ISVEC(a) (isalnum (a) || (a == '.') || (a == '_'))
    910# define ISVAR(a) (isalnum (a) || (a == ':') || (a == '_'))
    1011# define ISREF(a) (isalnum (a) || (a == '_'))
  • trunk/Ohana/src/opihi/lib.data/mrq2dmin.c

    r20936 r41715  
    164164
    165165 
    166   lambda = 0.001;
     166//  lambda = 0.001;
     167  lambda = 1.0;
    167168 
    168169  ochisq = mrq2dcof (x, t, y, dy, Npts, par, Npar, alpha, beta, funcs);
  • trunk/Ohana/src/opihi/lib.shell/VectorOps.c

    r41341 r41715  
    6565}
    6666
     67int IsVectorNameValid (char *name) {
     68
     69  char *p = name;
     70
     71  while (*p) {
     72    int valid = OHANA_WHITESPACE(*p);
     73    valid = valid || ISVEC(*p);
     74    if (!valid) return FALSE;
     75    p++;
     76  }
     77  return TRUE;
     78}
     79
    6780int IsVectorPtr (Vector *vec) {
    6881 
     
    89102  if (i == Nvectors) {
    90103    if (mode == OLDVECTOR) goto error;
     104    // validate vector name syntax
     105    if (!IsVectorNameValid(name)) { gprint (GP_ERR, "invalid vector name %s\n", name); return NULL; }
    91106    pthread_mutex_lock (&mutex);
    92107    Nvectors ++;
  • trunk/Ohana/src/opihi/lib.shell/expand_vectors.c

    r41354 r41715  
    131131      p--;
    132132    }
    133     for (w = p - 1; (w >= line) && !OHANA_WHITESPACE(*w) && (isalnum(*w) || (*w == ':') || (*w == '_')); w--);
     133
     134    // Scan backwards for the start of the vector name.  ISVEC is defined in
     135    // include/shell.h.  A vector name cannot include a colon, while a variable name
     136    // cannot include a dot.
     137
     138    for (w = p - 1; (w >= line) && !OHANA_WHITESPACE(*w) && ISVEC(*w); w--);
    134139    w ++;
    135140    n = (int)(p - w);
Note: See TracChangeset for help on using the changeset viewer.