IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34718


Ignore:
Timestamp:
Nov 27, 2012, 11:59:51 AM (14 years ago)
Author:
eugene
Message:

only do gpc1 photcodes, get the posangle and pltscale in the correct units

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

Legend:

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

    r34698 r34718  
    4747    remove_argument (N, &argc, argv);
    4848  }
     49
     50  // XXX I want to avoid running this on all data all the time
     51  // some options: gpc1 only (hardwired), require photcodes (fairly tedious),
     52  // exclude some photcodes?
     53  // XXX for now, hardwire gpc1 photcodes
    4954
    5055  PARALLEL = FALSE;
  • branches/eam_branches/ipp-20120905/Ohana/src/uniphot/src/update_catalog_setposangle.c

    r34697 r34718  
    1414      if (ID <= 0) continue; // detections with imageID == 0 do not have a valid image (eg, ref photcode)
    1515
    16       // XXX only do certain photcodes?
     16      // XXX only do GPC1 data for now
     17      catalog[0].measure[m].pltscale = pltScale;
     18      if (catalog[0].measure[m].photcode < 10000) continue;
     19      if (catalog[0].measure[m].photcode > 10600) continue;
    1720     
    1821      // index[ID] = seqN
     
    2831      setposangle_local_astrometry (&posAngle, &pltScale, Xccd, Yccd, &mosaic->coords, coords);
    2932
    30       catalog[0].measure[m].posangle = posAngle;
     33      catalog[0].measure[m].posangle = ToShortDegrees(posAngle);
    3134      catalog[0].measure[m].pltscale = pltScale;
    3235      myAssert(isfinite(catalog[0].measure[m].posangle), "oops: setposangle made a nan");
     
    4245
    4346// this is basically a re-write / adaptation of pmSourceLocalAstrometry
     47// posangle in degrees, plate scale in arcseconds/pixel
    4448int setposangle_local_astrometry (float *posAngle, float *pltScale, double x, double y, Coords *mosaic, Coords *coords) {
    4549
     
    6670  double pltScale_x = hypot(dPdX, dQdX);
    6771  double pltScale_y = hypot(dPdY, dQdY);
    68   *pltScale = 0.5*(pltScale_x + pltScale_y);
     72  *pltScale = 3600.0*0.5*(pltScale_x + pltScale_y);
    6973
    7074  double posAngle_x, posAngle_y;
     
    8690    posAngle_x += 2.0 * M_PI;
    8791  }
    88   *posAngle = 0.5*(posAngle_x + posAngle_y);
     92  *posAngle = 0.5*(posAngle_x + posAngle_y)*DEG_RAD;
    8993
    9094  return TRUE;
Note: See TracChangeset for help on using the changeset viewer.