IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 2, 2007, 10:29:50 AM (19 years ago)
Author:
magnier
Message:

fix compile bugs in psImageMap, psImagePixelInterpolate

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20070830/psLib/test/imageops/tap_psImageMap.c

    r14721 r14725  
    1313    return (TRUE);
    1414}
     15
     16# define C00 +0.5
     17# define C01 +0.1
     18# define C10 -0.2
    1519
    1620int main (void)
     
    3539        psVector *f = psVectorAllocEmpty (100, PS_TYPE_F32);
    3640
    37         for (int ix = 0; ix < 1000; ix += 25) {
    38             for (int iy = 0; iy < 1000; iy += 25) {
     41        for (int ix = 0; ix < 1000; ix += 10) {
     42            for (int iy = 0; iy < 1000; iy += 10) {
    3943                x->data.F32[x->n] = ix;
    4044                y->data.F32[y->n] = iy;
     
    5256
    5357        // allocate a map, but we have no field image to supply
    54         bool status = psImageMapGenerate (map, x, y, f, 0.1);
     58        // XXX this function needs to correct for the mean superpixel position
     59        // which is sampled...
     60        psImageMapGenerate (map, x, y, f, 0.1);
    5561        psFree (binning);
    5662
    57         fprint  (stderr, "nGood: %d\n", map->nGood);
    58         fprint  (stderr, "nPoor: %d\n", map->nPoor);
    59         fprint  (stderr, "nBad:  %d\n", map->nBad);
     63        fprintf (stderr, "nGood: %d\n", map->nGood);
     64        fprintf (stderr, "nPoor: %d\n", map->nPoor);
     65        fprintf (stderr, "nBad:  %d\n", map->nBad);
    6066       
    6167        SaveImage (NULL, map->map, "map.fits");
     
    7177        // measure difference between model (map) and data (field)
    7278        for (int ix = 0; ix < map->map->numCols; ix++) {
    73             for (int iy = 0; iy < map->map->num; iy++) {
    74                 int xo = ix*map->binning->nXbin;
    75                 int yo = iy*map->binning->nYbin;
    76                 df = field->data.F32[yo][xo] - map->map->data.F32[iy][ix];
    77                 fprintf (stderr, "%d %d   %f = %f - %f\n", ix, iy, df, field->data.F32[yo][xo], map->map->data.F32[iy][ix]);
     79            for (int iy = 0; iy < map->map->numRows; iy++) {
     80             
     81                int xo = (ix + 0.5)*map->binning->nXbin;
     82                int yo = (iy + 0.5)*map->binning->nYbin;
     83                float df = field->data.F32[yo][xo] - map->map->data.F32[iy][ix];
     84                fprintf (stderr, "%d %d -> %d %d  :  %f = %f - %f\n", ix, iy, xo, yo, df, field->data.F32[yo][xo], map->map->data.F32[iy][ix]);
    7885            }
    7986        }
Note: See TracChangeset for help on using the changeset viewer.