Changeset 41538 for trunk/pswarp/src/pswarpMapGrid.c
- Timestamp:
- Apr 3, 2021, 2:31:34 PM (5 years ago)
- File:
-
- 1 edited
-
trunk/pswarp/src/pswarpMapGrid.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pswarp/src/pswarpMapGrid.c
r31878 r41538 13 13 # include "pswarp.h" 14 14 15 FILE *fout = NULL; 16 15 17 /** 16 18 * pswarpMapGridFromImage builds a set (a grid) of locally-linear maps which convert the source … … 46 48 } 47 49 50 if (0) { 51 // test the transformation sky<->chip for chip in smf: 52 if (fout == NULL) { fout = fopen ("map.grid.txt", "w"); } 53 54 pmCell *cell = dest->parent; 55 pmChip *chip = cell->parent; 56 pmFPA *fpa = chip->parent; 57 58 int NxChip = dest->image->numCols; 59 int NyChip = dest->image->numRows; 60 61 // XXX save these as static for speed? 62 psPlane *CH0 = psPlaneAlloc(); 63 psPlane *CH1 = psPlaneAlloc(); 64 65 psPlane *FP0 = psPlaneAlloc(); 66 psPlane *TP0 = psPlaneAlloc(); 67 68 psPlane *FP1 = psPlaneAlloc(); 69 psPlane *TP1 = psPlaneAlloc(); 70 71 psSphere *sky = psSphereAlloc(); 72 73 // measure the map for the center of each superpixel 74 for (i = 0; i < NxChip; i += 100) { 75 for (j = 0; j < NyChip; j += 100) { 76 77 CH0->x = i; 78 CH0->y = j; 79 psPlaneTransformApply(FP0, chip->toFPA, CH0); 80 psPlaneTransformApply (TP0, fpa->toTPA, FP0); 81 psDeproject (sky, TP0, fpa->toSky); 82 psProject (TP1, sky, fpa->toSky); 83 psPlaneTransformApply (FP1, fpa->fromTPA, TP1); 84 psPlaneTransformApply (CH1, chip->fromFPA, FP1); 85 86 fprintf (fout, "%f %f > %f %f > %f %f > %f %f | ", CH0->x, CH0->y, FP0->x, FP0->y, TP0->x, TP0->y, sky->r*180/M_PI, sky->d*180/M_PI); 87 fprintf (fout, "%f %f < %f %f < %f %f \n", TP1->x, TP1->y, FP1->x, FP1->y, CH1->x, CH1->y); 88 89 } 90 } 91 fclose (fout); 92 93 psFree (CH0); 94 psFree (FP0); 95 psFree (TP0); 96 97 psFree (CH1); 98 psFree (FP1); 99 psFree (TP1); 100 101 psFree (sky); 102 } 103 48 104 grid->nXpix = nXpix; 49 105 grid->nYpix = nYpix; … … 164 220 165 221 // XXX need to include readout->cell->chip offsets 222 // XXX note that 'dest' is the SMF and 'src' is the skycell CMF 223 // this is the lower accuracy direction... 166 224 167 225 /** V(0,0) position */ … … 205 263 map->xo = ix; 206 264 map->yo = iy; 207 265 208 266 psFree (offset); 209 267 psFree (FP);
Note:
See TracChangeset
for help on using the changeset viewer.
