IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3402


Ignore:
Timestamp:
Mar 9, 2005, 9:23:49 PM (21 years ago)
Author:
eugene
Message:

adding mosaic astrom support

Location:
trunk/Ohana/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/Makefile

    r3389 r3402  
    1 #install:
    2 #       @echo "addstar under re-construction"
    31default: addstar
    42help:
     
    3129$(SRC)/ConfigInit.$(ARCH).o \
    3230$(SRC)/conversions.$(ARCH).o \
     31$(SRC)/dump.$(ARCH).o \
    3332$(SRC)/edge_check.$(ARCH).o \
    3433$(SRC)/find_matches.$(ARCH).o \
     
    112111# utilities #################################################
    113112
    114 # install:
     113install:
    115114        for i in $(INSTALL); do make $$i.install; done
    116115
  • trunk/Ohana/src/addstar/include/addstar.h

    r3400 r3402  
    8787
    8888int MODE;
     89char *DUMP;
    8990
    9091time_t TIMEREF;
  • trunk/Ohana/src/addstar/src/addstar.c

    r3376 r3402  
    2424  case M_IMAGE:
    2525    stars = gstars (argv[1], &Nstars, &image);
     26    if ((DUMP != NULL) && !strcmp (DUMP, "rawstars")) dump_rawstars (stars, Nstars);
    2627    regions = gregion_image (&image, &Nregions);
    2728    overlap = gimages (&image, &Noverlap);
  • trunk/Ohana/src/addstar/src/args.c

    r3389 r3402  
    149149    remove_argument (N, &argc, argv);
    150150  }
     151  DUMP = NULL;
     152  if ((N = get_argument (argc, argv, "-dump"))) {
     153    remove_argument (N, &argc, argv);
     154    DUMP = strcreate(argv[N]);
     155    remove_argument (N, &argc, argv);
     156  }
    151157
    152158  if (argc != 2) {
  • trunk/Ohana/src/addstar/src/gstars.c

    r3389 r3402  
    4444    exit (1);
    4545  }
    46   while (image[0].coords.crval1 < 0) image[0].coords.crval1 += 360.0;
    47   while (image[0].coords.crval1 > 360.0) image[0].coords.crval1 -= 360.0;
    4846  itmp = 0;
    4947  fits_scan (&header, "NASTRO",   "%d", 1, &itmp);
     
    5856    }
    5957    RegisterMosaic (MOSAIC);
    60   }   
     58  } else {
     59    /* force image to lie in 0-360 range */
     60    while (image[0].coords.crval1 < 0) image[0].coords.crval1 += 360.0;
     61    while (image[0].coords.crval1 > 360.0) image[0].coords.crval1 -= 360.0;
     62  }
    6163   
    6264  /* get ST (used for airmass calculation) */
  • trunk/Ohana/src/libohana/include/loneos.h

    r3400 r3402  
    413413void RegisterMosaic (Coords *coords);
    414414void coords_precess (double *ra, double *dec, double in_epoch, double out_epoch);
     415int FindMosaicForImage (Image *images, int Nimages, int entry);
     416int FindMosaicForImage_TableSearch (Image *images, int Nimages, int entry);
     417int FindMosaicForImage_MatchSearch (Image *images, int Nimages, int entry);
     418int BuildChipMatch (Image *images, int Nimages);
    415419
    416420int FindMosaicForImage (Image *images, int Nimages, int entry);
  • trunk/Ohana/src/libohana/src/mosaic_astrom.c

    r3389 r3402  
    117117
    118118  got_match:
    119     ChipMatch[i] = j;
     119    continue;
    120120  }
    121121  return (TRUE);
  • trunk/Ohana/src/opihi/dvo/ImageOps.c

    r3393 r3402  
    4444        while (flipped && (r > Rmid)) r-= 360.0;
    4545        status = RD_to_XY (&X, &Y, r, d, &graph[0].coords);
    46 
    4746        if (!status) continue;
    4847        if (X < graph[0].xmin) continue;
     
    5049        if (Y < graph[0].ymin) continue;
    5150        if (Y > graph[0].ymax) continue;
    52         subset[n] = i;
    53         n++;
    54         if (n > npts - 1) {
    55           npts += 200;
    56           REALLOCATE (subset, int, npts);
    57         }
    58         break;
     51        goto in_region;
     52        /** we miss any images which surround the region.  we are also
     53            missing the DIS images for which the corners don't touch
     54            the region, but which are needed for WRP images with
     55            corners touching the region **/
    5956      }
    60       /** we miss any images which surround the region.  we are also
    61           missing the DIS images for which the corners don't touch
    62           the region, but which are needed for WRP images with
    63           corners touching the region **/
     57      continue;
     58    }
     59  in_region:
     60    subset[n] = i;
     61    n++;
     62    if (n > npts - 1) {
     63      npts += 200;
     64      REALLOCATE (subset, int, npts);
    6465    }
    6566  }
  • trunk/Ohana/src/opihi/dvo/LoadImages.c

    r3393 r3402  
    11# include "dvo.h"
    22
    3 Image *LoadImages (int *Nimage) {
     3Image *LoadImages (int *nimage) {
    44
    55  char filename[256];
    6   int nimage, NIMAGE;
     6  int Nimage, NIMAGE;
    77  FILE *f;
    88  Header header;
     
    1111  VarConfig ("IMAGE_CATALOG", "%s", filename);
    1212
     13  *nimage = 0;
    1314  NIMAGE = 0;
    1415  Nimage = 0;
     
    3738  ALLOCATE (image, Image, NIMAGE);
    3839  fseek (f, header.size, SEEK_SET);
    39   nimage = Fread (image, sizeof(Image), NIMAGE, f, "image");
    40   if (nimage != NIMAGE) {
    41     fprintf (stderr, "failed to read in all images (%d of %d)\n", nimage, NIMAGE);
     40  Nimage = Fread (image, sizeof(Image), NIMAGE, f, "image");
     41  if (Nimage != NIMAGE) {
     42    fprintf (stderr, "failed to read in all images (%d of %d)\n", Nimage, NIMAGE);
    4243  }
    4344
    4445  fclose (f);
    45   *Nimage = nimage;
     46  *nimage = Nimage;
    4647  return (image);
    4748}
  • trunk/Ohana/src/opihi/dvo/images.c

    r3393 r3402  
    8686
    8787    /* project this image to screen display coords */
    88     x[0] = 0;           y[0] = 0;
    89     x[1] = image[i].NX; y[1] = 0;
    90     x[2] = image[i].NX; y[2] = image[i].NY;
    91     x[3] = 0;           y[3] = image[i].NY;
     88    /* DIS images represent a field, not a chip */
     89    if (!strcmp(&image[i].coords.ctype[4], "-DIS")) {
     90      x[0] = -0.5*image[i].NX; y[0] = -0.5*image[i].NY;
     91      x[1] = +0.5*image[i].NX; y[1] = -0.5*image[i].NY;
     92      x[2] = +0.5*image[i].NX; y[2] = +0.5*image[i].NY;
     93      x[3] = -0.5*image[i].NX; y[3] = +0.5*image[i].NY;
     94    } else {
     95      x[0] = 0;           y[0] = 0;
     96      x[1] = image[i].NX; y[1] = 0;
     97      x[2] = image[i].NX; y[2] = image[i].NY;
     98      x[3] = 0;           y[3] = image[i].NY;
     99    }
    92100    status = FALSE;
    93101
Note: See TracChangeset for help on using the changeset viewer.