Changeset 1463
- Timestamp:
- Aug 10, 2004, 1:59:41 PM (22 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 5 edited
-
astro/psCoord.c (modified) (4 diffs)
-
astronomy/Makefile (modified) (1 diff)
-
astronomy/psAstrometry.c (modified) (13 diffs)
-
astronomy/psAstrometry.h (modified) (3 diffs)
-
astronomy/psCoord.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psCoord.c
r1440 r1463 11 11 * @author George Gusciora, MHPCC 12 12 * 13 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-08- 09 23:34:57$13 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-10 23:59:41 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 31 31 static float arg(float x, float y); 32 32 33 // This is the only function in this file which I understand. 34 psPlane* psPlaneTransformApply(psPlane* out, const psPlaneTransform* transform, const psPlane* coords) 33 psPlane* psPlaneTransformApply(psPlane* out, 34 const psPlaneTransform* transform, 35 const psPlane* coords) 35 36 { 36 37 if (out == NULL) { … … 50 51 psPlane* psPlaneDistortApply(psPlane* out, 51 52 const psPlaneDistort* transform, 52 const psPlane* coords, float term3, float term4) 53 const psPlane* coords, 54 float term3, 55 float term4) 53 56 { 54 57 if (out == NULL) { … … 59 62 (transform->x->coeff[1][0][0][0] * coords->x) + 60 63 (transform->x->coeff[0][1][0][0] * coords->y) + 61 (transform->x->coeff[0][0][1][0] * term3) + (transform->x->coeff[0][0][0][1] * term4); 64 (transform->x->coeff[0][0][1][0] * term3) + 65 (transform->x->coeff[0][0][0][1] * term4); 62 66 63 67 out->y = transform->y->coeff[0][0][0][0] + 64 68 (transform->y->coeff[1][0][0][0] * coords->x) + 65 69 (transform->y->coeff[0][1][0][0] * coords->y) + 66 (transform->y->coeff[0][0][1][0] * term3) + (transform->y->coeff[0][0][0][1] * term4); 70 (transform->y->coeff[0][0][1][0] * term3) + 71 (transform->y->coeff[0][0][0][1] * term4); 67 72 68 73 return (out); -
trunk/psLib/src/astronomy/Makefile
r1382 r1463 9 9 SRC_OBJS = psTime.o \ 10 10 psMetadata.o \ 11 psCoord.o 12 # psAstrometry.o George, this is crap code! 11 psCoord.o \ 12 psAstrometry.o 13 13 14 14 OBJS = $(addprefix makedir/,$(SRC_OBJS)) -
trunk/psLib/src/astronomy/psAstrometry.c
r1440 r1463 1 2 1 /** @file psAstrometry.c 3 2 * … … 9 8 * @author George Gusciora, MHPCC 10 9 * 11 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-08- 09 23:34:57$10 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-08-10 23:59:41 $ 13 12 * 14 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 21 20 #include "psMemory.h" 22 21 23 static void grommitFree(psGrommit* grommit);24 22 static int checkValidChipCoords(double x, double y, psChip* tmpChip); 25 23 static int checkValidImageCoords(double x, double y, psImage* tmpImage); … … 49 47 } 50 48 49 /* 50 Several members of the psGrommit data structure have no direct counterpart 51 in the psExposure structure. How are we to determine them? 52 */ 51 53 psGrommit* psGrommitAlloc(const psExposure* exp) 52 54 { … … 79 81 } 80 82 81 void p _psGrommitFree(psGrommit* grommit)83 void psGrommitFree(psGrommit* grommit) 82 84 { 83 85 psFree(grommit); … … 94 96 } 95 97 98 /* 99 XXX: do this 100 */ 96 101 int checkValidChipCoords(double x, double y, psChip* tmpChip) 97 102 { … … 120 125 } 121 126 127 /* 128 XXX: do this 129 */ 122 130 int checkValidImageCoords(double x, double y, psImage* tmpImage) 123 131 { … … 142 150 psCell* psCellinChip(psCell* out, const psPlane* coord, const psChip* chip) 143 151 { 152 int i = 0; 144 153 psPlane* tmpCoord = NULL; 145 154 psArray* cells; … … 155 164 } 156 165 157 for (i nt i= 0; i < cells->n; i++) {166 for (i = 0; i < cells->n; i++) { 158 167 psCell* tmpCell = (psCell* ) cells->data[i]; 159 168 psArray* readouts = tmpCell->readouts; … … 210 219 // transformation, as well as a few psPlane structs. Can this be implemented 211 220 // better? 212 psSphere* psCoordCelltoSky(psSphere* out, const psPlane* in, const psCell* cell) 221 psSphere* psCoordCelltoSky(psSphere* out, 222 const psPlane* in, 223 const psCell* cell) 213 224 { 214 225 psPlane* tmp1 = NULL; … … 216 227 psFPA* parFPA = (cell->parent)->parent; 217 228 psGrommit* tmpGrommit = NULL; 229 float XXX1 = 0.0; 230 float XXX2 = 0.0; 231 218 232 219 233 tmp1 = psPlaneTransformApply(tmp1, cell->toFPA, in); 220 tmp2 = psPlaneTransformApply(tmp2, parFPA->toTangentPlane, tmp1); 234 // XXX: 235 // 236 tmp2 = psPlaneDistortApply(tmp2, parFPA->toTangentPlane, tmp1, XXX1, XXX2); 221 237 tmpGrommit = psGrommitAlloc(parFPA->exposure); 222 tmp3 = psCoordTPtoSky(out, tmp2, psGrommit);223 224 238 psFree(tmp1); 225 239 psFree(tmp2); 226 240 psFree(tmpGrommit); 227 241 228 return (psCoordTPtoSky(out, tmp2, psGrommit)); 229 242 return(psCoordTPtoSky(out, tmp2, tmpGrommit)); 230 243 } 231 244 … … 247 260 psPlane* psCoordSkytoTP(psPlane* out, const psSphere* in, const psGrommit* grommit) 248 261 { 249 extern void sla_AOPQK(RAP, DAP, AOPRMS, AOB, ZOB, HOB, DOB, ROB); 250 double AOB; 251 double ZOB; 252 double HOB; 253 double DOB; 254 double ROB; 255 256 if (out == NULL) { 257 out = (psPlane* ) psAlloc(sizeof(psPlane)); 258 } 259 260 sla_AOPQK(psSphere->r, psSphere->d, *grommit, &AOB, &ZOB, &HOB, &DOB, &ROB); 261 out->x = XXX; 262 out->y = XXX; 263 return (out); 264 } 265 262 /* 263 extern void sla_AOPQK(RAP, DAP, AOPRMS, AOB, ZOB, HOB, DOB, ROB); 264 double AOB; 265 double ZOB; 266 double HOB; 267 double DOB; 268 double ROB; 269 270 if (out == NULL) { 271 out = (psPlane* ) psAlloc(sizeof(psPlane)); 272 } 273 274 sla_AOPQK(psSphere->r, psSphere->d, *grommit, &AOB, &ZOB, &HOB, &DOB, &ROB); 275 out->x = XXX; 276 out->y = XXX; 277 return (out); 278 */ 279 return(NULL); 280 } 281 282 283 /* 284 XXX: What are the XXX1 and XXX2 args supposed to be? 285 */ 266 286 psPlane* psCoordTPtoFPA(psPlane* out, const psPlane* in, const psFPA* fpa) 267 287 { 268 return (psPlaneTransformApply(out, fpa->fromTangentPlane, in)); 288 float XXX1 = 0.0; 289 float XXX2 = 0.0; 290 291 return (psPlaneDistortApply(out, fpa->fromTangentPlane, in, XXX1, XXX2)); 269 292 } 270 293 … … 281 304 psPlane* psCoordSkytoCell(psPlane* out, const psSphere* in, const psCell* cell) 282 305 { 283 out = psCoordSkytoTP(out, in, tmpGrommit); 306 psGrommit* XXXGrommit = NULL; 307 psFPA *whichFPA = NULL; 308 psChip *whichChip = NULL; 309 psCell *whichCell = NULL; 310 311 out = psCoordSkytoTP(out, in, XXXGrommit); 284 312 out = psCoordTPtoFPA(out, out, whichFPA); 285 313 out = psCoordFPAtoChip(out, out, whichChip); -
trunk/psLib/src/astronomy/psAstrometry.h
r1441 r1463 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-08- 09 23:40:54$11 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-08-10 23:59:41 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 132 132 * 133 133 * A chip consists of one or more cells (according to the number of amplifiers 134 * on the CCD). It contains a pointer to the chip's metadata, and a pointer 135 * to the parent focal plane. For astrometry, ot contains a coordinate134 * on the CCD). It contains a pointer to the chip's metadata, and a pointer 135 * to the parent focal plane. For astrometry, it contains a coordinate 136 136 * transform from the chip to the focal plane, and vis-versa. 137 137 * … … 238 238 ); 239 239 240 void psGrommitFree(psGrommit *grommit); 241 240 242 psCell* psCellinFPA(psCell* out, const psPlane* coord, const psFPA* FPA); 241 243 -
trunk/psLib/src/astronomy/psCoord.c
r1440 r1463 11 11 * @author George Gusciora, MHPCC 12 12 * 13 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-08- 09 23:34:57$13 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-10 23:59:41 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 31 31 static float arg(float x, float y); 32 32 33 // This is the only function in this file which I understand. 34 psPlane* psPlaneTransformApply(psPlane* out, const psPlaneTransform* transform, const psPlane* coords) 33 psPlane* psPlaneTransformApply(psPlane* out, 34 const psPlaneTransform* transform, 35 const psPlane* coords) 35 36 { 36 37 if (out == NULL) { … … 50 51 psPlane* psPlaneDistortApply(psPlane* out, 51 52 const psPlaneDistort* transform, 52 const psPlane* coords, float term3, float term4) 53 const psPlane* coords, 54 float term3, 55 float term4) 53 56 { 54 57 if (out == NULL) { … … 59 62 (transform->x->coeff[1][0][0][0] * coords->x) + 60 63 (transform->x->coeff[0][1][0][0] * coords->y) + 61 (transform->x->coeff[0][0][1][0] * term3) + (transform->x->coeff[0][0][0][1] * term4); 64 (transform->x->coeff[0][0][1][0] * term3) + 65 (transform->x->coeff[0][0][0][1] * term4); 62 66 63 67 out->y = transform->y->coeff[0][0][0][0] + 64 68 (transform->y->coeff[1][0][0][0] * coords->x) + 65 69 (transform->y->coeff[0][1][0][0] * coords->y) + 66 (transform->y->coeff[0][0][1][0] * term3) + (transform->y->coeff[0][0][0][1] * term4); 70 (transform->y->coeff[0][0][1][0] * term3) + 71 (transform->y->coeff[0][0][0][1] * term4); 67 72 68 73 return (out);
Note:
See TracChangeset
for help on using the changeset viewer.
