- Timestamp:
- Sep 2, 2007, 10:29:50 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20070830/psLib/test/imageops/tap_psImageMap.c
r14721 r14725 13 13 return (TRUE); 14 14 } 15 16 # define C00 +0.5 17 # define C01 +0.1 18 # define C10 -0.2 15 19 16 20 int main (void) … … 35 39 psVector *f = psVectorAllocEmpty (100, PS_TYPE_F32); 36 40 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) { 39 43 x->data.F32[x->n] = ix; 40 44 y->data.F32[y->n] = iy; … … 52 56 53 57 // 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); 55 61 psFree (binning); 56 62 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); 60 66 61 67 SaveImage (NULL, map->map, "map.fits"); … … 71 77 // measure difference between model (map) and data (field) 72 78 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]); 78 85 } 79 86 }
Note:
See TracChangeset
for help on using the changeset viewer.
