# include "dvoshell.h"

static double RAs = 0.0;
static double RAe = 0.0;
static double DECs = 0.0;
static double DECe = 0.0;

// define the sky region for which extractions are limited
int skyregion (int argc, char **argv) {
  
  if (argc == 1) {
    gprint (GP_ERR, "current skyregion: %f - %f : %f - %f\n", RAs, RAe, DECs, DECe);
    gprint (GP_ERR, "USAGE:  skyregion (min RA) (max RA) (min DEC) (max DEC)\n");
    return (FALSE);
  }

  if (argc != 5) {
    gprint (GP_ERR, "USAGE: skyregion (min RA) (max RA) (min DEC) (max DEC)\n");
    return (FALSE);
  }

  set_skyregion (atof(argv[1]), atof(argv[2]), atof(argv[3]), atof(argv[4]));

  return (TRUE);
}

int get_skyregion (double *Rs, double *Re, double *Ds, double *De) {

  *Rs = RAs;
  *Re = RAe;
  *Ds = DECs;
  *De = DECe;

  return TRUE;
}

int set_skyregion (double Rs, double Re, double Ds, double De) {

  RAs  = Rs;
  RAe  = Re;
  DECs = Ds;
  DECe = De;

  return TRUE;
}
