IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 4, 2011, 1:12:39 PM (15 years ago)
Author:
eugene
Message:

use the smoothed image for footprint culling; use a more stringent culling for saturated stars; more tweaks to get sat stars to be fitted; various updates to psphotStack; unify psphotImageLoop varients; be a bit careful about number of stars in a PSF clump

Location:
trunk/psphot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot

  • trunk/psphot/src/psphotRoughClass.c

    r29936 r31154  
    6363    }
    6464
     65    int NstarsInClump = psMetadataLookupS32 (&status, readout->analysis, "PSF_CLUMP_NSTARS");
     66    // if NstarsInClump is not defined, use the user-selected option:
     67    if (!status) {
     68        NstarsInClump = 1000;
     69    }
     70
     71    int ScaleForClump = 1;
     72    if (NstarsInClump >= 12) ScaleForClump = 2; // 4 cells
     73    if (NstarsInClump >= 27) ScaleForClump = 3; // 9 cells
     74    if (NstarsInClump >= 48) ScaleForClump = 4; // 16 cells
     75    if (NstarsInClump >  75) ScaleForClump = 5; // 25 cells
     76
    6577    // we make this measurement on a NxM grid of regions across the readout
    6678    int NX  = psMetadataLookupS32 (&status, recipe, "PSF_CLUMP_NX");  CHECK_STATUS (status, "PSF_CLUMP_NX");
    6779    int NY  = psMetadataLookupS32 (&status, recipe, "PSF_CLUMP_NY");  CHECK_STATUS (status, "PSF_CLUMP_NY");
    68     int dX  = readout->image->numCols / NX;
    69     int dY  = readout->image->numRows / NY;
     80
     81    int NXuse, NYuse;
     82
     83    ScaleForClump = PS_MIN(ScaleForClump, PS_MAX(NX, NY));
     84    if (NX > NY) {
     85        NXuse = ScaleForClump;
     86        NYuse = (int) (ScaleForClump * (NY / NX) + 0.5);
     87    } else {
     88        NYuse = ScaleForClump;
     89        NXuse = (int) (ScaleForClump * (NY / NX) + 0.5);
     90    }
     91
     92    psLogMsg ("psphot", 4, "With %d stars, using %d x %d grid for PSF clump\n", NstarsInClump, NXuse, NYuse);
     93
     94    int dX  = readout->image->numCols / NXuse;
     95    int dY  = readout->image->numRows / NYuse;
    7096
    7197    int nRegion = 0;
    72     for (int ix = 0; ix < NX; ix ++) {
    73         for (int iy = 0; iy < NY; iy ++) {
     98    for (int ix = 0; ix < NXuse; ix ++) {
     99        for (int iy = 0; iy < NYuse; iy ++) {
    74100
    75101            psRegion *region = psRegionAlloc (ix*dX, (ix + 1)*dX, iy*dY, (iy + 1)*dY);
     
    181207        return false;
    182208    }
    183     psLogMsg ("psphot", 3, "psf clump  X,  Y: %f, %f\n", psfClump.X, psfClump.Y);
    184     psLogMsg ("psphot", 3, "psf clump DX, DY: %f, %f\n", psfClump.dX, psfClump.dY);
     209    psLogMsg ("psphot", 3, "psf clump  X,  Y: %f, %f : DX, DY: %f, %f : nStars %d of %d\n", psfClump.X, psfClump.Y, psfClump.dX, psfClump.dY, psfClump.nStars, psfClump.nTotal);
    185210
    186211    // get basic parameters, or set defaults
Note: See TracChangeset for help on using the changeset viewer.