# include "relphot.h"

GSCRegion *name_region (char *name, int *Nregions) {

  GSCRegion *region;
  Header header;

  ALLOCATE (region, GSCRegion, 1);

  sprintf (region[0].filename, "%s/%s", CATDIR, name);
  if (!fits_read_header (region[0].filename, &header)) {
    if (VERBOSE) fprintf (stderr, "catalog file not yet available: %s\n", region[0].filename);
    exit (0);
  }
  fits_scan (&header, "RA0", "%lf", 1, &region[0].RA[0]);
  fits_scan (&header, "RA1", "%lf", 1, &region[0].RA[1]);
  fits_scan (&header, "DEC0", "%lf", 1, &region[0].DEC[0]);
  fits_scan (&header, "DEC1", "%lf", 1, &region[0].DEC[1]);
  fits_free_header (&header);

  *Nregions = 1;
  return (region);
}

