Changeset 38136
- Timestamp:
- Apr 16, 2015, 4:19:35 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20150405/Ohana/src/dvolens/src/update_objects_catalog.c
r37358 r38136 11 11 int Nsecfilt = GetPhotcodeNsecfilt (); 12 12 13 float *Mxx_obj = NULL; 14 float *Mxy_obj = NULL; 15 float *Myy_obj = NULL; 16 17 ALLOCATE (Mxx_obj, float, Nsecfilt); 18 ALLOCATE (Mxy_obj, float, Nsecfilt); 19 ALLOCATE (Myy_obj, float, Nsecfilt); 20 13 21 // I think we have already allocated lensobj 14 22 REALLOCATE (catalog->lensobj, Lensobj, catalog->Naverage * Nsecfilt); … … 27 35 for (j = 0; j < Nsecfilt; j++) { 28 36 dvo_lensobj_init (&lensobj[j], TRUE); // init accumulated values to 0 37 Mxx_obj[j] = 0.0; 38 Mxy_obj[j] = 0.0; 39 Myy_obj[j] = 0.0; 29 40 } 30 41 31 42 // reset the average values 32 33 43 off_t Loff = average->lensingOffset; 34 44 off_t Moff = average->measureOffset; … … 67 77 if (measure->psfQFperf < 0.85) continue; 68 78 69 79 Mxx_obj[Nsec] += measure->Mxx; 80 Mxy_obj[Nsec] += measure->Mxy; 81 Myy_obj[Nsec] += measure->Myy; 82 70 83 lensobj[Nsec].X11_sm_obj += lensing->X11_sm_obj; 71 84 lensobj[Nsec].X12_sm_obj += lensing->X12_sm_obj; … … 101 114 lensobj[Nsec].sF_ApR6 += SQ(lensing->sF_ApR6); 102 115 lensobj[Nsec].fF_ApR6 += lensing->fF_ApR6; 116 117 lensobj[Nsec]. F_ApR7 += lensing-> F_ApR7; 118 lensobj[Nsec].dF_ApR7 += SQ(lensing->dF_ApR7); 119 lensobj[Nsec].sF_ApR7 += SQ(lensing->sF_ApR7); 120 lensobj[Nsec].fF_ApR7 += lensing->fF_ApR7; 103 121 104 122 lensobj[Nsec].Nmeas ++; … … 139 157 lensobj[j].sF_ApR5 /= Nmeas; 140 158 lensobj[j].fF_ApR5 /= Nmeas; 159 141 160 lensobj[j]. F_ApR6 /= Nmeas; 142 161 lensobj[j].dF_ApR6 /= Nmeas; … … 144 163 lensobj[j].fF_ApR6 /= Nmeas; 145 164 165 lensobj[j]. F_ApR7 /= Nmeas; 166 lensobj[j].dF_ApR7 /= Nmeas; 167 lensobj[j].sF_ApR7 /= Nmeas; 168 lensobj[j].fF_ApR7 /= Nmeas; 169 146 170 lensobj[j].dF_ApR5 = sqrt(lensobj[j].dF_ApR5); 147 171 lensobj[j].sF_ApR5 = sqrt(lensobj[j].sF_ApR5); 148 172 lensobj[j].dF_ApR6 = sqrt(lensobj[j].dF_ApR6); 149 173 lensobj[j].sF_ApR6 = sqrt(lensobj[j].sF_ApR6); 174 lensobj[j].dF_ApR7 = sqrt(lensobj[j].dF_ApR7); 175 lensobj[j].sF_ApR7 = sqrt(lensobj[j].sF_ApR7); 150 176 151 177 // somewhere in here I should calculate the values of E1, E2, and gamma 178 179 float e0 = Mxx_obj[j] + Myy_obj[j]; 180 lensobj[j].E1 = (Mxx_obj[j] - Myy_obj[j]) / e0; 181 lensobj[j].E2 = 2.0 * Mxy_obj[j] / e0; 152 182 } 153 183 … … 159 189 } 160 190 191 free (Mxx_obj); 192 free (Mxy_obj); 193 free (Myy_obj); 194 161 195 catalog->Nlensobj = Nlensobj; 162 196 catalog->Nlensobj_disk = 0;
Note:
See TracChangeset
for help on using the changeset viewer.
