- Timestamp:
- Nov 13, 2015, 5:19:12 AM (11 years ago)
- Location:
- trunk/Ohana/src
- Files:
-
- 8 edited
-
addstar/src/loadgalphot_readstars.c (modified) (8 diffs)
-
libautocode/def/galphot-ps1-v5-r1.d (modified) (1 diff)
-
libautocode/def/galphot-ps1-v5.d (modified) (1 diff)
-
libautocode/def/galphot.d (modified) (1 diff)
-
libdvo/include/dvo.h (modified) (1 diff)
-
libdvo/src/dvo_catalog.c (modified) (1 diff)
-
libdvo/src/dvo_convert_PS1_V5.c (modified) (3 diffs)
-
libdvo/src/dvo_photcode_ops.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/src/loadgalphot_readstars.c
r39122 r39125 217 217 stars[i].found = FALSE; 218 218 219 dvo_galphot_init (&stars[i].galphot); 220 219 221 // stars[i].galphot.R = R; 220 222 // stars[i].galphot.D = D; … … 238 240 239 241 // I want to use this flag to set a bit in secfilt. is that possible? or maybe galphot.dummy becomes flags 240 if (!FitChisqMinimum (fit, &stars[i].galphot, &GAL_CHISQ[Nsample*i], &GAL_FLUX[Nsample*i], &GAL_FLUX_ERR[Nsample*i], Nsample, FR_MAJOR_MIN[i], FR_MAJOR_MAX[i], FR_MAJOR_DEL[i], FR_MINOR_MIN[i], FR_MINOR_MAX[i], FR_MINOR_DEL[i])) { 241 stars[i].flag = TRUE; 242 } 242 FitChisqMinimum (fit, &stars[i].galphot, &GAL_CHISQ[Nsample*i], &GAL_FLUX[Nsample*i], &GAL_FLUX_ERR[Nsample*i], Nsample, FR_MAJOR_MIN[i], FR_MAJOR_MAX[i], FR_MAJOR_DEL[i], FR_MINOR_MIN[i], FR_MINOR_MAX[i], FR_MINOR_DEL[i]); 243 243 244 244 // I could either multiply FR_MAJOR_MIN, etc above or the fitted values below … … 330 330 } 331 331 332 if (Nvalid < 6) goto bad_fit;332 if (Nvalid < 6) { galphot->flags |= ID_GALPHOT_TOO_FEW; goto bad_fit; } 333 333 334 334 # if (0) … … 344 344 // fit with 3 iterations, 5 sigma clipping (set above after fit2d_init) 345 345 // on failure (for any reason), the stars[i].flag is set to TRUE (XXX bad choice) 346 if (!fit2d (fit, Xpt, Ypt, chisq, chisqFit, mask, Npts)) goto bad_fit;346 if (!fit2d (fit, Xpt, Ypt, chisq, chisqFit, mask, Npts)) { galphot->flags |= ID_GALPHOT_FAIL_FIT; goto bad_fit; } 347 347 348 348 // get X,Y for the chisq min from the fit: … … 358 358 inRange = inRange && (Ymin < MinorMax + MinorDel); 359 359 360 if (!inRange) goto bad_fit;360 if (!inRange) { galphot->flags |= ID_GALPHOT_OUT_OF_RANGE; goto bad_fit; } 361 361 362 362 // chisqMin @ (Xmin,Ymin) … … 368 368 C = -1; 369 369 Q = B*B - 4*A*C; 370 if (Q < 0.0) goto bad_err; 370 if (Q < 0.0) { galphot->flags |= ID_GALPHOT_BAD_ERROR; goto bad_err; } 371 if (A <= 0.0) { galphot->flags |= ID_GALPHOT_BAD_ERROR; goto bad_err; } 371 372 372 373 float dXmin = (-B + sqrt(Q)) / (2.0 * A); … … 377 378 C = -1; 378 379 Q = B*B - 4*A*C; 379 if (Q < 0.0) goto bad_err; 380 if (Q < 0.0) { galphot->flags |= ID_GALPHOT_BAD_ERROR; goto bad_err; } 381 if (A <= 0.0) { galphot->flags |= ID_GALPHOT_BAD_ERROR; goto bad_err; } 380 382 381 383 float dYmin = (-B + sqrt(Q)) / (2.0 * A); … … 443 445 galphot->majorAxisErr = MajorDel; 444 446 galphot->minorAxisErr = MinorDel; 447 448 galphot->mag = -2.5*log10(flux[iMin]) + ZeroPt; // correct for exptime? 449 galphot->magErr = sqrt(fluxErr[iMin]) / flux[iMin]; 450 galphot->chisq = chisqMin; 445 451 return FALSE; 446 452 } -
trunk/Ohana/src/libautocode/def/galphot-ps1-v5-r1.d
r38986 r39125 26 26 27 27 FIELD averef, AVEREF, unsigned int, reference to average table 28 FIELD dummy, DUMMY, unsigned int, filler28 FIELD flags, FLAGS, unsigned int, info flags 29 29 30 30 FIELD photcode, PHOTCODE, short -
trunk/Ohana/src/libautocode/def/galphot-ps1-v5.d
r38553 r39125 26 26 27 27 FIELD averef, AVEREF, unsigned int, reference to average table 28 FIELD dummy, DUMMY, unsigned int, filler28 FIELD flags, FLAGS, unsigned int, info flags 29 29 30 30 FIELD photcode, PHOTCODE, short -
trunk/Ohana/src/libautocode/def/galphot.d
r38553 r39125 26 26 27 27 FIELD averef, AVEREF, unsigned int, reference to average table 28 FIELD dummy, DUMMY, unsigned int, filler28 FIELD flags, FLAGS, unsigned int, info flags 29 29 30 30 FIELD photcode, PHOTCODE, short -
trunk/Ohana/src/libdvo/include/dvo.h
r39047 r39125 138 138 ID_MEAS_PHOTOM_KRON = 0x00400000, // this measurement is used for the mean kron mag 139 139 } DVOMeasureFlags; 140 141 typedef enum { 142 ID_GALPHOT_FAIL_FIT = 0x00000001, // fit failed to converge or was degenerate 143 ID_GALPHOT_TOO_FEW = 0x00000002, // not enough points to fit the model 144 ID_GALPHOT_OUT_OF_RANGE = 0x00000004, // fit minimum too far outside data range 145 ID_GALPHOT_BAD_ERROR = 0x00000008, // invalid error (nan or inf) 146 } DVOGalphotFlags; 140 147 141 148 // XXX we used these names previously in markstar: replace with ID_MEAS_ARTIFACT -
trunk/Ohana/src/libdvo/src/dvo_catalog.c
r39106 r39125 552 552 galphot->imageID = -1; 553 553 galphot->averef = 0; 554 galphot->flags = 0; 554 555 555 556 galphot->photcode = 0; -
trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V5.c
r39106 r39125 1031 1031 out[i].imageID = in[i].imageID; 1032 1032 out[i].averef = in[i].averef; 1033 out[i].flags = in[i].flags; 1033 1034 out[i].photcode = in[i].photcode; 1034 1035 out[i].modelType = in[i].modelType; … … 1065 1066 out[i].imageID = in[i].imageID; 1066 1067 // out[i].averef = in[i].averef; 1068 // out[i].flags = in[i].flags; 1067 1069 out[i].photcode = in[i].photcode; 1068 1070 out[i].modelType = in[i].modelType; … … 1097 1099 out[i].imageID = in[i].imageID; 1098 1100 out[i].averef = in[i].averef; 1101 out[i].flags = in[i].flags; 1099 1102 out[i].photcode = in[i].photcode; 1100 1103 out[i].modelType = in[i].modelType; -
trunk/Ohana/src/libdvo/src/dvo_photcode_ops.c
r38986 r39125 1944 1944 } 1945 1945 1946 GALPHOT_FIELD(GAL_MAG, mag) 1947 GALPHOT_FIELD(GAL_MAG_ERR, magErr) 1948 GALPHOT_FIELD(GAL_MAJ, majorAxis) 1946 GALPHOT_FIELD(GAL_MAG, mag) 1947 GALPHOT_FIELD(GAL_MAG_ERR, magErr) 1948 GALPHOT_FIELD(GAL_MAJ, majorAxis) 1949 1949 GALPHOT_FIELD(GAL_MAJ_ERR, majorAxisErr) 1950 GALPHOT_FIELD(GAL_MIN, minorAxis) 1951 GALPHOT_FIELD(GAL_MIN_ERR, minorAxisErr) 1952 GALPHOT_FIELD(GAL_THETA, theta) 1953 GALPHOT_FIELD(GAL_THETA_ERR, thetaErr) 1950 GALPHOT_FIELD(GAL_MIN, minorAxis) 1951 GALPHOT_FIELD(GAL_MIN_ERR, minorAxisErr) 1952 GALPHOT_FIELD(GAL_THETA, theta) 1953 GALPHOT_FIELD(GAL_THETA_ERR, thetaErr) 1954 1954 GALPHOT_FIELD(GAL_INDEX, index) 1955 1955 GALPHOT_FIELD(GAL_CHISQ, chisq) 1956 1956 GALPHOT_FIELD(GAL_NPIX, Npix) 1957 GALPHOT_FIELD(GAL_FLAGS, flags) 1957 1958 GALPHOT_FIELD(GAL_TYPE, modelType)
Note:
See TracChangeset
for help on using the changeset viewer.
