IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16983


Ignore:
Timestamp:
Mar 13, 2008, 11:51:41 AM (18 years ago)
Author:
eugene
Message:

addstar no longer carries a static MOSAIC entry

Location:
trunk/Ohana/src/addstar
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/include/addstar.h

    r16973 r16983  
    105105double  Latitude;       // carried into image structure from config
    106106double  Longitude;      // carried into image structure from config
    107 Coords *MOSAIC;         // carries the mosaic into gstars
    108107double  FAKE_RA;        // boresite coords for fake images
    109108double  FAKE_DEC;       // boresite coords for fake images
    110109double  FAKE_THETA;     // boresite angle for fake images
     110
     111// carries the mosaic into gstars
    111112
    112113/* these globals are used separately by both client and server (KEEP) */
  • trunk/Ohana/src/addstar/src/ReadImageHeader.c

    r16810 r16983  
    3333  /* only load astrometry, NAXIS1,2, and time if this is a MOSAIC_PHU (ctype is ....-DIS) */
    3434  if (!strcmp (&image[0].coords.ctype[4], "-DIS")) {
    35     MOSAIC = &image[0].coords;
     35    RegisterMosaic (&image[0].coords);
    3636    return (TRUE);
    3737  }
     
    4747  }
    4848  if (!strcmp (&image[0].coords.ctype[4], "-WRP")) {
    49     if (MOSAIC == NULL) {
     49    if (!isRegisteredMosaic()) {
    5050      fprintf (stderr, "no mosaic for WRP image (use -mosaic)\n");
    5151      return (FALSE);
    5252    }
    53     RegisterMosaic (MOSAIC);
    5453  } else {
    5554    /* force image to lie in 0-360 range */
  • trunk/Ohana/src/addstar/src/addstar.c

    r16810 r16983  
    6161    case M_FAKEIMAGE:
    6262      images = fakeimage (argv[1], &Nimages, options.photcode);
    63       RegisterMosaic (MOSAIC);
    6463      ALLOCATE (skylist, SkyList, 1);
    6564      skylist[0].Nregions = 0;
  • trunk/Ohana/src/addstar/src/addstarc.c

    r16810 r16983  
    88  Stars *stars;
    99  Image *images;
     10  Coords MOSAIC;
    1011
    1112  /* load config and options */
     
    3132      Send_Image (BindSocket, images, Nimages, FALSE);
    3233      if (options.mosaic) {
    33         Send_Coords (BindSocket, MOSAIC, 1, FALSE);
     34        GetRegisteredMosaic (&MOSAIC);
     35        Send_Coords (BindSocket, &MOSAIC, 1, FALSE);
    3436      }
    3537      Send_Stars (BindSocket, stars, Nstars, FALSE);
  • trunk/Ohana/src/addstar/src/args.c

    r16973 r16983  
    112112  }
    113113  /* provide a mosaic for distortion */
    114   MOSAIC = NULL;
    115114  options.mosaic = FALSE;
    116115  if ((N = get_argument (argc, argv, "-mosaic"))) {
    117116    Header header;
    118     ALLOCATE (MOSAIC, Coords, 1);
     117    Coords MOSAIC;
    119118
    120119    remove_argument (N, &argc, argv);
     
    123122      exit (1);
    124123    }
    125     if (!GetCoords (MOSAIC, &header)) {
     124    if (!GetCoords (&MOSAIC, &header)) {
    126125      fprintf (stderr, "ERROR: no astrometric solution in header\n");
    127126      exit (1);
    128127    }
    129     if (strcmp(&MOSAIC[0].ctype[4], "-DIS")) {
     128    if (strcmp(&MOSAIC.ctype[4], "-DIS")) {
    130129      fprintf (stderr, "ERROR: not a mosaic distortion header\n");
    131130      exit (1);
    132131    }
     132    RegisterMosaic (&MOSAIC);
    133133    remove_argument (N, &argc, argv);
    134134    gfits_free_header (&header);
  • trunk/Ohana/src/addstar/src/args_client.c

    r14590 r16983  
    6262  }
    6363  /* provide a mosaic for distortion */
    64   MOSAIC = NULL;
    6564  options.mosaic = FALSE;
    6665  if ((N = get_argument (argc, argv, "-mosaic"))) {
    6766    Header header;
    68     ALLOCATE (MOSAIC, Coords, 1);
     67    Coords MOSAIC;
    6968
    7069    remove_argument (N, &argc, argv);
     
    7372      exit (1);
    7473    }
    75     if (!GetCoords (MOSAIC, &header)) {
     74    if (!GetCoords (&MOSAIC, &header)) {
    7675      fprintf (stderr, "ERROR: no astrometric solution in header\n");
    7776      exit (1);
    7877    }
    79     if (strcmp(&MOSAIC[0].ctype[4], "-DIS")) {
     78    if (strcmp(&MOSAIC.ctype[4], "-DIS")) {
    8079      fprintf (stderr, "ERROR: not a mosaic distortion header\n");
    8180      exit (1);
    8281    }
     82    RegisterMosaic (&MOSAIC);
    8383    remove_argument (N, &argc, argv);
    8484    gfits_free_header (&header);
  • trunk/Ohana/src/addstar/src/fakeimage.c

    r16810 r16983  
    1212  Image *image;
    1313  e_time MosaicTime;
     14  Coords MOSAIC;
    1415
    1516  /* this is a somewhat bogus method to set a time for the exposure */
     
    3334
    3435  /* create a mosaic distortion structure */
    35   ALLOCATE (MOSAIC, Coords, 1);
    36   strcpy (MOSAIC[0].ctype, "RA---DIS");
    37   MOSAIC[0].crval1 = FAKE_RA;
    38   MOSAIC[0].crval2 = FAKE_DEC;
     36  strcpy (MOSAIC.ctype, "RA---DIS");
     37  MOSAIC.crval1 = FAKE_RA;
     38  MOSAIC.crval2 = FAKE_DEC;
    3939 
    40   MOSAIC[0].crpix1 = MOSAIC[0].crpix2 = 0.0;
     40  MOSAIC.crpix1 = MOSAIC.crpix2 = 0.0;
    4141 
    4242  /* mosaic 'pixels' are millimeters */
    4343  ScanConfig (config, "PLATE_SCALE",   "%lf", 0, &pltscale);
    44   MOSAIC[0].cdelt1 = MOSAIC[0].cdelt2 = pltscale / 3600.0;
     44  MOSAIC.cdelt1 = MOSAIC.cdelt2 = pltscale / 3600.0;
    4545
    46   MOSAIC[0].pc1_1 =  cos(FAKE_THETA*RAD_DEG);
    47   MOSAIC[0].pc1_2 = -sin(FAKE_THETA*RAD_DEG);
    48   MOSAIC[0].pc2_1 =  sin(FAKE_THETA*RAD_DEG);
    49   MOSAIC[0].pc2_2 =  cos(FAKE_THETA*RAD_DEG);
     46  MOSAIC.pc1_1 =  cos(FAKE_THETA*RAD_DEG);
     47  MOSAIC.pc1_2 = -sin(FAKE_THETA*RAD_DEG);
     48  MOSAIC.pc2_1 =  sin(FAKE_THETA*RAD_DEG);
     49  MOSAIC.pc2_2 =  cos(FAKE_THETA*RAD_DEG);
    5050
    51   MOSAIC[0].Npolyterms = 3;
     51  MOSAIC.Npolyterms = 3;
    5252  for (i = 0; i < 7; i++) {
    53     MOSAIC[0].polyterms[i][0] = 0;
    54     MOSAIC[0].polyterms[i][1] = 0;
     53    MOSAIC.polyterms[i][0] = 0;
     54    MOSAIC.polyterms[i][1] = 0;
    5555  }
    5656  ScanConfig (config, "DPLATE_X",   "%lf", 0, &pltscale);
    57   MOSAIC[0].polyterms[3][0] = pltscale;  // L : X^3 Y^0
    58   MOSAIC[0].polyterms[5][0] = pltscale;  // L : X^1 Y^2
     57  MOSAIC.polyterms[3][0] = pltscale;  // L : X^3 Y^0
     58  MOSAIC.polyterms[5][0] = pltscale;  // L : X^1 Y^2
    5959  ScanConfig (config, "DPLATE_Y",   "%lf", 0, &pltscale);
    60   MOSAIC[0].polyterms[4][1] = pltscale;  // M : X^0 Y^0
    61   MOSAIC[0].polyterms[6][1] = pltscale;  // M : X^2 Y^0
     60  MOSAIC.polyterms[4][1] = pltscale;  // M : X^0 Y^0
     61  MOSAIC.polyterms[6][1] = pltscale;  // M : X^2 Y^0
     62
     63  RegisterMosaic (&MOSAIC);
    6264
    6365  /* some basic data about the chisp */
     
    160162  strcpy (image[0].name, rootname);
    161163
    162   image[0].coords = MOSAIC[0];
    163   strcpy (image[0].coords.ctype, MOSAIC[0].ctype);
     164  image[0].coords = MOSAIC;
     165  strcpy (image[0].coords.ctype, MOSAIC.ctype);
    164166
    165167  image[0].sidtime  = 0.0;
Note: See TracChangeset for help on using the changeset viewer.