IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16980


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

RegisterMosaic needs to store the values, not a pointer (trouble if it gets realloced)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libdvo/src/coordops.c

    r14590 r16980  
    11# include <dvo.h>
    22
    3 static Coords *mosaic = NULL;
     3static Coords mosaic;
     4static int gotMosaic = FALSE;
    45
    56void RegisterMosaic (Coords *coords) {
    6   mosaic = coords;
     7  mosaic = *coords;
     8  gotMosaic = TRUE;
     9}
     10
     11int isRegisteredMosaic () {
     12  return (gotMosaic);
     13}
     14
     15int GetMosaicCoords (Coords *coords) {
     16  *coords = mosaic;
     17  return (TRUE);
    718}
    819
     
    5263    /* mosaic astrometry : WRP is chip astrometry; apply mosaic (DIS) term */
    5364    if (proj == PROJ_WRP) {
    54       if (mosaic == NULL) return (FALSE);
    55       XY_to_RD (ra, dec, *ra, *dec, mosaic);
     65      if (!gotMosaic) return (FALSE);
     66      XY_to_RD (ra, dec, *ra, *dec, &mosaic);
    5667    }
    5768    return (TRUE);
     
    185196  if (mode == PROJ_MODE_CARTESIAN) {
    186197    if (proj == PROJ_WRP) {
    187       if (mosaic == NULL) return (FALSE);
    188       RD_to_XY (&Lo, &Mo, ra, dec, mosaic);
     198      if (!gotMosaic) return (FALSE);
     199      RD_to_XY (&Lo, &Mo, ra, dec, &mosaic);
    189200      *L = (Lo - coords[0].crval1);
    190201      *M = (Mo - coords[0].crval2);
Note: See TracChangeset for help on using the changeset viewer.