IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14991


Ignore:
Timestamp:
Sep 23, 2007, 5:01:55 PM (19 years ago)
Author:
eugene
Message:

expect PSF.CLUMP paramters in recipe (from loaded PSF)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20070921/psphot/src/psphotRoughClass.c

    r14760 r14991  
    11# include "psphotInternal.h"
     2# define CHECK_STATUS(S,MSG) { \
     3  if (!status) { \
     4    psError(PSPHOT_ERR_CONFIG, false, "missing PSF Clump entry: %s\n", MSG); \
     5    return false; \
     6  } }
    27
    38// 2006.02.02 : no leaks
    49bool psphotRoughClass (psArray *sources, psMetadata *recipe, const bool havePSF, psMaskType maskSat) {
    510
    6     static pmPSFClump   psfClump;
     11    bool status;
     12    static pmPSFClump psfClump;
    713
    814    psTimerStart ("psphot");
     
    1117        // determine the PSF parameters from the source moment values
    1218        psfClump = pmSourcePSFClump (sources, recipe);
     19        psMetadataAddF32 (recipe, PS_LIST_TAIL, "PSF.CLUMP.X", 0, "psf clump center", psfClump.X);
     20        psMetadataAddF32 (recipe, PS_LIST_TAIL, "PSF.CLUMP.Y", 0, "psf clump center", psfClump.Y);
     21        psMetadataAddF32 (recipe, PS_LIST_TAIL, "PSF.CLUMP.DX", 0, "psf clump center", psfClump.dX);
     22        psMetadataAddF32 (recipe, PS_LIST_TAIL, "PSF.CLUMP.DY", 0, "psf clump center", psfClump.dY);
    1323    } else {
    1424        // pull FWHM_X,Y from the recipe, use to define psfClump.X,Y
    15         bool status_x, status_y, status_a;
    16         float FWHM_X = psMetadataLookupF32 (&status_x, recipe, "FWHM_X");
    17         float FWHM_Y = psMetadataLookupF32 (&status_y, recipe, "FWHM_Y");
    18         float ANGLE  = psMetadataLookupF32 (&status_a, recipe, "ANGLE");
    19         if (!status_x | !status_y | !status_a) {
    20             psError(PSPHOT_ERR_CONFIG, false, "FWHM_X, FWHM_Y, or ANGLE not defined");
    21             return false;
    22         }
    23 
    24         psEllipseAxes axes;
    25         axes.major = FWHM_X / (2.0*sqrt(2.0*log(2.0)));
    26         axes.minor = FWHM_Y / (2.0*sqrt(2.0*log(2.0)));
    27         axes.theta = ANGLE;
    28         psEllipseShape shape = psEllipseAxesToShape (axes);
    29 
    30         psfClump.X   = shape.sx;
    31         psfClump.Y   = shape.sy;
    32         psfClump.dX  = 0.1*shape.sx;
    33         psfClump.dY  = 0.1*shape.sy;
    34         // dX,dY are somewhat crudely defined, but only used to select PSF candidates.
    35         // if we already have a PSF, this is not actually used...
     25        psfClump.X  = psMetadataLookupF32 (&status, recipe, "PSF.CLUMP.X");  CHECK_STATUS (status, "PSF.CLUMP.X");
     26        psfClump.Y  = psMetadataLookupF32 (&status, recipe, "PSF.CLUMP.Y");  CHECK_STATUS (status, "PSF.CLUMP.Y");
     27        psfClump.dX = psMetadataLookupF32 (&status, recipe, "PSF.CLUMP.DX");  CHECK_STATUS (status, "PSF.CLUMP.DX");
     28        psfClump.dY = psMetadataLookupF32 (&status, recipe, "PSF.CLUMP.DY");  CHECK_STATUS (status, "PSF.CLUMP.DY");
    3629    }
    3730
Note: See TracChangeset for help on using the changeset viewer.