Changeset 1325
- Timestamp:
- Jul 28, 2004, 4:08:02 PM (22 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 6 edited
-
astro/psCoord.c (modified) (4 diffs)
-
astro/psCoord.h (modified) (3 diffs)
-
astronomy/psCCD.h (modified) (2 diffs)
-
astronomy/psCoord.c (modified) (4 diffs)
-
astronomy/psCoord.h (modified) (3 diffs)
-
astronomy/psCoord2.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psCoord.c
r1311 r1325 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-07-2 8 20:22:22 $12 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-07-29 02:08:02 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 146 146 } 147 147 148 psSphereTransform *psSphereTransformEcliptictoICRS( void)148 psSphereTransform *psSphereTransformEcliptictoICRS(psTime time) 149 149 { 150 150 struct tm *tmTime = psTimeToTM(time); … … 293 293 psSphereOffsetUnit unit) 294 294 { 295 psPlane *lin;295 // psPlane *lin; 296 296 psProjection proj; 297 297 psSphere *tmp; … … 312 312 proj.type = PS_PROJ_TAN; 313 313 314 lin = psProject(position2, proj);315 tmp = psDeproject(lin, proj);314 // lin = psProject(position2, proj); 315 // tmp = psDeproject(lin, proj); 316 316 317 317 // XXX: Do we need to convert units in tmp? -
trunk/psLib/src/astro/psCoord.h
r1297 r1325 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-07-2 7 05:30:55$12 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-07-29 02:08:02 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 24 24 #include "psList.h" 25 25 #include "psFunctions.h" 26 #include "psTime.h" 26 27 27 28 typedef struct … … 121 122 const psSphere *coord); 122 123 123 psSphereTransform *psSphereTransformICRStoEcliptic( void);124 psSphereTransform *psSphereTransformEcliptictoICRS( void);124 psSphereTransform *psSphereTransformICRStoEcliptic(psTime time); 125 psSphereTransform *psSphereTransformEcliptictoICRS(psTime time); 125 126 psSphereTransform *psSphereTransformICRStoGalatic(void); 126 127 psSphereTransform *psSphereTransformGalatictoICRS(void); -
trunk/psLib/src/astronomy/psCCD.h
r1239 r1325 11 11 * @author Robert DeSonia, MHPCC 12 12 * 13 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-07- 16 02:33:50$13 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-07-29 02:08:02 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 76 76 77 77 psPlaneTransform* toChip; ///< transformations from cell to chip coordinates 78 psPlaneTransform* fromChip; ///< transformations from chip to cell coordinates 78 79 psPlaneTransform* toFPA; ///< transformations from cell to FPA coordinates 79 80 psPlaneTransform* toSky; ///< transformations from cell to sky coordinates -
trunk/psLib/src/astronomy/psCoord.c
r1311 r1325 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-07-2 8 20:22:22 $12 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-07-29 02:08:02 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 146 146 } 147 147 148 psSphereTransform *psSphereTransformEcliptictoICRS( void)148 psSphereTransform *psSphereTransformEcliptictoICRS(psTime time) 149 149 { 150 150 struct tm *tmTime = psTimeToTM(time); … … 293 293 psSphereOffsetUnit unit) 294 294 { 295 psPlane *lin;295 // psPlane *lin; 296 296 psProjection proj; 297 297 psSphere *tmp; … … 312 312 proj.type = PS_PROJ_TAN; 313 313 314 lin = psProject(position2, proj);315 tmp = psDeproject(lin, proj);314 // lin = psProject(position2, proj); 315 // tmp = psDeproject(lin, proj); 316 316 317 317 // XXX: Do we need to convert units in tmp? -
trunk/psLib/src/astronomy/psCoord.h
r1297 r1325 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-07-2 7 05:30:55$12 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-07-29 02:08:02 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 24 24 #include "psList.h" 25 25 #include "psFunctions.h" 26 #include "psTime.h" 26 27 27 28 typedef struct … … 121 122 const psSphere *coord); 122 123 123 psSphereTransform *psSphereTransformICRStoEcliptic( void);124 psSphereTransform *psSphereTransformEcliptictoICRS( void);124 psSphereTransform *psSphereTransformICRStoEcliptic(psTime time); 125 psSphereTransform *psSphereTransformEcliptictoICRS(psTime time); 125 126 psSphereTransform *psSphereTransformICRStoGalatic(void); 126 127 psSphereTransform *psSphereTransformGalatictoICRS(void); -
trunk/psLib/src/astronomy/psCoord2.c
r1312 r1325 1 // This file contains 1 2 2 3 #include "psType.h" … … 53 54 54 55 for (tmpChip = FPA->chips; tmpChip != NULL; tmpChip++) { 56 tmpCoord = psPlaneTransformApply(out, tmpChip->fromFPA, coord); 57 58 55 59 //XXX if (this is the correct chip) 56 60 return(tmpChip); … … 58 62 } 59 63 64 #define PS_CHECK_VALID_IMAGE_COORDS(X, Y, IMAGE) \ 65 66 p_psCheckValidImageCoords(double x, double y, tmpImage) 67 { 68 if ((x < 0.0) || 69 (x > (double) tmpImage->numCols) || 70 (y < 0.0) || 71 (y > (double) tmpImage->numRows)) { 72 return(0); 73 } 74 return(1); 75 } 76 77 78 /***************************************************************************** 79 XXX: We assume that readouts have valid coordinates from the range 80 (0,numRows or numCols) in each dimension, and that they are square with the 81 x/y axis. 82 83 XXX: We assume that if a cell has more than one readout, all readouts have 84 the same coordinates. 85 86 XXX: if we find no cell with has this coordinate, we return NULL. 87 88 XXX: must deallocate memory. 89 *****************************************************************************/ 60 90 psCell *psCellinChip(psCell *out, 61 91 const psPlane *coord, … … 63 93 { 64 94 psCell *tmpCell = NULL; 95 psReadout *tmpReadout = NULL; 96 psPlane *tmpCoord = NULL; 65 97 66 98 for (tmpCell = chip->cells; tmpCell != NULL; tmpCell++) { 67 //XXX if (this is the correct cell) 68 return(tmpCcell); 99 if (tmpCell->readouts != NULL) { 100 tmpReadout = tmpCell->readouts; 101 tmpCoord = psPlaneTransformApply(out, tmpCell->fromChip, coord); 102 if (p_psCheckValidImageCoords(tmpCoord->x, tmpCoord->y, 103 tmpReadout->image)) { 104 return(tmpCell); 105 } 106 } 69 107 } 108 return(NULL); 70 109 } 71 110 … … 74 113 const psCell *cell) 75 114 { 76 return(psPlaneTransformApply( psPlane *out, cell->toChip, in));115 return(psPlaneTransformApply(out, cell->toChip, in)); 77 116 } 78 117 … … 81 120 const psChip *chip) 82 121 { 83 return(psPlaneTransformApply( psPlane *out, chip->toFPA, in));122 return(psPlaneTransformApply(out, chip->toFPA, in)); 84 123 } 85 124 … … 88 127 const psFPA *fpa) 89 128 { 90 return(psPlaneTransformApply( psPlane *out, fpa->toTangentPlane, in));129 return(psPlaneTransformApply(out, fpa->toTangentPlane, in)); 91 130 } 92 131 … … 101 140 const psCell *cell) 102 141 { 103 return(psPlaneTransformApply(psPlane *out, cell->toFPA, in)); 104 } 105 142 return(psPlaneTransformApply(out, cell->toFPA, in)); 143 } 144 145 146 // XXX: This implementation requires a new psGrommit be created for each 147 // transformation, as well as a few psPlane structs. Can this be implemented 148 // better? 106 149 psSphere *psCoordCelltoSky(psSphere *out, 107 150 const psPlane *in, 108 151 const psCell *cell) 109 152 { 110 if (out == NULL) { 111 out = (psSphere *) psAlloc(sizeof(psSphere)); 112 } 113 114 return(out); 115 } 116 117 psSphere *psCoordCelltoSkyQuick(psSphere *out, 118 const psPlane *in, 119 const psCell *cell) 120 { 121 if (out == NULL) { 122 out = (psSphere *) psAlloc(sizeof(psSphere)); 123 } 124 125 return(out); 126 } 127 128 psPlane *psCoordSkytoTP(psPlane *out, 129 const psSphere *in, 130 const psGrommit *grommit) 131 { 132 if (out == NULL) { 133 out = (psPlane *) psAlloc(sizeof(psPlane)); 134 } 135 136 return(out); 137 } 138 139 psPlane *psCoordTPtoFPA(psPlane *out, 140 const psPlane *in, 141 const psFPA *fpa) 142 { 143 return(psPlaneTransformApply(psPlane *out, fpa->fromTangentPlane, in)); 144 } 145 146 psPlane *psCoordFPAtoChip(psPlane *out, 147 const psPlane *in, 148 const psChip *chip) 149 { 150 151 if (out == NULL) { 152 out = (psPlane *) psAlloc(sizeof(psPlane)); 153 } 154 155 return(out); 156 } 157 158 psPlane *psCoordChiptoCell(psPlane *out, 159 const psPlane *in, 160 const psCell *cell) 161 { 162 if (out == NULL) { 163 out = (psPlane *) psAlloc(sizeof(psPlane)); 164 } 165 166 return(out); 167 } 168 169 psPlane *psCoordSkytoCell(psPlane *out, 170 const psSphere *in, 171 const psCell *cell) 172 { 173 if (out == NULL) { 174 out = (psPlane *) psAlloc(sizeof(psPlane)); 175 } 176 177 return(out); 178 } 179 180 psPlane *psCoordSkytoCellQuick(psPlane *out, 153 psPlane *tmp1 = NULL; 154 psPlane *tmp2 = NULL; 155 psFPA *parFPA = (cell->parent)->parent; 156 psGrommit *tmpGrommit = NULL; 157 158 tmp1 = psPlaneTransformApply(tmp1, cell->toFPA, in) 159 tmp2 = psPlaneTransformApply(tmp2, parFPA->toTangentPlane, tmp1) 160 tmpGrommit = psGrommitAlloc(parFPA->exposure) 161 tmp3 = psCoordTPtoSky(out, tmp2, psGrommit); 162 163 psFree(tmp1); 164 psFree(tmp2); 165 psFree(tmpGrommit); 166 167 return(psCoordTPtoSky(out, tmp2, psGrommit); 168 } 169 170 psSphere *psCoordCelltoSkyQuick(psSphere *out, 171 const psPlane *in, 172 const psCell *cell) 173 { 174 psPlane *tmp1 = NULL; 175 176 tmp1 = psPlaneTransformApply(tmp1, cell->toSky, in); 177 178 //XXX: Do something to convert the linear coords in tmp1 to spherical 179 // coords in out. 180 181 free(tmp1) 182 183 return(out); 184 } 185 186 psPlane *psCoordSkytoTP(psPlane *out, 181 187 const psSphere *in, 182 const psCell *cell) 183 { 184 if (out == NULL) { 185 out = (psPlane *) psAlloc(sizeof(psPlane)); 186 } 187 188 return(out); 189 } 190 191 188 const psGrommit *grommit) 189 { 190 if (out == NULL) { 191 out = (psPlane *) psAlloc(sizeof(psPlane)); 192 } 193 194 return(out); 195 } 196 197 psPlane *psCoordTPtoFPA(psPlane *out, 198 const psPlane *in, 199 const psFPA *fpa) 200 { 201 return(psPlaneTransformApply(out, fpa->fromTangentPlane, in)); 202 } 203 204 psPlane *psCoordFPAtoChip(psPlane *out, 205 const psPlane *in, 206 const psChip *chip) 207 { 208 return(psPlaneTransformApply(out, chip->fromFPA, in)); 209 } 210 211 212 psPlane *psCoordChiptoCell(psPlane *out, 213 const psPlane *in, 214 const psCell *cell) 215 { 216 return(psPlaneTransformApply(out, cell->fromChip, in)); 217 } 218 219 psPlane *psCoordSkytoCell(psPlane *out, 220 const psSphere *in, 221 const psCell *cell) 222 { 223 out = psCoordSkytoTP(out, in, tmpGrommit); 224 out = psCoordTPtoFPA(out, out, whichFPA); 225 out = psCoordFPAtoChip(out, out, whichChip); 226 out = psCoordChiptoCell(out, out, whichCell); 227 228 return(out); 229 } 230 231 psPlane *psCoordSkytoCellQuick(psPlane *out, 232 const psSphere *in, 233 const psCell *cell) 234 { 235 if (out == NULL) { 236 out = (psPlane *) psAlloc(sizeof(psPlane)); 237 } 238 239 return(out); 240 } 241 242
Note:
See TracChangeset
for help on using the changeset viewer.
