IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34821


Ignore:
Timestamp:
Dec 14, 2012, 3:05:12 PM (14 years ago)
Author:
eugene
Message:

do not crash if gpc1 image does not have mosaic (linear fit)

Location:
branches/eam_branches/ipp-20121130/Ohana/src/uniphot/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20121130/Ohana/src/uniphot/src/initialize_setposangle.c

    r34749 r34821  
    66    fprintf (stderr, "    -v : verbose mode\n");
    77    fprintf (stderr, "    -update : actually write results to detections tables\n");
     8    fprintf (stderr, "    -parallel : run in parallel mode\n");
     9    fprintf (stderr, "    -h     : this help list\n");
     10    fprintf (stderr, "    -help  : this help list\n");
     11    fprintf (stderr, "    --h    : this help list\n");
     12    fprintf (stderr, "    --help : this help list\n");
    813    fprintf (stderr, "    Note that the dvo db can be specified by -D CATDIR (directory)\n");
    914    exit (2);
  • branches/eam_branches/ipp-20121130/Ohana/src/uniphot/src/update_catalog_setposangle.c

    r34749 r34821  
    2525      Mosaic *mosaic = getMosaicForImage(seq);
    2626      Coords *coords = &image[seq].coords;
     27      Coords *mosaicCoords = mosaic ? &mosaic->coords : NULL;
    2728
    2829      double Xccd = catalog[0].measure[m].Xccd;
    2930      double Yccd = catalog[0].measure[m].Yccd;
    3031     
    31       setposangle_local_astrometry (&posAngle, &pltScale, Xccd, Yccd, &mosaic->coords, coords);
     32      setposangle_local_astrometry (&posAngle, &pltScale, Xccd, Yccd, mosaicCoords, coords);
    3233
    3334      catalog[0].measure[m].posangle = ToShortDegrees(posAngle);
     
    5253  // calculate the astrometry for the coordinate of interest
    5354  XY_to_LM (&Lx, &Mx, x,       y,       coords);
    54   XY_to_LM (&Po, &Qo, Lx,      Mx,      mosaic);
     55  if (mosaic) {
     56    XY_to_LM (&Po, &Qo, Lx,      Mx,      mosaic);
     57  } else {
     58    Po = Lx;
     59    Qo = Mx;
     60  }
    5561
    5662  XY_to_LM (&Lx, &Mx, x + 1.0, y,       coords);
    57   XY_to_LM (&Px, &Qx, Lx,      Mx,      mosaic);
     63  if (mosaic) {
     64    XY_to_LM (&Px, &Qx, Lx,      Mx,      mosaic);
     65  } else {
     66    Px = Lx;
     67    Qx = Mx;
     68  }
    5869
    5970  XY_to_LM (&Lx, &Mx, x,       y + 1.0, coords);
    60   XY_to_LM (&Py, &Qy, Lx,      Mx,      mosaic);
     71  if (mosaic) {
     72    XY_to_LM (&Py, &Qy, Lx,      Mx,      mosaic);
     73  } else {
     74    Py = Lx;
     75    Qy = Mx;
     76  }
    6177
    6278  // XXX units for the resulting Tangent Plane coordinates??
Note: See TracChangeset for help on using the changeset viewer.