IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5442


Ignore:
Timestamp:
Oct 24, 2005, 10:35:23 AM (21 years ago)
Author:
eugene
Message:

added skycat, mods to skyregion

Location:
trunk/Ohana/src/opihi
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/dvo/Makefile

    r5242 r5442  
    8080$(SDIR)/procks.$(ARCH).o                \
    8181$(SDIR)/skycoverage.$(ARCH).o           \
     82$(SDIR)/skycat.$(ARCH).o                \
    8283$(SDIR)/showtile.$(ARCH).o              \
    8384$(SDIR)/simage.$(ARCH).o                \
  • trunk/Ohana/src/opihi/dvo/find_regions.c

    r5439 r5442  
    1515  int NLINES, done, NREGIONS, nregion;
    1616 
    17   VarConfig ("SKYFILE", "%s", filename);
     17  VarConfig ("GSCFILE", "%s", filename);
    1818  f = fopen (filename, "r");
    1919  if (f == NULL) {
  • trunk/Ohana/src/opihi/dvo/init.c

    r4748 r5442  
    4343int procks          PROTO((int, char **));
    4444int showtile        PROTO((int, char **));
     45int skycat          PROTO((int, char **));
    4546int skycoverage     PROTO((int, char **));
    4647int simage          PROTO((int, char **));
     
    9596  {"procks",      procks,       "plot rocks"},
    9697  {"showtile",    showtile,     "plot tile pattern"},
     98  {"skycat",      skycat,       "show sky catalog boundaries"},
    9799  {"skycoverage", skycoverage,  "measure image union on sky"},
    98100  {"simage",      simage,       "plot stars in an image"},
  • trunk/Ohana/src/opihi/dvo/pcat.c

    r4689 r5442  
    11# include "dvo1.h"
     2int RD_to_XYpic (double *x, double *y, double r, double d, Coords *coords, double Rmin, double Rmax, double Rmid, int *leftside);
    23
    34int pcat (int argc, char **argv) {
    45 
    56  double Radius;
    6   int i, j, N, Nregions, ShowAll, NPTS, Npts;
     7  int i, j, N, Nregions, ShowAll, NPTS, Npts, leftside;
    78  RegionFile *regions;
    89  char filename[128];
     
    1011  Vector Xvec, Yvec;
    1112  Graphdata graphmode;
    12   double X[4], Y[4];
     13  double X[4], Y[4], Rmin, Rmax, Rmid;
    1314  char catdir[256];
    14   int Ngraph;
     15  int Ngraph, VERBOSE;
    1516
    1617  VarConfig ("CATDIR", "%s", catdir);
     18
     19  VERBOSE = FALSE;
     20  if ((N = get_argument (argc, argv, "-v"))) {
     21    remove_argument (N, &argc, argv);
     22    VERBOSE = TRUE;
     23  }
    1724
    1825  ShowAll = FALSE;
     
    3138  regions = find_regions (graphmode.coords.crval1, graphmode.coords.crval2, Radius, &Nregions);
    3239
     40  Rmin = graphmode.coords.crval1 - 180.0;
     41  Rmax = graphmode.coords.crval1 + 180.0;
     42  Rmid = 0.5*(Rmin + Rmax);
     43
    3344  NPTS = 200;
    3445  ALLOCATE (Xvec.elements, float, NPTS);
     
    3950    sprintf (filename, "%s/%s", catdir, regions[i].name);
    4051    if (ShowAll || (stat (filename, &filestat) != -1)) {
    41       fprintf (stderr, "%3d %s\n", i, regions[i].name);
    42       RD_to_XY (&X[0], &Y[0], regions[i].RA0, regions[i].DEC0, &graphmode.coords);
    43       RD_to_XY (&X[1], &Y[1], regions[i].RA0, regions[i].DEC1, &graphmode.coords);
    44       RD_to_XY (&X[2], &Y[2], regions[i].RA1, regions[i].DEC1, &graphmode.coords);
    45       RD_to_XY (&X[3], &Y[3], regions[i].RA1, regions[i].DEC0, &graphmode.coords);
    46       for (j = 0; j < 4; j++) {
    47         Xvec.elements[Npts + j*2] = X[j];
    48         Yvec.elements[Npts + j*2] = Y[j];
    49         if (j > 0) {
    50           Xvec.elements[Npts+2*j - 1] = Xvec.elements[Npts+2*j];
    51           Yvec.elements[Npts+2*j - 1] = Yvec.elements[Npts+2*j];
    52         }
     52      if (VERBOSE) fprintf (stderr, "%3d %s\n", i, regions[i].name);
     53
     54      leftside = -1;
     55      RD_to_XYpic (&X[0], &Y[0], regions[i].RA0, regions[i].DEC0, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
     56      RD_to_XYpic (&X[1], &Y[1], regions[i].RA0, regions[i].DEC1, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
     57      RD_to_XYpic (&X[2], &Y[2], regions[i].RA1, regions[i].DEC1, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
     58      RD_to_XYpic (&X[3], &Y[3], regions[i].RA1, regions[i].DEC0, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
     59
     60      Xvec.elements[Npts] = X[0];
     61      Yvec.elements[Npts] = Y[0];
     62      for (j = 1; j < 4; j++) {
     63        Xvec.elements[Npts + j*2 - 0] = X[j];
     64        Yvec.elements[Npts + j*2 - 0] = Y[j];
     65        Xvec.elements[Npts + j*2 - 1] = X[j];
     66        Yvec.elements[Npts + j*2 - 1] = Y[j];
    5367      }
    5468      Xvec.elements[Npts+7] = Xvec.elements[Npts];
     
    8195
    8296}
     97
     98int RD_to_XYpic (double *x, double *y, double r, double d, Coords *coords, double Rmin, double Rmax, double Rmid, int *leftside) {
     99
     100  while (r < Rmin) { r += 360.0; }
     101  while (r > Rmax) { r -= 360.0; }
     102
     103  if (*leftside == -1) {
     104    *leftside = (r < Rmid);
     105  } else {
     106    if (  *leftside && (r > Rmid + 90)) { r -= 360.0; }
     107    if (! *leftside && (r < Rmid - 90)) { r += 360.0; }
     108  }
     109
     110  RD_to_XY (x, y, r, d, coords);
     111
     112  return (TRUE);
     113}
  • trunk/Ohana/src/opihi/include/dvo1.h

    r5144 r5442  
    9090CMPstars *cmpReadFits (FILE *f, int *nstars);
    9191CMPstars *cmpReadText (FILE *f, int *nstars);
     92int RD_to_XYpic (double *x, double *y, double r, double d, Coords *coords, double Rmin, double Rmax, double Rmid, int *leftside);
    9293
    9394# endif
  • trunk/Ohana/src/opihi/include/dvo2.h

    r5439 r5442  
    1111  int Nregion;
    1212  SkyRegion *region;
    13 } SkyRegionTable;
     13} SkyTable;
    1414
    1515typedef struct {
    1616  int Nregion;
    1717  SkyRegion **region;
    18 } SkyRegionList;
     18} SkyList;
    1919
    2020# if (0)
Note: See TracChangeset for help on using the changeset viewer.