Changeset 38606
- Timestamp:
- Jul 20, 2015, 8:37:33 AM (11 years ago)
- Location:
- branches/eam_branches/ipp-20150625/Ohana/src
- Files:
-
- 5 edited
-
addstar/src/loadgalphot_readstars.c (modified) (4 diffs)
-
libautocode/def/average-ps1-v5.d (modified) (1 diff)
-
libdvo/src/dvo_catalog.c (modified) (1 diff)
-
libdvo/src/dvo_convert_PS1_V5.c (modified) (3 diffs)
-
relastro/src/UpdateObjects.c (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20150625/Ohana/src/addstar/src/loadgalphot_readstars.c
r38553 r38606 15 15 16 16 static float *chisqFit = NULL; 17 static float ZeroPt = 0; 17 18 18 19 GalPhot_Stars *loadgalphot_readstars (char *filename, int *nstars) { … … 67 68 namehash[i][2] = -1; 68 69 } 70 71 ZeroPt = GetZeroPoint(); 69 72 70 73 char name[256], tmpname[256]; … … 228 231 stars[i].galphot.modelType = MODEL_TYPE_gal[i]; 229 232 stars[i].galphot.detID = ID_gal[i]; 233 stars[i].galphot.phtocode = options->photcode; 230 234 231 235 // I have a grid of measurements with (Flux, dFlux, Chisq) at each point … … 377 381 378 382 // use bilinear interpolation to choose Flux @ (Xmin,Ymin)? 379 galphot->mag = -2.5*log10(flux[iMin]) ; // correct for exptime?383 galphot->mag = -2.5*log10(flux[iMin]) + ZeroPt; // correct for exptime? 380 384 galphot->magErr = sqrt(fluxErr[iMin]) / flux[iMin]; 381 385 galphot->chisq = chisqMin; -
branches/eam_branches/ipp-20150625/Ohana/src/libautocode/def/average-ps1-v5.d
r38588 r38606 69 69 FIELD catID, CAT_ID, unsigned int, unique ID for table in which object was first realized 70 70 FIELD extID, EXT_ID, uint64_t, external ID for object (eg PSPS objID) 71 FIELD extIDgc, EXT_ID_GC, uint64_t, external ID for object in galactic coords 71 72 # replace extIDgc (unused) with uRgal, uDgal: 73 # FIELD extIDgc, EXT_ID_GC, uint64_t, external ID for object in galactic coords 74 FIELD uRgal, U_RA_GAL, float, modeled proper motion based on galactic motion 75 FIELD uDgal, U_DEC_GAL, float, modeled proper motion based on galactic motion 72 76 73 77 # 4 double, 2 uint64_t, 17 float, 12 int, 6 short -
branches/eam_branches/ipp-20150625/Ohana/src/libdvo/src/dvo_catalog.c
r38595 r38606 200 200 average->catID = 0; 201 201 average->extID = 0; 202 average->extIDgc = 0; 202 203 average->uRgal = NAN; 204 average->uDgal = NAN; 203 205 } 204 206 -
branches/eam_branches/ipp-20150625/Ohana/src/libdvo/src/dvo_convert_PS1_V5.c
r38553 r38606 218 218 out[i].catID = in[i].catID; 219 219 out[i].extID = in[i].extID; 220 out[i].extIDgc = in[i].extIDgc; 220 221 out[i].uRgal = in[i].uRgal; 222 out[i].uDgal = in[i].uDgal; 221 223 } 222 224 return (out); … … 286 288 out[i].catID = in[i].catID; 287 289 out[i].extID = in[i].extID; 288 out[i].extIDgc = in[i].extIDgc; 290 291 out[i].uRgal = in[i].uRgal; 292 out[i].uDgal = in[i].uDgal; 289 293 } 290 294 return (out); … … 1318 1322 out[i].catID = in[i].catID; 1319 1323 out[i].extID = in[i].extID; 1320 out[i].extIDgc = in[i].extIDgc;1321 1324 } 1322 1325 return (out); -
branches/eam_branches/ipp-20150625/Ohana/src/relastro/src/UpdateObjects.c
r38605 r38606 42 42 UpdateObjects_Chips(average, secfilt, measure, measureBig, Nsecfilt, fitStatsChips, i, m); 43 43 } 44 if (VERBOSE2) fprintf (stderr, "catalog %d : chips "OFF_T_FMT" ave, "OFF_T_FMT" pm, "OFF_T_FMT" par : Nskip "OFF_T_FMT", Noffset "OFF_T_FMT"\n", i, fitStatsChips .Nave, fitStatsChips.Npm, fitStatsChips.Npar, fitStatsChips.Nskip, fitStatsChips.Noffset);45 if (VERBOSE2) fprintf (stderr, "catalog %d : stack "OFF_T_FMT" ave, "OFF_T_FMT" pm, "OFF_T_FMT" par : Nskip "OFF_T_FMT", Noffset "OFF_T_FMT"\n", i, fitStatsStack .Nave, fitStatsStack.Npm, fitStatsStack.Npar, fitStatsStack.Nskip, fitStatsStack.Noffset);44 if (VERBOSE2) fprintf (stderr, "catalog %d : chips "OFF_T_FMT" ave, "OFF_T_FMT" pm, "OFF_T_FMT" par : Nskip "OFF_T_FMT", Noffset "OFF_T_FMT"\n", i, fitStatsChips->Nave, fitStatsChips->Npm, fitStatsChips->Npar, fitStatsChips->Nskip, fitStatsChips->Noffset); 45 if (VERBOSE2) fprintf (stderr, "catalog %d : stack "OFF_T_FMT" ave, "OFF_T_FMT" pm, "OFF_T_FMT" par : Nskip "OFF_T_FMT", Noffset "OFF_T_FMT"\n", i, fitStatsStack->Nave, fitStatsStack->Npm, fitStatsStack->Npar, fitStatsStack->Nskip, fitStatsStack->Noffset); 46 46 FitStatsSum (fitStatsChips, sumStatsChips); 47 47 FitStatsSum (fitStatsStack, sumStatsStack); … … 51 51 FitStatsFree (fitStatsStack); 52 52 53 if (VERBOSE && (Ncatalog > 1)) fprintf (stderr, "fitted "OFF_T_FMT" objects ("OFF_T_FMT" ave, "OFF_T_FMT" pm, "OFF_T_FMT" par), skipped "OFF_T_FMT", "OFF_T_FMT" have too large an offset\n", (sumStatsChips .Nave + sumStatsChips.Npm + sumStatsChips.Npar), sumStatsChips.Nave, sumStatsChips.Npm, sumStatsChips.Npar, sumStatsChips.Nskip, sumStatsChips.Noffset);54 if (VERBOSE && (Ncatalog > 1)) fprintf (stderr, "fitted "OFF_T_FMT" objects ("OFF_T_FMT" ave, "OFF_T_FMT" pm, "OFF_T_FMT" par), skipped "OFF_T_FMT", "OFF_T_FMT" have too large an offset\n", (sumStatsStack .Nave + sumStatsStack.Npm + sumStatsStack.Npar), sumStatsStack.Nave, sumStatsStack.Npm, sumStatsStack.Npar, sumStatsStack.Nskip, sumStatsStack.Noffset);53 if (VERBOSE && (Ncatalog > 1)) fprintf (stderr, "fitted "OFF_T_FMT" objects ("OFF_T_FMT" ave, "OFF_T_FMT" pm, "OFF_T_FMT" par), skipped "OFF_T_FMT", "OFF_T_FMT" have too large an offset\n", (sumStatsChips->Nave + sumStatsChips->Npm + sumStatsChips->Npar), sumStatsChips->Nave, sumStatsChips->Npm, sumStatsChips->Npar, sumStatsChips->Nskip, sumStatsChips->Noffset); 54 if (VERBOSE && (Ncatalog > 1)) fprintf (stderr, "fitted "OFF_T_FMT" objects ("OFF_T_FMT" ave, "OFF_T_FMT" pm, "OFF_T_FMT" par), skipped "OFF_T_FMT", "OFF_T_FMT" have too large an offset\n", (sumStatsStack->Nave + sumStatsStack->Npm + sumStatsStack->Npar), sumStatsStack->Nave, sumStatsStack->Npm, sumStatsStack->Npar, sumStatsStack->Nskip, sumStatsStack->Noffset); 55 55 56 56 FitStatsFree (sumStatsChips); … … 63 63 // be called with just MeasureTiny set and Measure == NULL 64 64 int UpdateObjects_Chips (Average *average, SecFilt *secfilt, MeasureTiny *measure, Measure *measureBig, int Nsecfilt, FitStats *fitStats, int cat, off_t measOff) { 65 66 int k; 65 67 66 68 int setRefColor = areImagesMatched(); … … 82 84 // an object with no measurements is externally supplied 83 85 if (average[0].Nmeasure == 0) return TRUE; 84 85 int NcBlue = 0;86 int NcRed = 0;87 86 88 87 int mode = FIT_MODE; // start with the globally-defined fit mode … … 108 107 109 108 double Tmean, Trange, parRange; 110 UpdateObjects_Project (fitStats->points, fitStats->Npoints, &Tmean, &Trange, &parRange);109 FitAstromPoints_Project (fitStats->points, fitStats->Npoints, &Tmean, &Trange, &parRange); 111 110 112 111 // to judge the quality of the PM and PAR fits, we need to fit all three models and compare Chisq … … 131 130 for (k = 0; k < fitStats->NfitAlloc; k++) { 132 131 BootstrapResample (fitStats->sample, fitStats->points, fitStats->Npoints); 133 // XXX init fitStats->fit[k]? set fitStats->fit[k].getChisq? 134 if (!FitPM (&fitStats->fit[k], fitStats->fitPM, fitStats->sample, fitStats->Npoints)) continue; 132 if (!FitPM (&fitStats->fit[k], fitStats->fitdataPM, fitStats->sample, fitStats->Npoints)) continue; 135 133 fitStats->Nfit ++; 136 134 } … … 143 141 144 142 // project Ro, Do back to RA,DEC 145 XY_to_RD (&fitPM.Ro, &fitPM.Do, fitPM.Ro, fitPM.Do, & coords);143 XY_to_RD (&fitPM.Ro, &fitPM.Do, fitPM.Ro, fitPM.Do, &fitStats->coords); 146 144 if (XVERB) fprintf (stderr, "project: %f %f : %f %f : %f\n", fitPM.Ro, fitPM.Do, fitPM.uR, fitPM.uD, fitPM.p); 147 145 if (fabs(fitPM.Ro) < 0.01) fprintf (stderr, "watch out for 0,360 boundary\n"); … … 175 173 for (k = 0; k < fitStats->NfitAlloc; k++) { 176 174 BootstrapResample (fitStats->sample, fitStats->points, fitStats->Npoints); 177 FitPMandPar (&fitStats->fit[k], fitStats->fit Par, fitStats->sample, fitStats->Npoints);175 FitPMandPar (&fitStats->fit[k], fitStats->fitdataPar, fitStats->sample, fitStats->Npoints); 178 176 fitStats->Nfit ++; 179 177 } … … 186 184 FitAstromSetChisq (&fitPar, fitStats->points, fitStats->Npoints, FIT_PM_AND_PAR); 187 185 188 XY_to_RD (&fitPar.Ro, &fitPar.Do, fitPar.Ro, fitPar.Do, & coords);186 XY_to_RD (&fitPar.Ro, &fitPar.Do, fitPar.Ro, fitPar.Do, &fitStats->coords); 189 187 average[0].flags |= ID_STAR_FIT_PAR; 190 188 fitStats->Npar ++; … … 206 204 for (k = 0; k < fitStats->NfitAlloc; k++) { 207 205 BootstrapResample (fitStats->sample, fitStats->points, fitStats->Npoints); 208 FitPosPMfixed (&fitStats->fit[k], fitStats->fit Pos, fitStats->sample, fitStats->Npoints);206 FitPosPMfixed (&fitStats->fit[k], fitStats->fitdataPos, fitStats->sample, fitStats->Npoints); 209 207 fitStats->Nfit ++; 210 208 } … … 214 212 215 213 // project Ro, Do back to RA,DEC 216 XY_to_RD (&fitPos.Ro, &fitPos.Do, fitPos.Ro, fitPos.Do, & coords);214 XY_to_RD (&fitPos.Ro, &fitPos.Do, fitPos.Ro, fitPos.Do, &fitStats->coords); 217 215 average[0].flags |= ID_STAR_FIT_AVE; 218 216 fitStats->Nave ++; … … 286 284 287 285 // what is the offset relative to the mean fit position? 288 coords.crval1 = average[0].R;289 coords.crval2 = average[0].D;290 if (isnan( coords.crval1)) {286 fitStats->coords.crval1 = average[0].R; 287 fitStats->coords.crval2 = average[0].D; 288 if (isnan(fitStats->coords.crval1)) { 291 289 return (FALSE); 292 290 } 293 if (isnan( coords.crval2)) {291 if (isnan(fitStats->coords.crval2)) { 294 292 return (FALSE); 295 293 } 296 294 297 295 double dXoff, dYoff; 298 RD_to_XY (&dXoff, &dYoff, fit.Ro, fit.Do, & coords);296 RD_to_XY (&dXoff, &dYoff, fit.Ro, fit.Do, &fitStats->coords); 299 297 float dPos = hypot (dXoff, dYoff); 300 298 if (dPos > MaxMeanOffset) { 301 299 if (fitStats->Noffset < 100) { 302 fprintf (stderr, "(%f,%f) -> (%f,%f) (%f,%f)\n", coords.crval1,coords.crval2, fit.Ro, fit.Do, dXoff, dYoff);300 fprintf (stderr, "(%f,%f) -> (%f,%f) (%f,%f)\n", fitStats->coords.crval1, fitStats->coords.crval2, fit.Ro, fit.Do, dXoff, dYoff); 303 301 } 304 302 fitStats->Noffset ++; … … 333 331 average[0].ChiSqPar = fitPar.chisq; 334 332 335 average[0].Tmean = (Tmean * 86400 * 365.25) + T2000;333 average[0].Tmean = (Tmean * 86400 * 365.25) + fitStats->T2000; 336 334 average[0].Trange = (Trange * 86400 * 365.25); 337 335 average[0].Npos = fit.Nfit; … … 456 454 457 455 // what is the offset relative to the mean fit position? 458 coords.crval1 = average[0].R;459 coords.crval2 = average[0].D;456 fitStats->coords.crval1 = average[0].R; 457 fitStats->coords.crval2 = average[0].D; 460 458 461 459 double dXoff, dYoff; 462 RD_to_XY (&dXoff, &dYoff, fitAve.Ro, fitAve.Do, & coords);460 RD_to_XY (&dXoff, &dYoff, fitAve.Ro, fitAve.Do, &fitStats->coords); 463 461 float dPos = hypot (dXoff, dYoff); 464 462 if (dPos > MaxMeanOffset) { 465 463 if (fitStats->Noffset < 100) { 466 fprintf (stderr, "(%f,%f) -> (%f,%f) (%f,%f)\n", coords.crval1,coords.crval2, fitAve.Ro, fitAve.Do, dXoff, dYoff);464 fprintf (stderr, "(%f,%f) -> (%f,%f) (%f,%f)\n", fitStats->coords.crval1, fitStats->coords.crval2, fitAve.Ro, fitAve.Do, dXoff, dYoff); 467 465 } 468 466 fitStats->Noffset ++; … … 490 488 for (k = 0; k < average[0].Nmeasure; k++) { 491 489 492 if ( XVERB) {490 if (0) { 493 491 char *date = ohana_sec_to_date (measure[k].t); 494 492 int dbFlagsBig = measureBig ? measureBig[k].dbFlags : 0; … … 520 518 // mark (as POOR) any measurements which are deviant from the mean by > ExcludeBogusRadius 521 519 if (ExcludeBogus) { 522 coords.crval1 = average[0].R;523 coords.crval2 = average[0].D;520 fitStats->coords.crval1 = average[0].R; 521 fitStats->coords.crval2 = average[0].D; 524 522 double Xi, Yi; 525 RD_to_XY (&Xi, &Yi, Ri, Di, & coords);523 RD_to_XY (&Xi, &Yi, Ri, Di, &fitStats->coords); 526 524 double radius = hypot(Xi, Yi); 527 525 if (radius > ExcludeBogusRadius) { … … 546 544 // measure[k].t is UNIX seconds, T2000 is UNIX seconds for J2000. 547 545 // T[] is time in years since J2000 (jd = 2451545) 548 points[Npoints].T = (measure[k].t - T2000) / (86400*365.25) ; // time relative to J2000 in years546 points[Npoints].T = (measure[k].t - fit->T2000) / (86400*365.25) ; // time relative to J2000 in years 549 547 550 548 // add measured systematic error in quadrature? only do this after the fit has
Note:
See TracChangeset
for help on using the changeset viewer.
