Changeset 25105 for branches/eam_branches/20090715/psphot/src/pmPetrosian.c
- Timestamp:
- Aug 18, 2009, 6:24:53 AM (17 years ago)
- Location:
- branches/eam_branches/20090715/psphot/src
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
pmPetrosian.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090715/psphot/src
- Property svn:ignore
-
old new 18 18 psphotVersionDefinitions.h 19 19 psphotMomentsStudy 20 psphotPetrosianStudy
-
- Property svn:ignore
-
branches/eam_branches/20090715/psphot/src/pmPetrosian.c
r25032 r25105 11 11 # include "psphotInternal.h" 12 12 13 static void pmPetrosianFree(pmPetrosian *petro )13 static void pmPetrosianFree(pmPetrosian *petrosian) 14 14 { 15 if (!petro) {15 if (!petrosian) { 16 16 return; 17 } 18 psFree(petrosian->radii); 19 psFree(petrosian->fluxes); 20 psFree(petrosian->theta); 21 psFree(petrosian->isophotalRadii); 17 } 18 psFree(petrosian->radii); 19 psFree(petrosian->fluxes); 20 psFree(petrosian->theta); 21 psFree(petrosian->isophotalRadii); 22 23 psFree(petrosian->radiusElliptical); 24 psFree(petrosian->fluxElliptical); 25 26 psFree(petrosian->binnedFlux); 27 psFree(petrosian->radialBins); 28 psFree(petrosian->area); 22 29 } 23 30 … … 32 39 petrosian->isophotalRadii = NULL; 33 40 34 petrosian->axes = {0.0, 0.0, 0.0}; 41 petrosian->radiusElliptical = NULL; 42 petrosian->fluxElliptical = NULL; 35 43 36 return(petrosian); 44 petrosian->radialBins = NULL; 45 petrosian->area = NULL; 46 petrosian->binnedFlux = NULL; 47 48 petrosian->petrosianRadius = NAN; 49 petrosian->petrosianFlux = NAN; 50 51 // petrosian->axes = {0.0, 0.0, 0.0}; 52 53 return petrosian; 37 54 } 38 55 56 bool psphotPetrosianFreeVectors(pmPetrosian *petrosian) { 57 58 psFree(petrosian->radii); 59 psFree(petrosian->fluxes); 60 psFree(petrosian->theta); 61 psFree(petrosian->isophotalRadii); 62 63 psFree(petrosian->radiusElliptical); 64 psFree(petrosian->fluxElliptical); 65 66 psFree(petrosian->binnedFlux); 67 psFree(petrosian->radialBins); 68 psFree(petrosian->area); 69 70 petrosian->radii = NULL; 71 petrosian->fluxes = NULL; 72 petrosian->theta = NULL; 73 petrosian->isophotalRadii = NULL; 74 75 petrosian->radiusElliptical = NULL; 76 petrosian->fluxElliptical = NULL; 77 78 petrosian->radialBins = NULL; 79 petrosian->area = NULL; 80 petrosian->binnedFlux = NULL; 81 82 return true; 83 } 84 85 # define COMPARE_INDEX(A,B) (index->data.F32[A] < index->data.F32[B]) 86 # define SWAP_INDEX(TYPE,A,B) { \ 87 float tmp; \ 88 if (A != B) { \ 89 tmp = index->data.F32[A]; \ 90 index->data.F32[A] = index->data.F32[B]; \ 91 index->data.F32[B] = tmp; \ 92 tmp = extra->data.F32[A]; \ 93 extra->data.F32[A] = extra->data.F32[B]; \ 94 extra->data.F32[B] = tmp; \ 95 } \ 96 } 97 98 bool psphotPetrosianSortPair (psVector *index, psVector *extra) { 99 100 // sort the vector set by the radius 101 PSSORT (index->n, COMPARE_INDEX, SWAP_INDEX, NONE); 102 return true; 103 }
Note:
See TracChangeset
for help on using the changeset viewer.
