IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 9, 2007, 3:09:20 PM (19 years ago)
Author:
eugene
Message:

updating all changes from from eam_branch_20071023

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmModel.c

    r14938 r15562  
    66 *  @author EAM, IfA
    77 *
    8  *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-09-21 00:04:07 $
     8 *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-11-10 01:09:20 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4646    psTrace("psModules.objects", 3, "---- %s() begin ----\n", __func__);
    4747
    48     pmModel *tmp = (pmModel *) psAlloc(sizeof(pmModel));
    49     psMemSetDeallocator(tmp, (psFreeFunc) modelFree);
    50 
    5148    pmModelClass *class = pmModelClassSelect (type);
    5249    if (class == NULL) {
     
    5451        return(NULL);
    5552    }
     53
     54    pmModel *tmp = (pmModel *) psAlloc(sizeof(pmModel));
     55    psMemSetDeallocator(tmp, (psFreeFunc) modelFree);
    5656
    5757    tmp->type = type;
     
    8989}
    9090
     91bool psMemCheckModel(psPtr ptr)
     92{
     93    PS_ASSERT_PTR(ptr, false);
     94    return ( psMemGetDeallocator(ptr) == (psFreeFunc) modelFree);
     95}
     96
    9197// copy model to a new structure
    9298pmModel *pmModelCopy (pmModel *model)
    9399{
     100    PS_ASSERT_PTR_NON_NULL(model, NULL);
    94101
    95102    pmModel *new = pmModelAlloc (model->type);
     
    217224        Ro = psImageInterpolateOptionsAlloc(
    218225            PS_INTERPOLATE_BILINEAR,
    219             model->residuals->Ro, NULL, NULL, 0, 0.0, 0.0, 1, 0, 0.0);
     226            model->residuals->Ro, NULL, mask, 0, 0.0, 0.0, 1, 0, 0.0);
    220227        Rx = psImageInterpolateOptionsAlloc(
    221228            PS_INTERPOLATE_BILINEAR,
     
    257264                float oy = yBin*(imageRow + 0.5 - yCenter) + yResidCenter;
    258265
     266                psU8 mflux = 0;
    259267                if (mode & PM_MODEL_OP_RES0) {
    260                     psU8 mflux = 0;
    261268                    double Fo = 0.0;
    262269                    psImageInterpolate (&Fo, NULL, &mflux, ox, oy, Ro);
     
    265272                    }
    266273                }
    267                 if (mode & PM_MODEL_OP_RES1) {
    268                     psU8 mflux = 0;
     274                // skip Rx,Ry if Ro is masked
     275                if (!mflux && (mode & PM_MODEL_OP_RES1)) {
    269276                    double Fx = 0.0;
    270277                    double Fy = 0.0;
Note: See TracChangeset for help on using the changeset viewer.