IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 28, 2012, 8:10:40 AM (14 years ago)
Author:
eugene
Message:

added some features to make remote stats operations easier

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/skyregion.c

    r33543 r33615  
    11# include "dvoshell.h"
    2 
    3 #ifdef NO_MOVED_TO_DVO
    4 static double RAs = 0.0;
    5 static double RAe = 0.0;
    6 static double DECs = 0.0;
    7 static double DECe = 0.0;
    8 #endif
    92
    103// define the sky region for which extractions are limited
    114int skyregion (int argc, char **argv) {
    125 
     6  int N;
     7
     8  // dvo_client should have 2 standard arguments: -hostID and -hostdir
     9  int SaveRegion = FALSE;
     10  if ((N = get_argument (argc, argv, "-save"))) {
     11    remove_argument (N, &argc, argv);
     12    SaveRegion = TRUE;
     13  }
     14
    1315  if (argc == 1) {
    14     double RAs, RAe, DECs, DECe;
    15     get_skyregion(&RAs, &RAe, &DECs, &DECe);
     16    double Rmin, Rmax, Dmin, Dmax;
     17    get_skyregion(&Rmin, &Rmax, &Dmin, &Dmax);
    1618
    17     gprint (GP_ERR, "current skyregion: %f - %f : %f - %f\n", RAs, RAe, DECs, DECe);
    18     gprint (GP_ERR, "USAGE:  skyregion (min RA) (max RA) (min DEC) (max DEC)\n");
    19     return (FALSE);
     19    if (SaveRegion) {
     20      set_variable ("Rmin", Rmin);
     21      set_variable ("Rmax", Rmax);
     22      set_variable ("Dmin", Dmin);
     23      set_variable ("Dmax", Dmax);
     24      return TRUE;
     25    } else {
     26      gprint (GP_ERR, "current skyregion: %f - %f : %f - %f\n", Rmin, Rmax, Dmin, Dmax);
     27      gprint (GP_ERR, "USAGE:  skyregion (min RA) (max RA) (min DEC) (max DEC)\n");
     28      return FALSE;
     29    }
    2030  }
    2131
     
    2939  return (TRUE);
    3040}
    31 #ifdef NOT_MOVED_TO_LIBDVO
    32 int get_skyregion (double *Rs, double *Re, double *Ds, double *De) {
    33 
    34   *Rs = RAs;
    35   *Re = RAe;
    36   *Ds = DECs;
    37   *De = DECe;
    38 
    39   return TRUE;
    40 }
    41 
    42 int set_skyregion (double Rs, double Re, double Ds, double De) {
    43 
    44   RAs  = Rs;
    45   RAe  = Re;
    46   DECs = Ds;
    47   DECe = De;
    48 
    49   return TRUE;
    50 }
    51 #endif
    5241
    5342/* find region which overlaps c at given depth (-1 : populated ) */
Note: See TracChangeset for help on using the changeset viewer.