IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37227


Ignore:
Timestamp:
Aug 12, 2014, 1:06:30 PM (12 years ago)
Author:
eugene
Message:

removing crNsigma from Measure; adding WHERE option to cplot

Location:
branches/eam_branches/ipp-20140717/Ohana/src/opihi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140717/Ohana/src/opihi/cmd.astro/cplot.c

    r34613 r37227  
    44 
    55  double ra_prev = 0;
    6   int i, kapa, Npts, status, leftside;
     6  int i, kapa, Npts, status, leftside, valid, size;
    77  opihi_flt *x, *y, *r, *d, Rmin, Rmax, Rmid;
    88  Vector Xvec, Yvec, *xvec, *yvec;
     
    1111  if (!style_args (&graphmode, &argc, argv, &kapa)) return FALSE;
    1212
    13   if (argc != 3) {
     13  valid  = (argc == 3);
     14  valid |= (argc > 4) && !strcmp (argv[3], "where");
     15  if (!valid) {
    1416    gprint (GP_ERR, "USAGE: cplot <ra> <dec> [style]\n");
     17    gprint (GP_ERR, "   OR: cplot <ra> <dec> [style] where (condition)\n");
    1518    return (FALSE);
    1619  }
     
    3235  }
    3336
     37  // tvec is used for logical test (truth vector)
     38  Vector *tvec = NULL;
     39  if (argc > 4) {
     40    char *out = dvomath (argc - 4, &argv[4], &size, 1);
     41    if (out == NULL) {
     42      print_error ();
     43      return FALSE;
     44    }
     45    if ((tvec = SelectVector (out, OLDVECTOR, TRUE)) == NULL) {
     46      gprint (GP_ERR, " invalid logic result\n");
     47      DeleteNamedVector (out);
     48      free (out);
     49      return (FALSE);
     50    }
     51  }
     52
     53  if (tvec && tvec[0].Nelements != yvec[0].Nelements) {
     54    gprint (GP_ERR, "logic test vector not the same length as data vectors\n");
     55    DeleteVector (tvec);
     56    return (FALSE);
     57  }
     58
    3459  SetVector (&Xvec, OPIHI_FLT, xvec[0].Nelements);
    3560  SetVector (&Yvec, OPIHI_FLT, xvec[0].Nelements);
     
    4267  Npts = 0;
    4368  for (i = 0; i < Xvec.Nelements; i++, r++, d++) {
     69    if (tvec) {
     70      int skip = (tvec->type == OPIHI_FLT) ? (tvec->elements.Flt[i] == 0.0) : (tvec->elements.Int[i] == 0.0);
     71      if (skip) continue;
     72    }
     73
    4474    double ra = ohana_normalize_angle (*r);
    4575    while (ra < Rmin) ra += 360.0;
     
    88118  free (Yvec.elements.Ptr);
    89119   
     120  if (tvec) DeleteVector (tvec);
     121
    90122  return (TRUE);
    91123}
  • branches/eam_branches/ipp-20140717/Ohana/src/opihi/dvo/gstar.c

    r37111 r37227  
    627627              gprint (GP_LOG, "%5.3f ", catalog.measure[Nv].psfQF);
    628628              gprint (GP_LOG, "%7.1f ", catalog.measure[Nv].psfChisq);
    629               gprint (GP_LOG, "%3.1f ", catalog.measure[Nv].crNsigma);
     629              // gprint (GP_LOG, "%3.1f ", catalog.measure[Nv].crNsigma);
    630630              gprint (GP_LOG, "%4.1f ", catalog.measure[Nv].extNsigma);
    631631              gprint (GP_LOG, "%5.1f ", FromShortDegrees(catalog.measure[Nv].theta));
Note: See TracChangeset for help on using the changeset viewer.