Changeset 21323 for trunk/pswarp/src/pswarpMapGrid.c
- Timestamp:
- Feb 5, 2009, 10:44:04 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/pswarp/src/pswarpMapGrid.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pswarp/src/pswarpMapGrid.c
r18839 r21323 1 /** @file pswarpMapGrid.c 2 * 3 * @brief 4 * 5 * @ingroup pswarp 6 * 7 * @author IfA 8 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2009-02-05 20:44:04 $ 10 * Copyright 2009 Institute for Astronomy, University of Hawaii 11 */ 12 1 13 # include "pswarp.h" 2 14 3 // pswarpMapGridFromImage builds a set (a grid) of locally-linear maps which convert the source 4 // coordinates (src) to destination coordinates (dest). we construct a grid with superpixel 5 // spacing of nXpix, nYpix. The transformation for each grid cell is valid for the superpixel. 6 // The grid over-fills the source image so every source image pixel is guaranteed to have a map. 15 /** 16 * pswarpMapGridFromImage builds a set (a grid) of locally-linear maps which convert the source 17 * coordinates (src) to destination coordinates (dest). we construct a grid with superpixel 18 * spacing of nXpix, nYpix. The transformation for each grid cell is valid for the superpixel. 19 * The grid over-fills the source image so every source image pixel is guaranteed to have a map. 20 */ 7 21 pswarpMapGrid *pswarpMapGridFromImage (pmReadout *dest, pmReadout *src, int nXpix, int nYpix) { 8 22 … … 41 55 } 42 56 43 // set the grid coordinate (gridX,gridY) for the given source image coordinate (ix,iy) 44 // XXX return true if the result is on the src image, false otherwise (???) 57 /** 58 * set the grid coordinate (gridX,gridY) for the given source image coordinate (ix,iy) 59 * XXX return true if the result is on the src image, false otherwise (???) 60 */ 45 61 bool pswarpMapGridSetGrid (pswarpMapGrid *grid, int ix, int iy, int *gridX, int *gridY) { 46 62 … … 51 67 } 52 68 53 // given the specified grid coordinate (gridX, gridY), return the min and max coordinates for the tile 69 /** 70 * given the specified grid coordinate (gridX, gridY), return the min and max coordinates for the tile 71 */ 54 72 bool pswarpMapGridCoordRange (pswarpMapGrid *grid, int gridX, int gridY, psPlane *min, psPlane *max) { 55 73 … … 63 81 } 64 82 65 // given the specified grid coordinate (gridX), return the x-coordinate for the source image 66 // corresponding to the next grid cell 83 /** 84 * given the specified grid coordinate (gridX), return the x-coordinate for the source image 85 * corresponding to the next grid cell 86 */ 67 87 int pswarpMapGridNextGrid_X (pswarpMapGrid *grid, int gridX) { 68 88 … … 71 91 } 72 92 73 // given the specified grid coordinate (gridY), return the y-coordinate for the source image 74 // corresponding to the next grid cell 93 /** 94 * given the specified grid coordinate (gridY), return the y-coordinate for the source image 95 * corresponding to the next grid cell 96 */ 75 97 int pswarpMapGridNextGrid_Y (pswarpMapGrid *grid, int gridY) { 76 98 … … 79 101 } 80 102 81 // measure the max error accumulated in applying one grid point to its neighbors 82 // XXX double-check this 103 /** 104 * measure the max error accumulated in applying one grid point to its neighbors 105 * XXX double-check this 106 */ 83 107 double pswarpMapGridMaxError (pswarpMapGrid *grid) { 84 108 … … 102 126 } 103 127 104 // given the source coordinate (inX,inY), return the destination coordinate (outX,outY) 128 /** 129 * given the source coordinate (inX,inY), return the destination coordinate (outX,outY) 130 */ 105 131 bool pswarpMapApply (double *outX, double *outY, pswarpMap *map, double inX, double inY) { 106 132 … … 111 137 } 112 138 113 // determine the (linear) map for the given pixel (ix,iy) from source image (src) to the destination image (dest) 114 // pixel is in src coords. input and output pixel coordinates are in the parent frame of the image (Note that the 115 // astrometric transformations are supplied for the parent image coordinate frame. 139 /** 140 * determine the (linear) map for the given pixel (ix,iy) from source image (src) to the destination image (dest) 141 * pixel is in src coords. input and output pixel coordinates are in the parent frame of the image (Note that the 142 * astrometric transformations are supplied for the parent image coordinate frame. 143 */ 116 144 bool pswarpMapSetLocalModel (pswarpMap *map, pmReadout *dest, pmReadout *src, int ix, int iy) { 117 145 … … 139 167 // XXX need to include readout->cell->chip offsets 140 168 141 / / V(0,0) position169 /** V(0,0) position */ 142 170 offset->x = ix; 143 171 offset->y = iy; … … 149 177 psPlaneTransformApply (V00, chipDest->fromFPA, FP); 150 178 151 / / V(1,0) position179 /** V(1,0) position */ 152 180 offset->x = ix + 1; 153 181 offset->y = iy; … … 159 187 psPlaneTransformApply (V10, chipDest->fromFPA, FP); 160 188 161 / / V(0,1) position189 /** V(0,1) position */ 162 190 offset->x = ix; 163 191 offset->y = iy + 1;
Note:
See TracChangeset
for help on using the changeset viewer.
