- Timestamp:
- Feb 21, 2016, 9:50:41 AM (10 years ago)
- Location:
- trunk/Ohana/src/relastro
- Files:
-
- 4 edited
-
src/FitPosPMfixed.c (modified) (1 diff)
-
src/UpdateObjects.c (modified) (5 diffs)
-
src/fitobj.c (modified) (7 diffs)
-
test/mana.sh (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/relastro/src/FitPosPMfixed.c
r39364 r39367 229 229 fit->dRo = sqrt(data->A[0][0]); 230 230 fit->dDo = sqrt(data->A[1][1]); 231 fit->duR = NAN;232 fit->duD = NAN;231 fit->duR = 0.0; 232 fit->duD = 0.0; 233 233 fit->dp = 0.0; 234 234 -
trunk/Ohana/src/relastro/src/UpdateObjects.c
r39364 r39367 255 255 for (k = 0; k < fitStats->NfitAlloc; k++) { 256 256 BootstrapResample (fitStats->sample, fitStats->nomask, Nnomask); 257 if (!FitPM_Basic (&fitStats->fit[k], fitStats->fitdataPM, fitStats->sample, fitStats->Npoints)) continue;257 if (!FitPM_Basic (&fitStats->fit[k], fitStats->fitdataPM, fitStats->sample, Nnomask)) continue; 258 258 fitStats->Nfit ++; 259 259 } … … 296 296 297 297 FitAstromResultSetPM (&fitPos, 1, average); 298 // fprintf (stderr, "fit 1: %f %f : %f %f\n", fitPos.Ro, fitPos.Do, fitPos.uR, fitPos.uD); 298 299 if ((average[0].flags & ID_STAR_USE_PAR) || (average[0].flags & ID_STAR_USE_PM)) { 299 300 if (!FitPosPMfixed_Basic (&fitPos, fitStats->fitdataPos, fitStats->points, fitStats->Npoints)) { … … 301 302 } 302 303 } else { 303 FitAstromResultSetPM (&fitPos, 1, average);304 304 if (!FitPosPMfixed_IRLS (&fitPos, fitStats->fitdataPos, fitStats->points, fitStats->Npoints)) { 305 305 goto doneWithFit; 306 306 } 307 // fprintf (stderr, "fit 2: %f %f : %f %f\n", fitPos.Ro, fitPos.Do, fitPos.uR, fitPos.uD); 307 308 if (N_BOOTSTRAP_SAMPLES) { 308 309 fitStats->Nfit = 0; … … 314 315 for (k = 0; k < fitStats->NfitAlloc; k++) { 315 316 BootstrapResample (fitStats->sample, fitStats->nomask, Nnomask); 316 if (!FitPosPMfixed_Basic (&fitStats->fit[k], fitStats->fitdataPos, fitStats->sample, fitStats->Npoints)) continue;317 if (!FitPosPMfixed_Basic (&fitStats->fit[k], fitStats->fitdataPos, fitStats->sample, Nnomask)) continue; 317 318 fitStats->Nfit ++; 318 319 } … … 325 326 // project Ro, Do back to RA,DEC 326 327 XY_to_RD (&fitPos.Ro, &fitPos.Do, fitPos.Ro, fitPos.Do, &fitStats->coords); 327 if (fabs(fitP M.Ro) < 0.01) fprintf (stderr, "watch out for 0,360 boundary\n");328 if (fabs(fitPos.Ro) < 0.01) fprintf (stderr, "watch out for 0,360 boundary\n"); 328 329 329 330 average[0].flags |= ID_STAR_FIT_AVE; -
trunk/Ohana/src/relastro/src/fitobj.c
r39364 r39367 66 66 } 67 67 68 68 69 if (argc != 2) { 69 70 fprintf (stderr, "USAGE: %s (mode)\n", argv[0]); … … 72 73 exit (2); 73 74 } 75 76 FIT_MODE = FIT_NONE; 77 if (!strcasecmp(argv[1], "pos")) { 78 FIT_MODE = FIT_AVERAGE; 79 } 80 if (!strcasecmp(argv[1], "pm")) { 81 FIT_MODE = FIT_PM_ONLY; 82 } 83 if (!strcasecmp(argv[1], "plx")) { 84 FIT_MODE = FIT_PM_AND_PAR; 85 } 86 if (FIT_MODE == FIT_NONE) { 87 fprintf (stderr, "USAGE: %s (mode)\n", argv[0]); 88 fprintf (stderr, " mode: pos, pm, plx\n"); 89 fprintf (stderr, " options: -Nstars [3000], -Npoints [100], -Noutliers [10], -Nbootstrap [100]\n"); 90 exit (2); 91 } 92 93 // some relastro globals need to be set 94 N_BOOTSTRAP_SAMPLES = N_BOOTSTRAP; 95 USE_GALAXY_MODEL = TRUE; 96 MaxMeanOffset = 10.0; 74 97 75 98 // load reference table here … … 104 127 double uD = 0.5*(drand48() - 0.5); 105 128 106 double plx = 0.5*(drand48() + 0.0);129 double plx = (FIT_MODE == FIT_PM_AND_PAR) ? 0.5*(drand48() + 0.0) : 0.0; 107 130 108 131 // generate a single fake star with N_POINTS real points and N_OUTLIERS bad points … … 112 135 113 136 double Tmean = ohana_sec_to_mjd(catalog->average->Tmean); 137 double Tyear = (Tmean - MJD_J2000) / 365.25; 114 138 fprintf (stdout, "%12.8f %12.8f %8.6f %8.6f %8.6f | %12.8f %12.8f %8.6f %8.6f %8.6f | %12.8f | %8.6f %8.6f %8.6f %8.6f %8.6f %d | %f %f %f\n", 115 139 Ro, Do, uR, uD, plx, 116 catalog->average->R, catalog->average->D, catalog->average->uR, catalog->average->uD, catalog->average->P, T mean,140 catalog->average->R, catalog->average->D, catalog->average->uR, catalog->average->uD, catalog->average->P, Tyear, 117 141 catalog->average->dR, catalog->average->dD, catalog->average->duR, catalog->average->duD, catalog->average->dP, catalog->average->Npos, 118 142 catalog->average->ChiSqAve, catalog->average->ChiSqPM, catalog->average->ChiSqPar); … … 146 170 } 147 171 172 catalog->average->objID = 1; 173 catalog->average->catID = 1; 174 175 catalog->average->R = Ro; 176 catalog->average->D = Do; 177 catalog->average->uR = uR; 178 catalog->average->uD = uD; 179 catalog->average->uRgal = uR; 180 catalog->average->uDgal = uD; 148 181 for (i = 0; i < Npoints; i++) { 149 182 // ParFactor expects a time which is in years since J2000 (MJD_..._YRS is so defined) … … 162 195 catalog->measureT[i].D = Do + (dD + plx*pD + uD*(Tyears - MJD_REF_YRS))/3600; 163 196 164 catalog->measureT[i].dXccd = POS_ERROR;165 catalog->measureT[i].dYccd = POS_ERROR;197 catalog->measureT[i].dXccd = ToShortPixels(POS_ERROR); 198 catalog->measureT[i].dYccd = ToShortPixels(POS_ERROR); 166 199 167 200 catalog->measureT[i].photcode = 10233; 201 202 // nominal values to avoid dropping in MeasFilterTest 203 catalog->measureT[i].M = 20.0; 204 catalog->measureT[i].dM = 0.02; 205 catalog->measureT[i].dt = 2.5*log10(30.0); 168 206 } 169 207 … … 188 226 189 227 catalog->measureT[i].photcode = 10233; 228 229 // nominal values to avoid dropping in MeasFilterTest 230 catalog->measureT[i].M = 20.0; 231 catalog->measureT[i].dM = 0.02; 232 catalog->measureT[i].dt = 2.5*log10(30.0); 190 233 } 191 234 catalog->average->Nmeasure = Ntotal; -
trunk/Ohana/src/relastro/test/mana.sh
r39363 r39367 37 37 38 38 foreach nboot 20 30 100 300 1000 39 exec bin/fitpm.lin64 -Nstars 3000 -Noutliers 20 -Npoints 100 -Nbootstrap $nboot $1 > test.$1.dat39 exec ../bin/fitpm.lin64 -Nstars 3000 -Noutliers 20 -Npoints 100 -Nbootstrap $nboot $1 > test.$1.dat 40 40 reload test.$1.dat 41 41 … … 51 51 52 52 foreach outliers 0 3 10 30 100 53 exec bin/fitpm.lin64 -Nstars 3000 -Noutliers $outliers -Npoints 100 -Nbootstrap 100 $1 > test.$1.dat53 exec ../bin/fitpm.lin64 -Nstars 3000 -Noutliers $outliers -Npoints 100 -Nbootstrap 100 $1 > test.$1.dat 54 54 reload test.$1.dat 55 55
Note:
See TracChangeset
for help on using the changeset viewer.
