IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 29, 2010, 3:55:49 PM (16 years ago)
Author:
eugene
Message:

update merges from trunk

Location:
branches/eam_branches/20100225
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20100225

  • branches/eam_branches/20100225/Ohana

  • branches/eam_branches/20100225/Ohana/src/opihi/dvo/skycoverage.c

    r25757 r27517  
    66
    77  int WITH_MOSAIC, SOLO_MOSAIC;
    8   int i, N, Nimage, status, TimeSelect, ByName, xs, ys;
     8  off_t i, Nimage;
     9  int N, status, TimeSelect, ByName, xs, ys;
    910  time_t tzero, tend;
    10   double pixscale, dX, dY, Npts, r, d, Xi, Yi, Xs, Ys, x[2], y[2], trange, RaCenter;
     11  double pixscale, dX, dY, Npts, r, d, Xi, Yi, Xs, Ys, x[2], y[2], trange, RaCenter, DecCenter;
    1112  Image *image;
    12   char name[256];
     13  char name[256], projection[16];
    1314  float *V;
    1415  int Nx, Ny;
     
    3334
    3435  RaCenter = 0.0;
    35   if ((N = get_argument (argc, argv, "-ra-center"))) {
     36  DecCenter = 0.0;
     37  if ((N = get_argument (argc, argv, "-center"))) {
    3638    remove_argument (N, &argc, argv);
    3739    RaCenter = atof (argv[N]);
     40    remove_argument (N, &argc, argv);
     41    DecCenter = atof (argv[N]);
     42    remove_argument (N, &argc, argv);
     43  }
     44
     45  Nx = 0;
     46  Ny = 0;
     47  if ((N = get_argument (argc, argv, "-size"))) {
     48    remove_argument (N, &argc, argv);
     49    Nx = atof (argv[N]);
     50    remove_argument (N, &argc, argv);
     51    Ny = atof (argv[N]);
     52    remove_argument (N, &argc, argv);
     53  }
     54
     55  pixscale = 1.0;
     56  if ((N = get_argument (argc, argv, "-scale"))) {
     57    remove_argument (N, &argc, argv);
     58    pixscale = atof (argv[N]);
    3859    remove_argument (N, &argc, argv);
    3960  }
     
    4566    remove_argument (N, &argc, argv);
    4667    ByName = TRUE;
     68  }
     69
     70  strcpy (projection, "DEC--AIT");
     71  if ((N = get_argument (argc, argv, "-proj"))) {
     72    remove_argument (N, &argc, argv);
     73    if (!strcasecmp(argv[N], "TAN")) {
     74        strcpy (projection, "DEC--TAN");
     75    }   
     76    if (!strcasecmp(argv[N], "SIN")) {
     77        strcpy (projection, "DEC--SIN");
     78    }   
     79    if (!strcasecmp(argv[N], "GLS")) {
     80        strcpy (projection, "DEC--GLS");
     81    }   
     82    if (!strcasecmp(argv[N], "PAR")) {
     83        strcpy (projection, "DEC--PAR");
     84    }   
     85    remove_argument (N, &argc, argv);
    4786  }
    4887
     
    100139  }
    101140 
    102   if (argc != 4) {
    103     gprint (GP_ERR, "USAGE: skycoverage (buffer) (pixscale) (Npts)\n");
    104     gprint (GP_ERR, "  options: [-time start range] [-trange start stop] [-name name] [-photcode name] [+mosaic] [-mosaic] [-ra-center RA]\n");
    105     gprint (GP_ERR, "       (buffer) saves bitmapped AIT plot\n");
    106     gprint (GP_ERR, "       (pixscale) specifies the pixel size in degrees\n");
     141  if (argc != 3) {
     142    gprint (GP_ERR, "USAGE: skycoverage (buffer) (Npts)\n");
     143    gprint (GP_ERR, "  options: [-scale pixscale] [-center ra dec] [-size Nx Nx] [-proj projection] [-time start range] [-trange start stop] [-name name] [-photcode name] [+mosaic] [-mosaic]\n");
     144    gprint (GP_ERR, "       (buffer) saves bitmapped image\n");
    107145    gprint (GP_ERR, "       (Npts) gives the number of test points per image in each dimension\n");
     146    gprint (GP_ERR, "       -scale (pixscale)  : specifies the pixel size in degrees [1.0]\n");
     147    gprint (GP_ERR, "       -center (ra) (dec) : specifies the center of the field [0.0, 0.0]\n");
     148    gprint (GP_ERR, "       -size (Nx) (Ny)    : specifies the size of the image [360/scale, 180/scale]\n");
     149    gprint (GP_ERR, "       -proj (projection) : specifies the projection choice [AIT]\n");
    108150    gprint (GP_ERR, "       note: we need 64800 / (pixscale)^2 pixels to represent the sky\n");
    109151    return (FALSE);
     
    111153 
    112154  if ((buf = SelectBuffer (argv[1], ANYBUFFER, TRUE)) == NULL) return (FALSE);
    113   pixscale = atof(argv[2]);
    114   Npts     = atof(argv[3]);
    115 
    116   Nx = 360/pixscale;
    117   Ny = 180/pixscale;
     155  Npts = atof(argv[2]);
     156
     157  if (!Nx || !Ny) {
     158    Nx = 360/pixscale;
     159    Ny = 180/pixscale;
     160  }
    118161
    119162  gfits_free_matrix (&buf[0].matrix);
     
    123166
    124167  coords.crval1 = RaCenter;
    125   coords.crval2 = 0;
     168  coords.crval2 = DecCenter;
    126169  coords.crpix1 = 0.5*Nx;
    127170  coords.crpix2 = 0.5*Ny;
    128   strcpy (coords.ctype, "DEC--AIT");
     171  strcpy (coords.ctype, projection);
    129172  coords.pc1_1 = -1.0;
    130173  coords.pc2_2 = +1.0;
Note: See TracChangeset for help on using the changeset viewer.