Changeset 1440 for trunk/psLib/src/astronomy/psAstrometry.c
- Timestamp:
- Aug 9, 2004, 1:34:58 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/astronomy/psAstrometry.c (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astronomy/psAstrometry.c
r1407 r1440 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-08-0 7 00:06:06$11 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-08-09 23:34:57 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 21 21 #include "psMemory.h" 22 22 23 static void grommitFree(psGrommit * grommit);24 static int checkValidChipCoords(double x, double y, psChip * tmpChip);25 static int checkValidImageCoords(double x, double y, psImage * tmpImage);26 27 psExposure *psExposureAlloc(double ra, double dec, double hourAngle,23 static void grommitFree(psGrommit* grommit); 24 static int checkValidChipCoords(double x, double y, psChip* tmpChip); 25 static int checkValidImageCoords(double x, double y, psImage* tmpImage); 26 27 psExposure* psExposureAlloc(double ra, double dec, double hourAngle, 28 28 double zenith, double azimuth, double localTime, float date, 29 29 float rotAngle, float temperature, float pressure, float humidity, 30 30 float exposureTime) 31 31 { 32 psExposure *exp = psAlloc(sizeof(psExposure));32 psExposure* exp = psAlloc(sizeof(psExposure)); 33 33 34 34 *(double *)&exp->ra = ra; … … 49 49 } 50 50 51 psGrommit *psGrommitAlloc(const psExposure* exp)51 psGrommit* psGrommitAlloc(const psExposure* exp) 52 52 { 53 53 double *slaGrommit = (double *)psAlloc(14 * sizeof(double)); 54 psGrommit *grommit = (psGrommit *) psAlloc(sizeof(psGrommit));54 psGrommit* grommit = (psGrommit* ) psAlloc(sizeof(psGrommit)); 55 55 56 56 /* … … 79 79 } 80 80 81 void p_psGrommitFree(psGrommit * grommit)81 void p_psGrommitFree(psGrommit* grommit) 82 82 { 83 83 psFree(grommit); 84 84 } 85 85 86 psCell *psCellinFPA(psCell * out, const psPlane * coord, const psFPA* FPA)87 { 88 psChip *tmpChip = NULL;89 psCell *tmpCell = NULL;86 psCell* psCellinFPA(psCell* out, const psPlane* coord, const psFPA* FPA) 87 { 88 psChip* tmpChip = NULL; 89 psCell* tmpCell = NULL; 90 90 91 91 tmpChip = psChipinFPA(tmpChip, coord, FPA); … … 94 94 } 95 95 96 int checkValidChipCoords(double x, double y, psChip * tmpChip)96 int checkValidChipCoords(double x, double y, psChip* tmpChip) 97 97 { 98 98 return (0); 99 99 } 100 100 101 psChip *psChipinFPA(psChip * out, const psPlane * coord, const psFPA* FPA)102 { 103 psArray *chips = FPA->chips;101 psChip* psChipinFPA(psChip* out, const psPlane* coord, const psFPA* FPA) 102 { 103 psArray* chips = FPA->chips; 104 104 int nChips = chips->n; 105 psPlane *tmpCoord = NULL;105 psPlane* tmpCoord = NULL; 106 106 107 107 for (int i = 0; i < nChips; i++) { 108 psChip *tmpChip = chips->data[i];108 psChip* tmpChip = chips->data[i]; 109 109 110 110 tmpCoord = psPlaneTransformApply(tmpCoord, tmpChip->fromFPA, coord); … … 120 120 } 121 121 122 int checkValidImageCoords(double x, double y, psImage * tmpImage)122 int checkValidImageCoords(double x, double y, psImage* tmpImage) 123 123 { 124 124 if ((x < 0.0) || (x > (double)tmpImage->numCols) || (y < 0.0) || (y > (double)tmpImage->numRows)) { … … 140 140 XXX: must deallocate memory. 141 141 *****************************************************************************/ 142 psCell *psCellinChip(psCell * out, const psPlane * coord, const psChip* chip)143 { 144 psPlane *tmpCoord = NULL;145 psArray *cells;142 psCell* psCellinChip(psCell* out, const psPlane* coord, const psChip* chip) 143 { 144 psPlane* tmpCoord = NULL; 145 psArray* cells; 146 146 147 147 if (chip == NULL) { … … 156 156 157 157 for (int i = 0; i < cells->n; i++) { 158 psCell *tmpCell = (psCell *) cells->data[i];159 psArray *readouts = tmpCell->readouts;158 psCell* tmpCell = (psCell* ) cells->data[i]; 159 psArray* readouts = tmpCell->readouts; 160 160 161 161 if (readouts != NULL) { 162 162 for (int j = 0; j < readouts->n; j++) { 163 psReadout *tmpReadout = readouts->data[j];163 psReadout* tmpReadout = readouts->data[j]; 164 164 165 165 tmpCoord = psPlaneTransformApply(tmpCoord, tmpCell->fromChip, coord); … … 173 173 } 174 174 175 psPlane *psCoordCelltoChip(psPlane * out, const psPlane * in, const psCell* cell)175 psPlane* psCoordCelltoChip(psPlane* out, const psPlane* in, const psCell* cell) 176 176 { 177 177 return (psPlaneTransformApply(out, cell->toChip, in)); 178 178 } 179 179 180 psPlane *psCoordChipToFPA(psPlane * out, const psPlane * in, const psChip* chip)180 psPlane* psCoordChipToFPA(psPlane* out, const psPlane* in, const psChip* chip) 181 181 { 182 182 return (psPlaneTransformApply(out, chip->toFPA, in)); 183 183 } 184 184 185 psPlane *psCoordFPAtoTP(psPlane * out, const psPlane * in, const psFPA* fpa)185 psPlane* psCoordFPAtoTP(psPlane* out, const psPlane* in, const psFPA* fpa) 186 186 { 187 187 // XXX: This code doesn't work; fpa->toTangentPlane is of the wrong type. … … 191 191 192 192 // XXX: must wrap SLA_QAPQK here. 193 psSphere *psCoordTPtoSky(psSphere * out, const psPlane * in, const psGrommit* grommit)193 psSphere* psCoordTPtoSky(psSphere* out, const psPlane* in, const psGrommit* grommit) 194 194 { 195 195 /* … … 202 202 } 203 203 204 psPlane *psCoordCellToFPA(psPlane * out, const psPlane * in, const psCell* cell)204 psPlane* psCoordCellToFPA(psPlane* out, const psPlane* in, const psCell* cell) 205 205 { 206 206 return (psPlaneTransformApply(out, cell->toFPA, in)); … … 210 210 // transformation, as well as a few psPlane structs. Can this be implemented 211 211 // better? 212 psSphere *psCoordCelltoSky(psSphere * out, const psPlane * in, const psCell* cell)213 { 214 psPlane *tmp1 = NULL;215 psPlane *tmp2 = NULL;216 psFPA *parFPA = (cell->parent)->parent;217 psGrommit *tmpGrommit = NULL;212 psSphere* psCoordCelltoSky(psSphere* out, const psPlane* in, const psCell* cell) 213 { 214 psPlane* tmp1 = NULL; 215 psPlane* tmp2 = NULL; 216 psFPA* parFPA = (cell->parent)->parent; 217 psGrommit* tmpGrommit = NULL; 218 218 219 219 tmp1 = psPlaneTransformApply(tmp1, cell->toFPA, in); … … 230 230 } 231 231 232 psSphere *psCoordCelltoSkyQuick(psSphere * out, const psPlane * in, const psCell* cell)233 { 234 psPlane *tmp1 = NULL;232 psSphere* psCoordCelltoSkyQuick(psSphere* out, const psPlane* in, const psCell* cell) 233 { 234 psPlane* tmp1 = NULL; 235 235 236 236 tmp1 = psPlaneTransformApply(tmp1, cell->toSky, in); … … 245 245 246 246 // XXX: must wrap SLA_AOPQK here. 247 psPlane *psCoordSkytoTP(psPlane * out, const psSphere * in, const psGrommit* grommit)247 psPlane* psCoordSkytoTP(psPlane* out, const psSphere* in, const psGrommit* grommit) 248 248 { 249 249 extern void sla_AOPQK(RAP, DAP, AOPRMS, AOB, ZOB, HOB, DOB, ROB); … … 255 255 256 256 if (out == NULL) { 257 out = (psPlane *) psAlloc(sizeof(psPlane));257 out = (psPlane* ) psAlloc(sizeof(psPlane)); 258 258 } 259 259 … … 264 264 } 265 265 266 psPlane *psCoordTPtoFPA(psPlane * out, const psPlane * in, const psFPA* fpa)266 psPlane* psCoordTPtoFPA(psPlane* out, const psPlane* in, const psFPA* fpa) 267 267 { 268 268 return (psPlaneTransformApply(out, fpa->fromTangentPlane, in)); 269 269 } 270 270 271 psPlane *psCoordFPAtoChip(psPlane * out, const psPlane * in, const psChip* chip)271 psPlane* psCoordFPAtoChip(psPlane* out, const psPlane* in, const psChip* chip) 272 272 { 273 273 return (psPlaneTransformApply(out, chip->fromFPA, in)); 274 274 } 275 275 276 psPlane *psCoordChiptoCell(psPlane * out, const psPlane * in, const psCell* cell)276 psPlane* psCoordChiptoCell(psPlane* out, const psPlane* in, const psCell* cell) 277 277 { 278 278 return (psPlaneTransformApply(out, cell->fromChip, in)); 279 279 } 280 280 281 psPlane *psCoordSkytoCell(psPlane * out, const psSphere * in, const psCell* cell)281 psPlane* psCoordSkytoCell(psPlane* out, const psSphere* in, const psCell* cell) 282 282 { 283 283 out = psCoordSkytoTP(out, in, tmpGrommit); … … 289 289 } 290 290 291 psPlane *psCoordSkytoCellQuick(psPlane * out, const psSphere * in, const psCell* cell)291 psPlane* psCoordSkytoCellQuick(psPlane* out, const psSphere* in, const psCell* cell) 292 292 { 293 293 if (out == NULL) { 294 out = (psPlane *) psAlloc(sizeof(psPlane));295 } 296 297 return (out); 298 } 294 out = (psPlane* ) psAlloc(sizeof(psPlane)); 295 } 296 297 return (out); 298 }
Note:
See TracChangeset
for help on using the changeset viewer.
