IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5494


Ignore:
Timestamp:
Nov 9, 2005, 10:02:25 PM (21 years ago)
Author:
eugene
Message:

fringe / astrom functions

Location:
trunk/archive/modules/src
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/archive/modules/src/pmAstrom.c

    r5353 r5494  
    3232*/
    3333
    34 pmAstromGridMatchStat pmAstromGridMatch (psArray *st1, psArray *st2, pmAstromOpt *opt) {
     34psArray *pmAstromGridMatch (psArray *raw, psArray *ref, psMetadata *options) {
    3535
    3636    pmAstromGridMatchStat minStat, newStat
     
    5959    }
    6060    return (minStat);
    61 }
    62 
    63 // rotate the focal-plane coordinates about the center coordinate
    64 // angle specified in radians
    65 psArray *pmAstromRotateObj (psArray *old, double angle, double pCenter, double qCenter) {
    66 
    67     pmAstromObj *ob;
    68 
    69     psArray *new = psArrayAlloc (old->n);
    70 
    71     cs = cos(angle);
    72     sn = sin(angle);
    73    
    74     for (int i = 0; i < old->n; i++) {
    75 
    76         oldObj = (pmAstromObj *)old->data[i];
    77         newObj = pmAstromObjCopy (oldObj);
    78 
    79         P = oldObj->P - pCenter;
    80         Q = oldObj->Q - qCenter;
    81        
    82         newObj->P = P*cs + Q*sn;
    83         newObj->Q = Q*cs - P*sn;
    84        
    85         new->data[i] = newObj;
    86     }
    87     return (new);
    8861}
    8962
     
    250223    psPolynomial2D *yt = psVectorFitPolynomial2D (NULL, stats, NULL, 0, Y, NULL, x, y)
    251224    psPolynomial2D *yt = psVectorClipFitPolynomial2D (NULL, stats, NULL, 0, Y, NULL, x, y)
     225
     226      }
     227
     228}
     229
     230
     231// rotate the focal-plane coordinates about the center coordinate
     232// angle specified in radians
     233psArray *pmAstromRotateObj (psArray *old, psPlane *center, double angle) {
     234
     235    pmAstromObj *newObj;
     236
     237    psArray *new = psArrayAlloc (old->n);
     238
     239    cs = cos(angle);
     240    sn = sin(angle);
     241    xCenter = center.x;
     242    yCenter = center.y;
     243   
     244    for (int i = 0; i < old->n; i++) {
     245
     246        oldObj = (pmAstromObj *)old->data[i];
     247        newObj = pmAstromObjCopy (oldObj);
     248
     249        P = oldObj->FP.x - xCenter;
     250        Q = oldObj->FP.y - yCenter;
     251       
     252        newObj->FP.x = P*cs + Q*sn;
     253        newObj->FP.y = Q*cs - P*sn;
     254       
     255        new->data[i] = newObj;
     256    }
     257    return (new);
     258}
     259
     260pmAstromObj *pmAstromObjCopy (pmAstromObj *old) {
     261
     262  pmAstromObj *obj = pmAstromObjAlloc ();
     263
     264  obj[0] = old[0];
     265
     266  return (obj);
     267}
     268
     269static void pmAstromObjFree (pmAstromObj *obj) {
     270
     271  if (obj == NULL) return;
     272  return;
     273}
     274
     275pmAstromObj *pmAstromObjAlloc (void) {
     276
     277  pmAstromObj *obj = psAlloc (sizeof(pmAstromObj));
     278  psMemSetDeallocator(line, (psFreeFunc) pmAstromObjFree);
     279
     280  obj->pix.x = 0;
     281  obj->pix.y = 0;
     282
     283  obj->FP.x = 0;
     284  obj->FP.y = 0;
     285
     286  obj->TP.x = 0;
     287  obj->TP.y = 0;
     288
     289  obj->sky.x = 0;
     290  obj->sky.y = 0;
     291
     292  obj->mag = 0;
     293
     294  return (obj);
     295}
     296
Note: See TracChangeset for help on using the changeset viewer.