Changeset 2221 for trunk/psLib/src/astronomy/psCoord.c
- Timestamp:
- Oct 27, 2004, 1:31:44 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/astronomy/psCoord.c (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astronomy/psCoord.c
r2212 r2221 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.3 1$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-10-27 2 0:07:17$12 * @version $Revision: 1.32 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-10-27 23:31:43 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 24 24 #include "psCoord.h" 25 25 #include "psMemory.h" 26 #include "psAbort.h"27 26 #include "psTime.h" 28 27 #include "psConstants.h" … … 69 68 psPlaneTransform* psPlaneTransformAlloc(psS32 n1, psS32 n2) 70 69 { 70 PS_INT_CHECK_NON_NEGATIVE(n1, NULL); 71 PS_INT_CHECK_NON_NEGATIVE(n2, NULL); 72 71 73 psPlaneTransform *pt = psAlloc(sizeof(psPlaneTransform)); 72 74 pt->x = psDPolynomial2DAlloc(n1, n2, PS_POLYNOMIAL_ORD); … … 82 84 { 83 85 PS_PTR_CHECK_NULL(transform, NULL); 86 PS_PTR_CHECK_NULL(transform->x, NULL); 87 PS_PTR_CHECK_NULL(transform->y, NULL); 84 88 PS_PTR_CHECK_NULL(coords, NULL); 89 85 90 if (out == NULL) { 86 91 out = (psPlane* ) psAlloc(sizeof(psPlane)); … … 99 104 psPlaneDistort* psPlaneDistortAlloc(psS32 n1, psS32 n2, psS32 n3, psS32 n4) 100 105 { 106 PS_INT_CHECK_NON_NEGATIVE(n1, NULL); 107 PS_INT_CHECK_NON_NEGATIVE(n2, NULL); 108 PS_INT_CHECK_NON_NEGATIVE(n3, NULL); 109 PS_INT_CHECK_NON_NEGATIVE(n4, NULL); 110 101 111 psPlaneDistort *pt = psAlloc(sizeof(psPlaneDistort)); 102 112 pt->x = psDPolynomial4DAlloc(n1, n2, n3, n4, PS_POLYNOMIAL_ORD); … … 118 128 { 119 129 PS_PTR_CHECK_NULL(transform, NULL); 130 PS_PTR_CHECK_NULL(transform->x, NULL); 131 PS_PTR_CHECK_NULL(transform->y, NULL); 120 132 PS_PTR_CHECK_NULL(coords, NULL); 133 121 134 if (out == NULL) { 122 135 out = (psPlane* ) psAlloc(sizeof(psPlane)); … … 158 171 PS_PTR_CHECK_NULL(transform, NULL); 159 172 PS_PTR_CHECK_NULL(coord, NULL); 173 160 174 double sinY = 0.0; 161 175 double cosY = 0.0; … … 186 200 psSphereTransform* psSphereTransformICRSToEcliptic(psTime time) 187 201 { 202 PS_PTR_CHECK_NULL(&time, NULL); 203 188 204 struct tm *tmTime = psTimeToTM(&time); 189 205 double year = (double)(1900 + tmTime->tm_year); … … 199 215 psSphereTransform* psSphereTransformEclipticToICRS(psTime time) 200 216 { 217 PS_PTR_CHECK_NULL(&time, NULL); 218 201 219 struct tm *tmTime = psTimeToTM(&time); 202 220 double year = (double)(1900 + tmTime->tm_year); … … 223 241 XXX: Waiting for the definition of the PS_PROJ_PAR projection. 224 242 XXX: Waiting for the definition of the PS_PROJ_GLS projection. 225 XXX: get rid of the psAborts226 243 *****************************************************************************/ 227 244 psPlane* psProject(const psSphere* coord, … … 261 278 262 279 } else if (projection->type == PS_PROJ_PAR) { 263 ps Abort(__func__, "The projection type PS_PROJ_PAR is undefined.\n");280 psError(__func__, "The projection type PS_PROJ_PAR is undefined.\n"); 264 281 265 282 } else if (projection->type == PS_PROJ_GLS) { 266 ps Abort(__func__, "The projection type PS_PROJ_GLS is undefined.\n");283 psError(__func__, "The projection type PS_PROJ_GLS is undefined.\n"); 267 284 } else { 268 ps Abort(__func__, "Unknown projection type.\n");285 psError(__func__, "Unknown projection type.\n"); 269 286 } 270 287 … … 275 292 XXX: Waiting for the definition of the PS_PROJ_PAR projection. 276 293 XXX: Waiting for the definition of the PS_PROJ_GLS projection. 277 XXX: get rid of the psAborts278 294 *****************************************************************************/ 279 295 psSphere* psDeproject(const psPlane* coord, … … 317 333 318 334 } else if (projection->type == PS_PROJ_PAR) { 319 ps Abort(__func__, "The projection type PS_PROJ_PAR is undefined.\n");335 psError(__func__, "The projection type PS_PROJ_PAR is undefined.\n"); 320 336 321 337 } else if (projection->type == PS_PROJ_GLS) { 322 ps Abort(__func__, "The projection type PS_PROJ_GLG is undefined.\n");338 psError(__func__, "The projection type PS_PROJ_GLG is undefined.\n"); 323 339 } else { 324 ps Abort(__func__, "Unknown projection type.\n");340 psError(__func__, "Unknown projection type.\n"); 325 341 } 326 342 … … 391 407 } else if (unit == PS_RADIAN) {} 392 408 else { 393 ps Abort(__func__, "Unknown offset unit: 0x%x\n", unit);409 psError(__func__, "Unknown offset unit: 0x%x\n", unit); 394 410 } 395 411 396 412 return (tmp); 397 413 } 398 psAbort(__func__, "Unrecognized offset mode\n"); 414 415 psError(__func__, "Unrecognized offset mode\n"); 399 416 return (NULL); 400 417 } … … 452 469 tmpD = offset->d; 453 470 } else { 454 ps Abort(__func__, "Unknown offset unit: 0x%x\n", unit);471 psError(__func__, "Unknown offset unit: 0x%x\n", unit); 455 472 } 456 473 … … 465 482 return (tmp); 466 483 } 467 psAbort(__func__, "Unrecognized offset mode\n"); 484 485 psError(__func__, "Unrecognized offset mode\n"); 468 486 return (NULL); 469 487 }
Note:
See TracChangeset
for help on using the changeset viewer.
