- Timestamp:
- Jun 25, 2009, 2:00:56 PM (17 years ago)
- Location:
- branches/eam_branches/20090522
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
magic/remove/src (modified) (1 prop)
-
magic/remove/src/streaksastrom.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090522
- Property svn:mergeinfo changed
-
branches/eam_branches/20090522/magic/remove/src
- Property svn:ignore
-
old new 3 3 streakscompare 4 4 streaksrelease 5 makefile
-
- Property svn:ignore
-
branches/eam_branches/20090522/magic/remove/src/streaksastrom.c
r21437 r24557 150 150 151 151 bool 152 SkyToLocal(strkPt *outPt, strkAstrom *astrom, double ra, double dec) 153 { 154 // generate a local project using the RA, DEC of the 0,0 pixel of the chip as the 155 // projection center with the same plate scale as the nominal TP->Sky astrometry. 156 157 pmFPA *fpa = (pmFPA *) astrom->fpa; 158 pmChip *chip = (pmChip *) astrom->chip; 159 160 // find the RA,DEC coords of the 0,0 pixel for this chip: 161 162 psPlane ptTP; 163 psSphere ptSky; 164 165 ptSky.r = ra; 166 ptSky.d = dec; 167 ptSky.rErr = 0.0; 168 ptSky.dErr = 0.0; 169 170 psProject(&ptTP, &ptSky, fpa->toSky); 171 172 outPt->x = ptTP.x; 173 outPt->y = ptTP.y; 174 175 return true; 176 } 177 178 bool 179 LocalToSky(strkPt *outPt, strkAstrom *astrom, strkPt *inPt) 180 { 181 // generate a local project using the RA, DEC of the 0,0 pixel of the chip as the 182 // projection center with the same plate scale as the nominal TP->Sky astrometry. 183 184 pmFPA *fpa = (pmFPA *) astrom->fpa; 185 pmChip *chip = (pmChip *) astrom->chip; 186 187 // find the RA,DEC coords of the 0,0 pixel for this chip: 188 189 psPlane ptTP; 190 psSphere ptSky; 191 192 ptTP.x = inPt->x; 193 ptTP.y = inPt->y; 194 ptTP.xErr = 0.0; 195 ptTP.yErr = 0.0; 196 197 psDeproject(&ptSky, &ptTP, fpa->toSky); 198 199 outPt->x = ptSky.r; 200 outPt->y = ptSky.d; 201 202 return true; 203 } 204 205 bool 206 componentBounds(int *minX, int *minY, int *maxX, int *maxY, strkAstrom *astrom, int numCols, int numRows) 207 { 208 // find the bounds of the (padded) chip region in tangent-plane coordinates 209 210 pmFPA *fpa = (pmFPA *) astrom->fpa; 211 pmChip *chip = (pmChip *) astrom->chip; 212 213 psPlane ptCH, ptFP, TPo, TPx, TPy; 214 215 // coordinate of the chip center: 216 ptCH.x = 0.5*numCols; 217 ptCH.y = 0.5*numRows; 218 psPlaneTransformApply(&ptFP, chip->toFPA, &ptCH); 219 psPlaneTransformApply(&TPo, fpa->toTPA, &ptFP); 220 221 // coordinate of the chip center + dX/2: 222 ptCH.x = numCols; 223 ptCH.y = 0.5*numRows; 224 psPlaneTransformApply(&ptFP, chip->toFPA, &ptCH); 225 psPlaneTransformApply(&TPx, fpa->toTPA, &ptFP); 226 227 // coordinate of the chip center + dY/2: 228 ptCH.x = 0.5*numCols; 229 ptCH.y = numRows; 230 psPlaneTransformApply(&ptFP, chip->toFPA, &ptCH); 231 psPlaneTransformApply(&TPy, fpa->toTPA, &ptFP); 232 233 // half-lengths of the two sides in tangent-plane coords: 234 double xSize = hypot (TPx.x - TPo.x, TPx.y - TPo.y); 235 double ySize = hypot (TPy.x - TPo.x, TPy.y - TPo.y); 236 double radius = hypot (xSize, ySize); 237 238 // define the region encompassed by the radius with some padding: 239 *minX = TPo.x - 1.1*radius; 240 *minY = TPo.y - 1.1*radius; 241 *maxX = TPo.x + 1.1*radius; 242 *maxY = TPo.y + 1.1*radius; 243 244 return true; 245 } 246 247 bool 152 248 skyToCell(strkPt *outPt, strkAstrom *astrom, double ra, double dec) 153 249 {
Note:
See TracChangeset
for help on using the changeset viewer.
