Changeset 6230
- Timestamp:
- Jan 27, 2006, 3:31:44 PM (20 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 4 edited
-
astro/psCoord.c (modified) (10 diffs)
-
astro/psCoord.h (modified) (3 diffs)
-
astro/psEarthOrientation.c (modified) (2 diffs)
-
types/psPixels.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psCoord.c
r6204 r6230 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1.10 1$ $Name: not supported by cvs2svn $13 * @date $Date: 2006-01-2 6 21:10:22$12 * @version $Revision: 1.102 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-01-28 01:31:44 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 206 206 207 207 // XXX: Verify the order/nterms poly changes 208 psPlaneTransform* psPlaneTransformAlloc(int order1, int order2) 208 psPlaneTransform* psPlaneTransformAlloc(int order1, 209 int order2) 209 210 { 210 211 PS_ASSERT_INT_NONNEGATIVE(order1, NULL); … … 240 241 } 241 242 242 psPlane* psPlaneTransformApply( 243 psPlane* out, 244 const psPlaneTransform* transform, 245 const psPlane* coords) 243 psPlane* psPlaneTransformApply(psPlane* out, 244 const psPlaneTransform* transform, 245 const psPlane* coords) 246 246 { 247 247 PS_ASSERT_PTR_NON_NULL(transform, NULL); … … 267 267 268 268 // XXX: Verify the order/nterms poly changes 269 psPlaneDistort* psPlaneDistortAlloc(int order1, int order2, int order3, int order4) 269 psPlaneDistort* psPlaneDistortAlloc(int order1, 270 int order2, 271 int order3, 272 int order4) 270 273 { 271 274 PS_ASSERT_INT_NONNEGATIVE(order1, NULL); … … 347 350 } 348 351 349 psProjection* psProjectionAlloc( 350 double R, 351 double D, 352 double Xs, 353 double Ys, 354 psProjectionType type) 352 psProjection* psProjectionAlloc(double R, 353 double D, 354 double Xs, 355 double Ys, 356 psProjectionType type) 355 357 { 356 358 psProjection *p = psAlloc(sizeof(psProjection)); … … 372 374 373 375 374 psPlane* p_psProject( 375 psPlane *outPlane, 376 const psSphere* coord, 377 const psProjection* projection) 376 psPlane* p_psProject(psPlane *outPlane, 377 const psSphere* coord, 378 const psProjection* projection) 378 379 { 379 380 PS_ASSERT_PTR_NON_NULL(coord, NULL); … … 457 458 } 458 459 459 psSphere* p_psDeproject( 460 psSphere *outSphere, 461 const psPlane* coord, 462 const psProjection* projection) 460 psSphere* p_psDeproject(psSphere *outSphere, 461 const psPlane* coord, 462 const psProjection* projection) 463 463 { 464 464 PS_ASSERT_PTR_NON_NULL(coord, NULL); … … 604 604 routine far too many times. 605 605 *****************************************************************************/ 606 psPlaneTransform *psPlaneTransformCombine( 607 psPlaneTransform *out, 608 const psPlaneTransform *trans1, 609 const psPlaneTransform *trans2, 610 psRegion region, 611 int nSamples) 606 psPlaneTransform *psPlaneTransformCombine(psPlaneTransform *out, 607 const psPlaneTransform *trans1, 608 const psPlaneTransform *trans2, 609 psRegion region, 610 int nSamples) 612 611 { 613 612 psTrace(__func__, 3, "---- %s() begin ----\n", __func__); … … 1016 1015 } 1017 1016 1018 psPlane *psPlaneTransformDeriv( 1019 psPlane *out, 1020 const psPlaneTransform *transformation, 1021 const psPlane *coord 1022 ) 1017 psPlane *psPlaneTransformDeriv(psPlane *out, 1018 const psPlaneTransform *transformation, 1019 const psPlane *coord) 1023 1020 { 1024 1021 PS_ASSERT_PTR_NON_NULL(transformation, NULL); … … 1080 1077 } 1081 1078 return(out); 1079 } 1080 1081 psPixels *psPixelsTransform(psPixels *out, 1082 const psPixels *input, 1083 const psPlaneTransform *inToOut) 1084 { 1085 PS_ASSERT_PTR_NON_NULL(input, NULL); 1086 PS_ASSERT_PTR_NON_NULL(inToOut, NULL); 1087 PS_ASSERT_PTR_NON_NULL(inToOut->x, NULL); 1088 PS_ASSERT_PTR_NON_NULL(inToOut->y, NULL); 1089 if (out == NULL) { 1090 //XXX: Should the length (nalloc) be 1 and append be used everytime a pixel is added? 1091 // out = psPixelsAlloc(input->nalloc); 1092 out = psPixelsAlloc(1); 1093 } 1094 psPlane *coord = psPlaneAlloc(); 1095 psPlane *deriv = psPlaneAlloc(); 1096 psPlane *fxnVal = psPlaneAlloc(); 1097 1098 int i = 0; 1099 // int m = 0; 1100 // while (input->data.x[i] != 0.0 && input->data.y[i] != 0.0) { 1101 for ( i = 0; i < input->n; i++) { 1102 coord->x = input->data[i].x; 1103 coord->y = input->data[i].y; 1104 deriv = psPlaneTransformDeriv(deriv, inToOut, coord); 1105 fxnVal = psPlaneTransformApply(fxnVal, inToOut, coord); 1106 if (fabs(fxnVal->x - coord->x) < fabs(deriv->x) && 1107 fabs(fxnVal->y - coord->y) < fabs(deriv->y)) { 1108 int x = (int)(round(fabs(deriv->x))); 1109 int y = (int)(round(fabs(deriv->y))); 1110 for (int j = -x; j <= x; j++) { 1111 for (int k = -y; k <= y; k++) { 1112 // out->data[m].x = fxnVal->x + x; 1113 // out->data[m].y = fxnVal->y + y; 1114 // m++; 1115 out = p_psPixelsAppend(out, 1, (float)(fxnVal->x+j), 1116 (float)(fxnVal->y+k) ); 1117 } 1118 } 1119 } 1120 } 1121 1122 psFree(coord); 1123 psFree(deriv); 1124 psFree(fxnVal); 1125 return out; 1082 1126 } 1083 1127 -
trunk/psLib/src/astro/psCoord.h
r5814 r6230 11 11 * @author GLG, MHPCC 12 12 * 13 * @version $Revision: 1. 49$ $Name: not supported by cvs2svn $14 * @date $Date: 200 5-12-20 05:05:37$13 * @version $Revision: 1.50 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2006-01-28 01:31:44 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 25 25 #include "psList.h" 26 26 #include "psPolynomial.h" 27 #include "psPixels.h" 27 28 //#include "psTime.h" 28 29 … … 435 436 ); 436 437 438 /** Generates a list of pixels in the output coordinate frame that overlap the input 439 * pixels in the input coordinate frame through the specified transformation, inToOut. 440 * 441 * psPixelsTransform is more complicated than simply transforming the input pixels, 442 * but requires the evaluation of the derivatives of the transformation in order to 443 * obtain the list of all pixels in the output coordinate frame that possibly overlap 444 * the pixel in the input coordinate frame. In the event that input or inToOut are 445 * NULL, the function shall generate an error and return NULL. If out is non-NULL it 446 * shall be modified and returned; otherwise a new psPixels shall be allocated and 447 * returned. 448 * 449 * @return psPixels*: the list of overlapping pixels. 450 */ 451 psPixels *psPixelsTransform( 452 psPixels *out, ///< output list of overlapping pixels 453 const psPixels *input, ///< input list of pixels 454 const psPlaneTransform *inToOut ///< specified transformation 455 ); 456 437 457 /// @} 438 458 -
trunk/psLib/src/astro/psEarthOrientation.c
r6204 r6230 8 8 * @author Robert Daniel DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1.3 1$ $Name: not supported by cvs2svn $11 * @date $Date: 2006-01-2 6 21:10:22$10 * @version $Revision: 1.32 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2006-01-28 01:31:44 $ 12 12 * 13 13 * Copyright 2005 Maui High Performance Computing Center, University of Hawaii … … 1112 1112 // Convert psTime to MJD 1113 1113 double MJD = psTimeToMJD(time); 1114 printf("\nMJD check = %.13g\n", MJD); 1114 1115 if (MJD == NAN) { 1115 1116 psError(PS_ERR_BAD_PARAMETER_VALUE, false, -
trunk/psLib/src/types/psPixels.h
r5530 r6230 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.1 7$ $Name: not supported by cvs2svn $10 * @date $Date: 200 5-11-16 23:06:35$9 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-01-28 01:31:44 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 41 41 typedef struct 42 42 { 43 long n; ///< Number in us a43 long n; ///< Number in use 44 44 const long nalloc; ///< Number allocated 45 45 psPixelCoord* data; ///< The pixel coordinates
Note:
See TracChangeset
for help on using the changeset viewer.
