Changeset 41836 for branches/eam_branches/ipp-dev-20210817/psModules/src/astrom/pmAstrometryObjects.c
- Timestamp:
- Oct 11, 2021, 11:45:42 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-dev-20210817/psModules/src/astrom/pmAstrometryObjects.c
r41814 r41836 354 354 355 355 bool isValid = true; 356 isValid = isValid & isfinite (x Fit->data.F32[i]);357 isValid = isValid & isfinite (y Fit->data.F32[i]);356 isValid = isValid & isfinite (x->data.F32[i]); 357 isValid = isValid & isfinite (y->data.F32[i]); 358 358 isValid = isValid & isfinite (xRes->data.F32[i]); 359 359 isValid = isValid & isfinite (yRes->data.F32[i]); 360 360 if (isValid) { 361 psVectorAppend (xPosValid, x Fit->data.F32[i]);362 psVectorAppend (yPosValid, y Fit->data.F32[i]);361 psVectorAppend (xPosValid, x->data.F32[i]); 362 psVectorAppend (yPosValid, y->data.F32[i]); 363 363 psVectorAppend (xResValid, xRes->data.F32[i]); 364 364 psVectorAppend (yResValid, yRes->data.F32[i]); … … 391 391 results->dXsys = results->dYsys = NAN; 392 392 results->dXrange = results->dYrange = NAN; 393 results->dXstdev = results->dYstdev = NAN; 393 394 } else { 394 395 results->dXsys = psVectorSystematicError (xResGood, xErr, 0.05); … … 427 428 428 429 # define VAL_COUNT 9.0 429 # define MIN_COUNT 7.0430 # define MIN_COUNT 5.0 430 431 431 432 float pmAstrom2DSystematics (psVector *xPos, psVector *yPos, psVector *value) { 432 433 433 434 // pre-filter the values to ensure no NANs, other invalid 434 if (xPos->n < VAL_COUNT*2*2) { return NAN; } 435 if (xPos->n < VAL_COUNT*2*2) { 436 return NAN; 437 } 435 438 436 439 // generate a grid covering the full range of x,y and measure the median value in each … … 455 458 float yStep = Ncell / (yMax - yMin); 456 459 457 if (isnan(xStep)) { return NAN; } 458 if (isnan(yStep)) { return NAN; } 460 if (isnan(xStep)) { 461 return NAN; 462 } 463 if (isnan(yStep)) { 464 return NAN; 465 } 459 466 460 467 psArray *xBin = psArrayAlloc (Ncell); … … 487 494 for (int iy = 0; iy < Ncell; iy++) { 488 495 psVector *Bin = yBin->data[iy]; 489 496 if (Bin->n < MIN_COUNT) { continue; } 497 490 498 // psVectorStats resets stats so we can call this repeatedly 491 499 psVectorStats (stats, Bin, NULL, NULL, 0); … … 499 507 psVectorStats (stats, sample, NULL, NULL, 0); 500 508 float result = stats->sampleStdev; 509 510 if (!isfinite(stats->sampleStdev)) { 511 fprintf (stderr, "*** bad solution ***\n"); 512 } 501 513 502 514 // NOTE: the elements of xBin are freed automatically, which extends down to the vectors
Note:
See TracChangeset
for help on using the changeset viewer.
