Changeset 41836 for branches/eam_branches/ipp-dev-20210817
- Timestamp:
- Oct 11, 2021, 11:45:42 AM (5 years ago)
- Location:
- branches/eam_branches/ipp-dev-20210817/psModules/src
- Files:
-
- 3 edited
-
astrom/pmAstrometryObjects.c (modified) (6 diffs)
-
objects/pmSourceIO_CMF.c.in (modified) (2 diffs)
-
objects/pmSourceIO_Ghosts.c (modified) (6 diffs)
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 -
branches/eam_branches/ipp-dev-20210817/psModules/src/objects/pmSourceIO_CMF.c.in
r41825 r41836 761 761 bool pmSourcesWrite_CMF_@CMFMODE@ (psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname, psMetadata *recipe) 762 762 { 763 // bool status = pmSourcesWrite_CMF_@CMFMODE@_Old (fits, readout, sources, imageHeader, tableHeader, extname, recipe);764 bool status = pmSourcesWrite_CMF_@CMFMODE@_New (fits, readout, sources, imageHeader, tableHeader, extname, recipe);763 // bool status = pmSourcesWrite_CMF_@CMFMODE@_Old (fits, readout, sources, imageHeader, tableHeader, extname, recipe); 764 bool status = pmSourcesWrite_CMF_@CMFMODE@_New (fits, readout, sources, imageHeader, tableHeader, extname, recipe); 765 765 return status; 766 766 } … … 1195 1195 1196 1196 psArray *pmSourcesRead_CMF_@CMFMODE@ (psFits *fits, psMetadata *header) { 1197 //psArray *array = pmSourcesRead_CMF_@CMFMODE@_Old (fits, header);1198 psArray *array = pmSourcesRead_CMF_@CMFMODE@_New (fits, header);1197 // psArray *array = pmSourcesRead_CMF_@CMFMODE@_Old (fits, header); 1198 psArray *array = pmSourcesRead_CMF_@CMFMODE@_New (fits, header); 1199 1199 return array; 1200 1200 } -
branches/eam_branches/ipp-dev-20210817/psModules/src/objects/pmSourceIO_Ghosts.c
r41391 r41836 136 136 pmFPAview *view = pmFPAviewAlloc (0); 137 137 138 // We need to check whether we are dealing with an old style ghost_model, or a new style model. Check if the mirror_rad polynomial exists138 // We need to check whether we are dealing with an old style ghost_model, or a new style model. Check if the mirror_rad polynomial exists 139 139 float mirCheck = 0; 140 140 md = psMetadataLookupMetadata (&status, ghostModel, "GHOST.MIRROR.RAD"); … … 153 153 GET_1D_POLY ("GHOST.INNER.MINOR", innerMinor); 154 154 155 156 155 // select the input astrometry data (also carries the refstars) 157 156 pmFPAfile *astrom = psMetadataLookupPtr (NULL, config->files, "PSASTRO.INPUT"); … … 211 210 double theta0 = atan2(ref->FP->y,ref->FP->x); 212 211 213 if(mirCheck) { 212 // EAM: XXX we should just use the existence of mirrorRad (!= NULL) instead of carrying a different bool 213 if (mirCheck) { 214 214 //TdB: first mirror the reference star positions (around the 0,0 pixel) using the radial offset coefficients and the ghost/star angle 215 215 double ghost_offset_rad = psPolynomial1DEval (mirrorRad, rSrc); … … 220 220 ghost->FP->x = ghost_x_fpa_mirror + psPolynomial2DEval(centerX, ghost_x_fpa_mirror, ghost_y_fpa_mirror); 221 221 ghost->FP->y = ghost_y_fpa_mirror + psPolynomial2DEval(centerY, ghost_x_fpa_mirror, ghost_y_fpa_mirror); 222 } 223 if(!mirCheck) { 222 } else { 224 223 //Use the old-style ghost position determination 225 224 ghost->FP->x = -ref->FP->x + psPolynomial2DEval(centerX, -ref->FP->x, -ref->FP->y); … … 303 302 psFree (outerMajor); 304 303 psFree (outerMinor); 304 psFree (mirrorRad); 305 305 psFree (ghostModel); 306 306 psFree (view); … … 327 327 psFree (outerMajor); 328 328 psFree (outerMinor); 329 psFree (mirrorRad); 329 330 psFree (ghostModel); 330 331 psFree (view);
Note:
See TracChangeset
for help on using the changeset viewer.
