Changeset 40659 for trunk/Ohana/src/opihi/mana/deimos_getobj.c
- Timestamp:
- Mar 29, 2019, 4:23:48 PM (7 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/mana/deimos_getobj.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/mana/deimos_getobj.c
r40642 r40659 63 63 64 64 float stilt = 0.0; // angle of the slit 65 66 int SaveSegments = FALSE; 67 if ((N = get_argument (argc, argv, "-save-segments"))) { 68 remove_argument (N, &argc, argv); 69 SaveSegments = TRUE; 70 } 65 71 66 72 // Input parameters: … … 194 200 float dxMax = 0; // maximum distance between sky regions 195 201 202 Vector *skyLsV = NULL, *skyLeV = NULL, *skyLfV = NULL, *skyRsV = NULL, *skyReV = NULL, *skyRfV = NULL; 203 Vector *bckLsV = NULL, *bckLeV = NULL, *bckLfV = NULL, *bckRsV = NULL, *bckReV = NULL, *bckRfV = NULL; 204 if (SaveSegments) { 205 skyLsV = SelectVector ("skyLs", ANYVECTOR, TRUE); ResetVector (skyLsV, OPIHI_FLT, Ny); 206 skyLeV = SelectVector ("skyLe", ANYVECTOR, TRUE); ResetVector (skyLeV, OPIHI_FLT, Ny); 207 skyLfV = SelectVector ("skyLf", ANYVECTOR, TRUE); ResetVector (skyLfV, OPIHI_FLT, Ny); 208 skyRsV = SelectVector ("skyRs", ANYVECTOR, TRUE); ResetVector (skyRsV, OPIHI_FLT, Ny); 209 skyReV = SelectVector ("skyRe", ANYVECTOR, TRUE); ResetVector (skyReV, OPIHI_FLT, Ny); 210 skyRfV = SelectVector ("skyRf", ANYVECTOR, TRUE); ResetVector (skyRfV, OPIHI_FLT, Ny); 211 bckLsV = SelectVector ("bckLs", ANYVECTOR, TRUE); ResetVector (bckLsV, OPIHI_FLT, Ny); 212 bckLeV = SelectVector ("bckLe", ANYVECTOR, TRUE); ResetVector (bckLeV, OPIHI_FLT, Ny); 213 bckLfV = SelectVector ("bckLf", ANYVECTOR, TRUE); ResetVector (bckLfV, OPIHI_FLT, Ny); 214 bckRsV = SelectVector ("bckRs", ANYVECTOR, TRUE); ResetVector (bckRsV, OPIHI_FLT, Ny); 215 bckReV = SelectVector ("bckRe", ANYVECTOR, TRUE); ResetVector (bckReV, OPIHI_FLT, Ny); 216 bckRfV = SelectVector ("bckRf", ANYVECTOR, TRUE); ResetVector (bckRfV, OPIHI_FLT, Ny); 217 } 218 196 219 // loop over the y positions 197 220 for (int iy = 0; iy < Ny; iy++) { … … 211 234 dxMax = MAX (dxMax, skyX_rt[iy] - skyX_lf[iy]); // this is a constant value unless we ignore some of the pixels 212 235 // assert skyX_rt > skyX_lf ? 236 237 if (SaveSegments) { 238 skyLsV->elements.Flt[iy] = S_s_l + Xtrace; 239 skyLeV->elements.Flt[iy] = S_e_l + Xtrace; 240 skyLfV->elements.Flt[iy] = skyF_lf[iy]; 241 skyRsV->elements.Flt[iy] = S_s_r + Xtrace; 242 skyReV->elements.Flt[iy] = S_e_r + Xtrace; 243 skyRfV->elements.Flt[iy] = skyF_rt[iy]; 244 bckLsV->elements.Flt[iy] = B_s_l + Xtrace; 245 bckLeV->elements.Flt[iy] = B_e_l + Xtrace; 246 bckLfV->elements.Flt[iy] = bckF_lf[iy]; 247 bckRsV->elements.Flt[iy] = B_s_r + Xtrace; 248 bckReV->elements.Flt[iy] = B_e_r + Xtrace; 249 bckRfV->elements.Flt[iy] = bckF_rt[iy]; 250 } 213 251 } 214 252 … … 253 291 float Xtrace = Xref - Xpsf + dXtrace; 254 292 293 // include the PSF trace and restrict the fit below to portions where the profile is > 0.95 294 255 295 // now I need to find the limits of the PSF in the buffer at this iy location 256 296 for (int ipsf = 0; ipsf < Npsf; ipsf ++) { … … 267 307 float S1 = 0.0, S2 = 0.0; 268 308 for (int ipsf = 0; ipsf < Npsf; ipsf++) { 309 if (iy == 6000) { 310 fprintf (stderr, "%d : %f %f : %f\n", ipsf, tmpv[ipsf], psfV[ipsf], tmpv[ipsf]*psfV[ipsf]); 311 } 269 312 S1 += tmpv[ipsf]*psfV[ipsf]; // if we have an errorbar, include / SQ(sigv[i]) 270 313 S2 += psfV[ipsf]*psfV[ipsf]; // if we have an errorbar, include / SQ(sigv[i])
Note:
See TracChangeset
for help on using the changeset viewer.
