IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 15, 2006, 8:30:16 AM (20 years ago)
Author:
eugene
Message:

API cleanup, removed old test files, some re-organization, changed FLT/GAL to EXT

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psModulesUtils.c

    r5828 r5993  
    123123    return (new);
    124124}
     125
     126float pmSourceCrossProduct (pmSource *Mi, pmSource *Mj) {
     127
     128    int Xs, Xe, Ys, Ye;
     129    int xi, xj, yi, yj;
     130    int xIs, xJs, yIs, yJs;
     131    int xIe, yIe;
     132    float flux;
     133
     134    psImage *Pi = Mi->pixels;
     135    psImage *Pj = Mj->pixels;
     136
     137    psImage *Ti = Mi->mask;
     138    psImage *Tj = Mj->mask;
     139
     140    Xs = PS_MAX (Pi->col0, Pj->col0);
     141    Xe = PS_MIN (Pi->col0 + Pi->numCols, Pj->col0 + Pj->numCols);
     142   
     143    Ys = PS_MAX (Pi->row0, Pj->row0);
     144    Ye = PS_MIN (Pi->row0 + Pi->numRows, Pj->row0 + Pj->numRows);
     145   
     146    xIs = Xs - Pi->col0;
     147    xJs = Xs - Pj->col0;
     148    yIs = Ys - Pi->row0;
     149    yJs = Ys - Pj->row0;
     150
     151    xIe = Xe - Pi->col0;
     152    yIe = Ye - Pi->row0;
     153
     154    flux = 0;
     155    for (yi = yIs, yj = yJs; yi < yIe; yi++, yj++) {
     156        for (xi = xIs, xj = xJs; xi < xIe; xi++, xj++) {
     157            if (Ti->data.U8[yi][xi]) continue;
     158            if (Tj->data.U8[yj][xj]) continue;
     159            flux += Pi->data.F32[yi][xi] * Pj->data.F32[yj][xj];
     160        }
     161    }
     162    return (flux);
     163}
Note: See TracChangeset for help on using the changeset viewer.