IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 41282 for trunk


Ignore:
Timestamp:
Feb 24, 2020, 3:50:50 PM (6 years ago)
Author:
eugene
Message:

add alternate skyregion command (-box R, D, radius)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/dvo/skyregion.c

    r40581 r41282  
    55 
    66  int N;
     7
     8  // alternate call form: skyregion -box Rcenter Dcenter radius
     9  if ((N = get_argument (argc, argv, "-box"))) {
     10    if ((N != 1) && (argc != 5)) {
     11      gprint (GP_ERR, "USAGE: skyregion -box (Rcenter) (Dcenter) (radius)\n");
     12      gprint (GP_ERR, "  Rcenter, Dcenter, radius in decimal degrees\n");
     13      return (FALSE);
     14    }
     15
     16    // argv[1] = -box
     17    double Rcenter = atof(argv[2]);
     18    double Dcenter = atof(argv[3]);
     19    double Radius  = atof(argv[4]);
     20
     21    double Rmin = Rcenter - Radius/cos(DEG_RAD*Dcenter);
     22    double Rmax = Rcenter + Radius/cos(DEG_RAD*Dcenter);
     23    double Dmin = Dcenter - Radius;
     24    double Dmax = Dcenter + Radius;
     25
     26    set_skyregion (Rmin, Rmax, Dmin, Dmax);
     27    return TRUE;
     28  }
     29 
    730
    831  // dvo_client should have 2 standard arguments: -hostID and -hostdir
Note: See TracChangeset for help on using the changeset viewer.