Changeset 2222
- Timestamp:
- Oct 27, 2004, 1:49:00 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/astronomy/psAstrometry.c (modified) (24 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astronomy/psAstrometry.c
r2221 r2222 8 8 * @author George Gusciora, MHPCC 9 9 * 10 * @version $Revision: 1.4 8$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-10-27 23: 31:43$10 * @version $Revision: 1.49 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-10-27 23:49:00 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 36 36 psImage* tmpImage) 37 37 { 38 if (tmpImage == NULL) { 39 return(0); 40 } 41 42 if ((x < 0.0) || 43 (x > (double)tmpImage->numCols) || 44 (y < 0.0) || 45 (y > (double)tmpImage->numRows)) { 38 PS_IMAGE_CHECK_NULL(tmpImage, 0); 39 40 if ((x < 0.0) || (x > (double)tmpImage->numCols) || 41 (y < 0.0) || (y > (double)tmpImage->numRows)) { 46 42 return (0); 47 43 } … … 57 53 static psS32 isProjectionLinear(psPlaneTransform *transform) 58 54 { 59 int i = 0;60 55 PS_PTR_CHECK_NULL(transform, 0); 56 PS_PTR_CHECK_NULL(transform->x, 0); 57 PS_PTR_CHECK_NULL(transform->y, 0); 58 59 int i; 61 60 62 61 for (i=2;i<(transform->x->nX);i++) { … … 106 105 static psPlaneTransform *invertPlaneTransform(psPlaneTransform *transform) 107 106 { 107 PS_PTR_CHECK_NULL(transform, 0); 108 PS_PTR_CHECK_NULL(transform->x, 0); 109 PS_PTR_CHECK_NULL(transform->y, 0); 110 108 111 double A = transform->x->coeff[0][0]; 109 112 double B = transform->x->coeff[1][0]; … … 113 116 double F = transform->y->coeff[0][1]; 114 117 115 PS_PTR_CHECK_NULL(transform, NULL);116 118 psPlaneTransform *out = psAlloc(sizeof(psPlaneTransform)); 117 119 … … 210 212 /* FUNCTION IMPLEMENTATION - PUBLIC */ 211 213 /*****************************************************************************/ 212 213 214 214 215 /* … … 286 287 { 287 288 PS_PTR_CHECK_NULL(observatory, NULL); 289 288 290 psExposure* exp = psAlloc(sizeof(psExposure)); 289 290 291 *(double *)&exp->ra = ra; 291 292 *(double *)&exp->dec = dec; … … 345 346 const psExposure* exp) 346 347 { 348 PS_INT_CHECK_NON_NEGATIVE(nChips, NULL); 349 347 350 psFPA* newFPA = psAlloc(sizeof(psFPA)); 348 351 … … 386 389 psFPA *parentFPA) 387 390 { 391 PS_INT_CHECK_NON_NEGATIVE(nCells, NULL); 392 388 393 psChip* chip = psAlloc(sizeof(psChip)); 389 394 … … 414 419 psChip* parentChip) 415 420 { 421 PS_INT_CHECK_NON_NEGATIVE(nReadouts, NULL); 422 416 423 psCell* cell = psAlloc(sizeof(psCell)); 417 424 … … 443 450 const psImage* image) 444 451 { 452 PS_INT_CHECK_NON_NEGATIVE(col0, NULL); 453 PS_INT_CHECK_NON_NEGATIVE(row0, NULL); 454 445 455 psReadout* readout = psAlloc(sizeof(psReadout)); 446 456 … … 494 504 PS_PTR_CHECK_NULL(fpaCoord, NULL); 495 505 PS_PTR_CHECK_NULL(FPA, NULL); 506 496 507 psChip* tmpChip = NULL; 497 508 psPlane chipCoord; … … 519 530 PS_PTR_CHECK_NULL(FPA, NULL); 520 531 PS_PTR_CHECK_NULL(FPA->chips, NULL); 532 521 533 psArray* chips = FPA->chips; 522 534 psS32 nChips = chips->n; … … 530 542 for (psS32 i = 0; i < nChips; i++) { 531 543 psChip* tmpChip = chips->data[i]; 544 PS_PTR_CHECK_NULL(tmpChip, NULL); 545 PS_PTR_CHECK_NULL(tmpChip->fromFPA, NULL); 546 532 547 psPlaneTransformApply(&chipCoord, tmpChip->fromFPA, fpaCoord); 533 548 … … 561 576 for (psS32 i = 0; i < cells->n; i++) { 562 577 psCell* tmpCell = (psCell* ) cells->data[i]; 578 PS_PTR_CHECK_NULL(tmpCell, NULL); 579 PS_PTR_CHECK_NULL(tmpCell->fromChip, NULL); 563 580 psArray* readouts = tmpCell->readouts; 564 581 … … 566 583 for (psS32 j = 0; j < readouts->n; j++) { 567 584 psReadout* tmpReadout = readouts->data[j]; 585 PS_READOUT_CHECK_NULL(tmpReadout, NULL); 568 586 569 587 psPlaneTransformApply(&cellCoord, … … 657 675 PS_PTR_CHECK_NULL(cellCoord, NULL); 658 676 PS_PTR_CHECK_NULL(cell, NULL); 677 PS_PTR_CHECK_NULL(cell->toFPA, NULL); 678 PS_PTR_CHECK_NULL(cell->parent, NULL); 679 PS_PTR_CHECK_NULL(cell->parent->parent, NULL); 680 PS_PTR_CHECK_NULL(cell->parent->parent->toTangentPlane, NULL); 681 PS_PTR_CHECK_NULL(cell->parent->parent->exposure, NULL); 659 682 660 683 psPlane* fpaCoord = NULL; … … 689 712 PS_PTR_CHECK_NULL(cellCoord, NULL); 690 713 PS_PTR_CHECK_NULL(cell, NULL); 714 PS_PTR_CHECK_NULL(cell->toTP, NULL); 715 PS_PTR_CHECK_NULL(cell->parent, NULL); 716 PS_PTR_CHECK_NULL(cell->parent->parent, NULL); 717 PS_PTR_CHECK_NULL(cell->parent->parent->projection, NULL); 691 718 692 719 psPlane *tpCoord = NULL; … … 700 727 701 728 // Determine the tangent plane coordinates. 702 tpCoord = psPlaneTransformApply( tpCoord, cell->toTP, cellCoord);729 tpCoord = psPlaneTransformApply(NULL, cell->toTP, cellCoord); 703 730 704 731 // Save the old projection type and set the new projection type to TAN. … … 746 773 PS_PTR_CHECK_NULL(tpCoord, NULL); 747 774 PS_PTR_CHECK_NULL(fpa, NULL); 775 PS_PTR_CHECK_NULL(fpa->fromTangentPlane, NULL); 748 776 749 777 return (psPlaneDistortApply(fpaCoord, fpa->fromTangentPlane, … … 757 785 PS_PTR_CHECK_NULL(fpaCoord, NULL); 758 786 PS_PTR_CHECK_NULL(chip, NULL); 759 PS_PTR_CHECK_NULL(chip-> parent, NULL);787 PS_PTR_CHECK_NULL(chip->fromFPA, NULL); 760 788 761 789 chipCoord = psPlaneTransformApply(chipCoord, chip->fromFPA, fpaCoord); … … 769 797 PS_PTR_CHECK_NULL(chipCoord, NULL); 770 798 PS_PTR_CHECK_NULL(cell, NULL); 771 PS_PTR_CHECK_NULL(cell-> parent, NULL);799 PS_PTR_CHECK_NULL(cell->fromChip, NULL); 772 800 773 801 cellCoord = psPlaneTransformApply(cellCoord, cell->fromChip, chipCoord); … … 783 811 PS_PTR_CHECK_NULL(skyCoord, NULL); 784 812 PS_PTR_CHECK_NULL(cell, NULL); 813 PS_PTR_CHECK_NULL(cell->parent, NULL); 814 PS_PTR_CHECK_NULL(cell->parent->parent, NULL); 815 PS_PTR_CHECK_NULL(cell->parent->parent->grommit, NULL); 785 816 786 817 psChip *parChip = cell->parent; … … 814 845 PS_PTR_CHECK_NULL(skyCoord, NULL); 815 846 PS_PTR_CHECK_NULL(cell, NULL); 847 PS_PTR_CHECK_NULL(cell->parent, NULL); 848 PS_PTR_CHECK_NULL(cell->parent->parent, NULL); 849 PS_PTR_CHECK_NULL(cell->parent->parent->projection, NULL); 850 PS_PTR_CHECK_NULL(cell->toTP, NULL); 816 851 817 852 psPlane *tpCoord = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.
