IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42426


Ignore:
Timestamp:
Mar 18, 2023, 9:50:53 AM (3 years ago)
Author:
eugene
Message:

partial avselect mods to allow a vector of radii

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20230313/Ohana/src/opihi/dvo/avselect.c

    r41341 r42426  
    2222
    2323  Vector **vec, **invec, *RAvec, *DECvec, *IDXvec, *RADvec;
     24  Vector *RINvec = NULL;
    2425  dbField *fields;
    2526  dbValue *values;
     
    102103  }
    103104
    104   RADIUS = atof (argv[1]);
    105 
    106   /* load regions which contain all supplied RA,DEC coordinates */
     105  if (SelectScalar (argv[1], &RADIUS)) {
     106    remove_argument (1, &argc, argv);
     107  } else {
     108    gprint (GP_ERR, " RADIUS must be a numerical value\n");
     109    goto help;
     110    if ((RINvec = SelectVector (argv[1], ANYVECTOR, TRUE)) == NULL) goto help;
     111    RADIUS = 0.0; // find the max radius for region selection:
     112    for (i = 0; i < RINvec->Nelements; i++) {
     113      RADIUS = MAX(RINvec->elements.Flt[i], RADIUS);
     114    }
     115  }
     116
     117  /* load regions which contain all supplied RA,DEC coordinates (for RINvec, uses max radius) */
    107118  if ((skylist = SelectRegionsByCoordVectorsAndRadius (RAvec, DECvec, RADIUS/3600.0)) == NULL) goto escape;
    108119
     
    167178    return status;
    168179  }
    169 
    170   RADIUS = atof (argv[1]);
    171   remove_argument (1, &argc, argv);
    172180
    173181  // parse the fields to be extracted and returned
Note: See TracChangeset for help on using the changeset viewer.