IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 21483


Ignore:
Timestamp:
Feb 15, 2009, 9:51:04 AM (17 years ago)
Author:
eugene
Message:

copy astrometry parameters as well

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20090208/psModules/src/camera/pmFPACopy.c

    r21363 r21483  
    457457    psMetadataCopy(target->parent->concepts, source->parent->concepts);
    458458
     459    // Update the astrometric parameters
     460    target->toFPA = psMemIncrRefCounter (source->toFPA);
     461    target->fromFPA = psMemIncrRefCounter (source->fromFPA);
     462
     463    // Update the parent fpa astrometry parameters, or check that they match
     464    pmFPA *targetFPA = target->parent;
     465    pmFPA *sourceFPA = source->parent;
     466    // XXX should we require that both of these exist?
     467
     468    if (targetFPA && sourceFPA) {
     469        if (targetFPA->toSky) {
     470            psAssert (targetFPA->toSky == sourceFPA->toSky, "chips within FPA have inconsistent astrometry references");
     471        } else {
     472            targetFPA->toSky = psMemIncrRefCounter (sourceFPA->toSky);
     473        }
     474        if (targetFPA->toTPA) {
     475            psAssert (targetFPA->toTPA == sourceFPA->toTPA, "chips within FPA have inconsistent astrometry references");
     476        } else {
     477            targetFPA->toTPA = psMemIncrRefCounter (sourceFPA->toTPA);
     478        }
     479        if (targetFPA->fromTPA) {
     480            psAssert (targetFPA->fromTPA == sourceFPA->fromTPA, "chips within FPA have inconsistent astrometry references");
     481        } else {
     482            targetFPA->fromTPA = psMemIncrRefCounter (sourceFPA->fromTPA);
     483        }
     484    }
     485
    459486    target->data_exists = true;
    460487    return status;
Note: See TracChangeset for help on using the changeset viewer.