IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25636


Ignore:
Timestamp:
Sep 28, 2009, 5:48:38 PM (17 years ago)
Author:
eugene
Message:

get the 180 valid range right

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090715/Ohana/src/opihi/dvo/skycoverage.c

    r21153 r25636  
    1616  Coords coords;
    1717  int typehash;
     18  int PhotcodeSelect;
     19  PhotCode *PhotcodeValue;
    1820
    1921  WITH_MOSAIC = FALSE;
     
    4345    remove_argument (N, &argc, argv);
    4446    ByName = TRUE;
     47  }
     48
     49  PhotcodeValue = NULL;
     50  PhotcodeSelect = FALSE;
     51  if ((N = get_argument (argc, argv, "-photcode"))) {
     52    if (!InitPhotcodes ()) return (FALSE);
     53    PhotcodeSelect = TRUE;
     54    remove_argument (N, &argc, argv);
     55    PhotcodeValue = GetPhotcodebyName (argv[N]);
     56    if (PhotcodeValue == NULL) {
     57      gprint (GP_ERR, "photcode not found in photcode table\n");
     58      return (FALSE);
     59    }
     60    remove_argument (N, &argc, argv);
    4561  }
    4662
     
    85101 
    86102  if (argc != 4) {
    87     gprint (GP_ERR, "USAGE: skycoverage (buffer) (pixscale) (Npts) [-time start range] [-name name]\n");
     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");
    88105    gprint (GP_ERR, "       (buffer) saves bitmapped AIT plot\n");
    89106    gprint (GP_ERR, "       (pixscale) specifies the pixel size in degrees\n");
     
    128145    for (xs = 0; xs < Nx; xs++) {
    129146      status = XY_to_RD (&r, &d, (double)(xs), (double)(ys), &coords);
    130       status &= (r > 0);
    131       status &= (r < 360);
     147      status &= (r >= 0);
     148      status &= (r <= 360);
    132149      if (status) {
    133150        V[ys*Nx + xs] = 2;
     
    141158    if (ByName && strcmp (name, image[i].name)) continue;
    142159    if (TimeSelect && ((image[i].tzero < tzero) || (image[i].tzero+image[i].trate*image[i].NY > tzero + trange))) continue;
     160
     161    if (PhotcodeSelect) {
     162      if (PhotcodeValue[0].type == PHOT_DEP) {
     163        if (PhotcodeValue[0].code != image[i].photcode) continue;
     164      } else {
     165        if (PhotcodeValue[0].code != GetPhotcodeEquivCodebyCode (image[i].photcode)) continue;
     166      }
     167    }
     168
    143169    if (!FindMosaicForImage (image, Nimage, i)) continue;
    144170
     
    167193        XY_to_RD (&r, &d, Xi, Yi, &image[i].coords);
    168194        r = ohana_normalize_angle (r);
     195        if (r - RaCenter > +180.0) r -= 360.0;
     196        if (r - RaCenter < -180.0) r += 360.0;
    169197        status = RD_to_XY (&Xs, &Ys, r, d, &coords);
    170198        if (Xs < 0) continue;
Note: See TracChangeset for help on using the changeset viewer.