IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 13, 2006, 8:24:10 PM (21 years ago)
Author:
eugene
Message:

substantial work on the aperture residuals

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotDefinePixels.c

    r5134 r5980  
    1616    mySource->weight = psImageSubset(imdata->weight, srcRegion);
    1717    mySource->mask   = psImageSubset(imdata->mask,  srcRegion);
     18    mySource->region = srcRegion;
    1819
    19     return(mySource);
     20    return true;
    2021}
    2122
     23bool psphotRedefinePixels(pmSource *mySource,
     24                          const eamReadout *imdata,
     25                          psF32 x,
     26                          psF32 y,
     27                          psF32 Radius)
     28{
     29    bool extend;
     30    psRegion newRegion;
     31
     32    if (Radius == 0) return false;
     33
     34    // check to see if new region is completely contained within old region
     35    newRegion = psRegionForSquare (x, y, Radius);
     36    newRegion = psRegionForImage (imdata->image, newRegion);
     37
     38    extend = false;
     39    extend |= (int)(newRegion.x0) < (int)(mySource->region.x0);
     40    extend |= (int)(newRegion.x1) > (int)(mySource->region.x1);
     41    extend |= (int)(newRegion.y0) < (int)(mySource->region.y0);
     42    extend |= (int)(newRegion.y1) > (int)(mySource->region.y1);
     43
     44    extend |= (mySource->pixels == NULL);
     45    extend |= (mySource->weight == NULL);
     46    extend |= (mySource->mask == NULL);
     47
     48    // extend = true;
     49    if (extend) {
     50        // Grab a new subimage
     51        // psFree (mySource->pixels);
     52        // psFree (mySource->weight);
     53        // psFree (mySource->mask);
     54
     55        // fprintf (stderr, "extend %f,%f\n", x, y);
     56        mySource->pixels = psImageSubset(imdata->image,  newRegion);
     57        mySource->weight = psImageSubset(imdata->weight, newRegion);
     58        mySource->mask   = psImageSubset(imdata->mask,   newRegion);
     59        mySource->region = newRegion;
     60    }
     61
     62    return extend;
     63}
     64
     65
     66//**** this function was ALWAYS restricting to model->radius
     67//     should have left it larger (PSF_FIT_RAD) for the faint sources
Note: See TracChangeset for help on using the changeset viewer.