IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20081


Ignore:
Timestamp:
Oct 12, 2008, 4:03:52 PM (18 years ago)
Author:
eugene
Message:

fix aspect ratio choice; fix header comments; move growth curve analysis to own function

File:
1 edited

Legend:

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

    r19950 r20081  
    4747
    4848    // this is the smallest radius allowed: need to at least extend growth curve down to this...
    49     float PSF_FIT_PAD   = psMetadataLookupF32 (&status, recipe, "PSF_FIT_PADDING");
    5049    bool IGNORE_GROWTH = psMetadataLookupBool (&status, recipe, "IGNORE_GROWTH");
    5150    bool INTERPOLATE_AP = psMetadataLookupBool (&status, recipe, "INTERPOLATE_AP");
     
    7069    // set limits on the aperture magnitudes
    7170    pmSourceMagnitudesInit (recipe);
    72 
    73     // measure the aperture loss as a function of radius for PSF
    74     float REF_RADIUS = psMetadataLookupF32 (&status, recipe, "PSF_REF_RADIUS");
    75     psf->growth = pmGrowthCurveAlloc (PSF_FIT_PAD, 100.0, REF_RADIUS);
    76 
    77     if (!pmGrowthCurveGenerate (readout, psf, IGNORE_GROWTH, maskVal, markVal)) {
    78         psError(PSPHOT_ERR_APERTURE, false, "Fitting aperture corrections");
    79         psFree(psf->growth); psf->growth = NULL;
    80         return false;
    81     }
    8271
    8372    psVector *mask    = psVectorAllocEmpty (300, PS_TYPE_U8);
     
    210199    // save results for later output
    211200    psMetadataAdd (recipe, PS_LIST_TAIL, "SKYBIAS",  PS_DATA_F32 | PS_META_REPLACE, "aperture sky bias",   0.0);
    212     psMetadataAdd (recipe, PS_LIST_TAIL, "SKYSAT",   PS_DATA_F32 | PS_META_REPLACE, "aperture sky bias",   0.0);
     201    psMetadataAdd (recipe, PS_LIST_TAIL, "SKYSAT",   PS_DATA_F32 | PS_META_REPLACE, "aperture-determined saturation",   0.0);
    213202    psMetadataAdd (recipe, PS_LIST_TAIL, "APMIFIT",  PS_DATA_F32 | PS_META_REPLACE, "aperture residual",   psf->ApResid);
    214203    psMetadataAdd (recipe, PS_LIST_TAIL, "DAPMIFIT", PS_DATA_F32 | PS_META_REPLACE, "ap residual scatter", psf->dApResid);
    215     psMetadataAdd (recipe, PS_LIST_TAIL, "APLOSS",   PS_DATA_F32 | PS_META_REPLACE, "ap residual scatter", psf->growth->apLoss);
    216     psMetadataAdd (recipe, PS_LIST_TAIL, "NAPMIFIT", PS_DATA_S32 | PS_META_REPLACE, "ap residual scatter", psf->nApResid);
     204    psMetadataAdd (recipe, PS_LIST_TAIL, "APLOSS",   PS_DATA_F32 | PS_META_REPLACE, "aperture loss (mag)", psf->growth->apLoss);
     205    psMetadataAdd (recipe, PS_LIST_TAIL, "NAPMIFIT", PS_DATA_S32 | PS_META_REPLACE, "number of apresid stars", psf->nApResid);
    217206
    218207    // psLogMsg ("psphot.apresid", PS_LOG_INFO, "measure full-frame aperture residuals for %d of %d objects: %f sec\n", Nkeep, Npsf, psTimerMark ("psphot"));
     
    327316       
    328317    if (readout->image->numCols > readout->image->numRows) {
    329         Nx = scale;
    330         Ny = PS_MAX (1, Nx * (readout->image->numRows / (float) readout->image->numCols));
     318        Nx = scale;
     319        float AR = readout->image->numRows / (float) readout->image->numCols;
     320        Ny = (int) (Nx * AR + 0.5);
     321        Ny = PS_MAX (1, Ny);
    331322    } else {
    332323        Ny = scale;
    333         Nx = PS_MAX (1, Ny * (readout->image->numCols / (float) readout->image->numRows));
     324        float AR = readout->image->numRows / (float) readout->image->numCols;
     325        Nx = (int) (Ny * AR + 0.5);
     326        Nx = PS_MAX (1, Nx);
    334327    }
    335328
Note: See TracChangeset for help on using the changeset viewer.