Changeset 13141
- Timestamp:
- May 2, 2007, 2:20:32 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/addstar/src/calibrate.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/src/calibrate.c
r12332 r13141 42 42 43 43 /* use the linked list to navigate the measures; safe for unsorted measures */ 44 void AddToCalibration (Average *average, Measure *measure, Measure *new, int *next, int Nstar) {45 46 int i, j, m, found0, found1, found2;44 void AddToCalibration (Average *average, SecFilt *secfilt, Measure *measure, Measure *new, int *next, int Nstar) { 45 46 int i, j, m, Nsec, found0, found1, found2; 47 47 float CalM0, CalM1, CalM2, dCalM; 48 float Mcal, color, factor ;48 float Mcal, color, factor, Minst; 49 49 short CalC0, CalC1, CalC2; 50 50 … … 66 66 if (InternalCal) { 67 67 CalC0 = incode[0].code; 68 Nsec = GetPhotcodeNsec (CalC0); 68 69 } else { 69 70 CalC0 = excode[0].code; 70 } 71 Nsec = GetPhotcodeNsec (CalC0); 72 } 73 /* check if this reference code is an average magnitude */ 74 if (Nsec != -1) { 75 CalM0 = secfilt[Nsec].M; 76 dCalM = secfilt[Nsec].dM; 77 found0 = TRUE; 78 } 79 71 80 CalC1 = mycode[0].c1; 81 Nsec = GetPhotcodeNsec (CalC1); 82 if (Nsec != -1) { 83 CalM1 = secfilt[Nsec].M; 84 found1 = TRUE; 85 } 86 72 87 CalC2 = mycode[0].c2; 88 Nsec = GetPhotcodeNsec (CalC2); 89 if (Nsec != -1) { 90 CalM2 = secfilt[Nsec].M; 91 found2 = TRUE; 92 } 93 94 if (!CalC1 && !CalC2) { 95 found1 = found2 = TRUE; 96 CalM1 = CalM2 = 0.0; 97 } 73 98 74 99 m = average[0].offset; … … 99 124 } 100 125 // if we want to apply a Mcal -> Mref color correction, we need the additional color term 101 SaveCalibration (Mcal, new[0].dM, CalM0, dCalM, new[0].M - ZeroPt - new[0].dt, Nstar); 126 Minst = new[0].M - ZeroPt - new[0].dt; 127 SaveCalibration (Mcal, new[0].dM, CalM0, dCalM, Minst, Nstar); 128 if ((DUMP != NULL) && !strcmp (DUMP, "cal")) { 129 fprintf (stdout, "cal-match : %10.6f %10.6f : %7.4f %6.4f %7.4f %6.4f %7.4f : %7.4f %7.4f\n", average[0].R, average[0].D, Mcal, new[0].dM, CalM0, dCalM, Minst, airmass, color); 130 } 102 131 return; 103 132 } … … 186 215 M2 = sqrt (fabs(M2/N - M1*M1)); 187 216 Mw = W1 / W2; 188 fprintf (stderr, "N: %.0f, mean: %f, wt mean: %f, stdev: %f, precision: %f\n", N, M1, Mw, M2, M2 / sqrt (N)); 217 fprintf (stdout, "STATUS: SUCCESS\n"); 218 fprintf (stdout, "ZERO_POINT_MEAN = %7.4f\n", M1); 219 fprintf (stdout, "ZERO_POINT_WTMEAN = %7.4f\n", Mw); 220 fprintf (stdout, "ZERO_POINT_STDEV = %7.4f\n", M2); 221 fprintf (stdout, "ZERO_POINT_PRECISION = %7.4f\n", M2 / sqrt (N)); 222 fprintf (stdout, "ZERO_POINT_NSTARS = %4.0f\n", N); 223 // fprintf (stderr, "N: %.0f, mean: %f, wt mean: %f, stdev: %f, precision: %f\n", N, M1, Mw, M2, M2 / sqrt (N)); 189 224 image[0].Mcal = M1; 190 225 image[0].dMcal = M2 / sqrt (N);
Note:
See TracChangeset
for help on using the changeset viewer.
