IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6763


Ignore:
Timestamp:
Apr 4, 2006, 8:58:12 AM (20 years ago)
Author:
eugene
Message:

added fake image mode

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

Legend:

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

    r6675 r6763  
    3535$(SRC)/find_matches_refstars.$(ARCH).o \
    3636$(SRC)/find_subset.$(ARCH).o \
     37$(SRC)/fakeimage.$(ARCH).o \
    3738$(SRC)/gcatalog.$(ARCH).o \
    3839$(SRC)/get2mass.$(ARCH).o \
  • trunk/Ohana/src/addstar/doc/notes.txt

    r5448 r6763  
     1
     22006.04.02
     3
     4  I am considering an option to insert fake camera images into the
     5  database.  The camera would be described with a file specifying the
     6  dimensions of each chip (Nx,Ny,pixel scale), the location of each
     7  chip in the focal plane, and the optical parameters of the camera
     8  (plate scale at center, x,y distortion terms).  Each call to addstar
     9  would specify the boresite center:
     10
     11  addstar -fakeimage ra dec theta
     12
     13  the camera parameters should be loaded via the config information.
    114
    2152005.10.24
  • trunk/Ohana/src/addstar/include/addstar.h

    r6683 r6763  
    3333typedef struct sockaddr_in SockAddress;
    3434
    35 enum {M_IMAGE, M_REFLIST, M_REFCAT};
     35enum {M_IMAGE, M_REFLIST, M_REFCAT, M_FAKEIMAGE};
    3636
    3737/* global which define database info / data sources (KEEP) */
     
    5353char   SKY_TABLE[256];
    5454int    SKY_DEPTH;  /** XXX EAM : depth of catalog tables, fix usage */
     55char   CameraLayout[256];
    5556SkyTable *ServerSky;
    5657
     
    8182double  Latitude;       // carried into image structure from config
    8283Coords *MOSAIC;         // carries the mosaic into gstars
     84double  FAKE_RA;        // boresite coords for fake images
     85double  FAKE_DEC;       // boresite coords for fake images
     86double  FAKE_THETA;     // boresite angle for fake images
    8387
    8488/* these globals are used separately by both client and server (KEEP) */
     
    118122int        dump_rawstars          PROTO((Stars *stars, int Nstars));
    119123int        edge_check             PROTO((double *x1, double *y1, double *x2, double *y2));
     124Image     *fakeimage              PROTO((char *rootname, int *Nimage, int photcode));
    120125void       find_matches           PROTO((SkyRegion *region, Stars *stars, int Nstars, Catalog *catalog, Image *image, Image *overlap, int Noverlap, Coords *mosaic, AddstarClientOptions options));
    121126void       find_matches_closest   PROTO((SkyRegion *region, Stars *stars, int Nstars, Catalog *catalog, Image *image, Image *overlap, int Noverlap, Coords *mosaic, AddstarClientOptions options));
  • trunk/Ohana/src/addstar/src/ConfigInit.c

    r6684 r6763  
    7575  /* dropped: ScanConfig (config, "IMAGE_CATALOG",          "%s",  0, ImageCat); */
    7676
     77  ScanConfig (config, "CAMERA_LAYOUT",          "%s",  0, CameraLayout);
    7778
    7879  /* used by client/server setup */
  • trunk/Ohana/src/addstar/src/addstar.c

    r6684 r6763  
    44
    55  int Nm, Na, Ns, status;
    6   int i, Nstars, Noverlap, Nsubset, Naverage, Nmeasure;
     6  int i, Nstars, Nimage, Noverlap, Nsubset, Naverage, Nmeasure;
    77  Stars *stars, **subset;
    8   Image image, *overlap;
     8  Image image, *imageSet, *overlap;
    99  Catalog catalog;
    1010  FITS_DB db;
     
    5454      skylist = SkyListByPatch (sky, -1, &UserPatch);
    5555      break;
     56    case M_FAKEIMAGE:
     57      imageSet = fakeimage (argv[1], &Nimage, options.photcode);
     58      RegisterMosaic (MOSAIC);
     59
     60      if (db.dbstate == LCK_EMPTY) {
     61        create_image_db (&db);
     62      } else {
     63        if (!dvo_image_load (&db, VERBOSE, FORCE_READ)) {
     64          Shutdown ("can't read image catalog %s", db.filename);
     65        }
     66      }   
     67
     68      dvo_image_addrows (&db, imageSet, Nimage);
     69      SetProtect (TRUE);
     70      dvo_image_update (&db, VERBOSE);
     71      SetProtect (FALSE);
     72
     73      ohana_memcheck (FALSE);
     74      dvo_image_unlock (&db); /* unlock? */
     75
     76      gettimeofday (&stop, NULL);
     77      dtime = DTIME (stop, start);
     78      fprintf (stderr, "SUCCESS: elapsed time %9.4f sec for fake image\n", dtime);
     79      exit (0);
    5680  }
    5781  if (options.only_match || options.existing_regions) {
     
    6387  if (VERBOSE) fprintf (stderr, "writing to %d regions\n", skylist[0].Nregions);
    6488
     89  /* XXX clean this up a bit : for only_image, I don't need to do this loop
     90     unless we are getting the calibration. */
    6591  Naverage = Nmeasure = 0;
    6692  for (i = 0; i < skylist[0].Nregions; i++) {
  • trunk/Ohana/src/addstar/src/args.c

    r6684 r6763  
    2323  if ((N = get_argument (argc, argv, "-cat"))) {
    2424    options.mode = M_REFCAT;
     25    remove_argument (N, &argc, argv);
     26  }
     27  if ((N = get_argument (argc, argv, "-fakeimage"))) {
     28    options.mode = M_FAKEIMAGE;
     29    remove_argument (N, &argc, argv);
     30    FAKE_RA = atof (argv[N]);
     31    remove_argument (N, &argc, argv);
     32    FAKE_DEC = atof (argv[N]);
     33    remove_argument (N, &argc, argv);
     34    FAKE_THETA = atof (argv[N]);
    2535    remove_argument (N, &argc, argv);
    2636  }
     
    241251    fprintf (stderr, "USAGE: addstar -cat (catalog)\n");
    242252    fprintf (stderr, "USAGE: addstar -ref (filename)\n");
     253    fprintf (stderr, "USAGE: addstar -fakeimage (ra) (dec) (theta) (name)\n");
    243254    exit (2);
    244255  }
Note: See TracChangeset for help on using the changeset viewer.