- Timestamp:
- Jul 19, 2015, 6:26:28 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20150625/Ohana/src/relastro/src/FitAstromOps.c
r38599 r38604 12 12 fitStats->Noffset = 0; 13 13 14 // container to hold the fit results (Nboot > 1 for bootstrap resampling)15 fitStats->fit = NULL; 14 fitStats->values = NULL; // pre-allocated array for median & robust sigma 15 fitStats->fit = NULL; // container to hold the fit results (Nboot > 1 for bootstrap resampling) 16 16 fitStats->Nfit = 0; 17 17 fitStats->NfitAlloc = Nboot; 18 18 if (Nboot > 0) { 19 19 ALLOCATE (fitStats->fit, FitAstromResult, Nboot); 20 ALLOCATE (fitStats->values, double, Nboot); 20 21 } 21 22 … … 31 32 32 33 // pre-allocated fit matrices for the 3 fit options 33 fitStats->fit Pos = NULL;34 fitStats->fit PM = NULL;35 fitStats->fit Par = NULL;34 fitStats->fitdataPos = NULL; 35 fitStats->fitdataPM = NULL; 36 fitStats->fitdataPar = NULL; 36 37 37 38 if (Nmax > 0) { 38 fitStats->fit Pos = FitAstromDataInit (2);39 fitStats->fit PM = FitAstromDataInit (4);40 fitStats->fit Par = FitAstromDataInit (5);39 fitStats->fitdataPos = FitAstromDataInit (2); 40 fitStats->fitdataPM = FitAstromDataInit (4); 41 fitStats->fitdataPar = FitAstromDataInit (5); 41 42 } 42 43 … … 72 73 73 74 FREE (fitStats->fit); 75 FREE (fitStats->values); 74 76 FREE (fitStats->points); 75 77 FREE (fitStats->sample); 76 78 77 FitAstromDataFree (fitStats->fit Pos);78 FitAstromDataFree (fitStats->fit PM);79 FitAstromDataFree (fitStats->fit Par);79 FitAstromDataFree (fitStats->fitdataPos); 80 FitAstromDataFree (fitStats->fitdataPM); 81 FitAstromDataFree (fitStats->fitdataPar); 80 82 81 83 free (fitStats); … … 105 107 } 106 108 107 } 108 109 void FitAstromObjectInit (FitAstromObject *object) { 109 void FitAstromPointInit (FitAstromObject *object) { 110 110 object->X = 0.0; 111 111 object->Y = 0.0; … … 125 125 } 126 126 127 void freeObjectData () {127 void FitAstromResultInit (FitAstromResult *fit) { 128 128 129 free (R); 130 free (D); 131 free (T); 132 free (X); 133 free (Y); 129 fit->Ro = 0.0; 130 fit->dRo = 0.0; 131 fit->Do = 0.0; 132 fit->dDo = 0.0; 133 fit->uR = 0.0; 134 fit->duR = 0.0; 135 fit->uD = 0.0; 136 fit->duD = 0.0; 137 fit->p = 0.0; 138 fit->dp = 0.0; 134 139 135 free (dR); 136 free (dD); 137 free (dT); 138 free (dX); 139 free (dY); 140 141 free (pX); 142 free (pY); 143 144 free (C_blue); 145 free (C_red); 146 } 147 140 fit->chisq = NAN; 141 fit->Nfit = 0; 142 143 return; 144 }
Note:
See TracChangeset
for help on using the changeset viewer.
