IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25261


Ignore:
Timestamp:
Sep 2, 2009, 5:00:06 PM (17 years ago)
Author:
Paul Price
Message:

FWHM_X and FWHM_Y don't appear to get set any more. Instead, FWHM_MAJ and FWHM_MIN do. Does this explain the much-reduced limiting magnitudes from the difference images??? Either way, it's required to get the detection efficiency measurements working.

Location:
branches/pap/psphot/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/pap/psphot/src/psphotFake.c

    r25260 r25261  
    1717                      const pmReadout *ro,     // Readout of interest
    1818                      float thresh,            // Threshold for source identification
    19                       float xFWHM, float yFWHM, // Size of PSF
     19                      float fwhmMajor, float fwhmMinor, // Size of PSF
    2020                      float smoothNsigma,       // Smoothing limit
    2121                      psImageMaskType maskVal   // Value to mask
     
    2525    PM_ASSERT_READOUT_VARIANCE(ro, false);
    2626
    27     float smoothSigma  = 0.5*(xFWHM + yFWHM) / (2.0*sqrtf(2.0*log(2.0)));
     27    float smoothSigma  = 0.5*(fwhmMajor + fwhmMinor) / (2.0*sqrtf(2.0*log(2.0)));
    2828    psKernel *kernel = psImageSmoothKernel(smoothSigma, smoothNsigma); // Kernel used for smoothing
    2929    psKernel *newCovar = psImageCovarianceCalculate(kernel, ro->covariance); // Covariance matrix
     
    131131    // Collect recipe information
    132132    bool mdok;                                                 // Status of MD lookup
    133     float xFWHM = psMetadataLookupF32(NULL, recipe, "FWHM_X"); // PSF size in x
    134     float yFWHM = psMetadataLookupF32(NULL, recipe, "FWHM_Y"); // PSF size in y
    135     if (!isfinite(xFWHM) || !isfinite(yFWHM)) {
    136         psError(PSPHOT_ERR_CONFIG, false, "Unable to find FWHM_X and FWHM_Y in recipe");
     133    float fwhmMajor = psMetadataLookupF32(NULL, recipe, "FWHM_MAJ"); // PSF size in x
     134    float fwhmMinor = psMetadataLookupF32(NULL, recipe, "FWHM_MIN"); // PSF size in y
     135    if (!isfinite(fwhmMajor) || !isfinite(fwhmMinor) || fwhmMajor == 0.0 || fwhmMinor == 0.0) {
     136        psError(PSPHOT_ERR_CONFIG, false, "Unable to find FWHM_MAJ and FWHM_MIN in recipe");
    137137        return false;
    138138    }
     
    170170    float magLim;                       // Guess at limiting magnitude
    171171    float minFlux;                      // Minimum flux for fake image
    172     if (!fakeLimit(&magLim, &minFlux, readout, thresh, xFWHM, yFWHM, smoothNsigma, maskVal)) {
     172    if (!fakeLimit(&magLim, &minFlux, readout, thresh, fwhmMajor, fwhmMinor, smoothNsigma, maskVal)) {
    173173        psError(PS_ERR_UNKNOWN, false, "Unable to determine limits for image");
    174174        return false;
  • branches/pap/psphot/src/psphotSignificanceImage.c

    r21407 r25261  
    2222    }
    2323
    24     bool status_x, status_y;
    25     float FWHM_X = psMetadataLookupF32 (&status_x, recipe, "FWHM_X");
    26     float FWHM_Y = psMetadataLookupF32 (&status_y, recipe, "FWHM_Y");
    27     if (status_x && status_y) {
    28       // if we know the FHWM, use that to set the smoothing kernel (XXX allow an optional override?)
    29       SIGMA_SMTH  = 0.5*(FWHM_X + FWHM_Y) / (2.0*sqrt(2.0*log(2.0)));
    30       NSIGMA_SMTH = psMetadataLookupF32 (&status, recipe, "PEAKS_SMOOTH_NSIGMA");
    31       guess = false;
     24    bool statusMajor, statusMinor;
     25    float fwhmMajor = psMetadataLookupF32(&statusMajor, recipe, "FWHM_MAJ");
     26    float fwhmMinor = psMetadataLookupF32(&statusMinor, recipe, "FWHM_MIN");
     27    if (statusMajor && statusMinor) {
     28        // if we know the FHWM, use that to set the smoothing kernel (XXX allow an optional override?)
     29        if (!isfinite(fwhmMajor) || !isfinite(fwhmMinor) || fwhmMajor == 0.0 || fwhmMinor == 0.0) {
     30            psWarning("fwhmMajor (%f) or fwhmMinor (%f) is bad!", fwhmMajor, fwhmMinor);
     31        }
     32        SIGMA_SMTH  = 0.5*(fwhmMajor + fwhmMinor) / (2.0*sqrt(2.0*log(2.0)));
     33        NSIGMA_SMTH = psMetadataLookupF32 (&status, recipe, "PEAKS_SMOOTH_NSIGMA");
     34        guess = false;
    3235    } else {
    33       // if we do not know the FWHM, use the guess smoothing kernel supplied.
    34       // it is a configuration error if these are not supplied
    35       SIGMA_SMTH  = psMetadataLookupF32 (&status, recipe, "PEAKS_SMOOTH_SIGMA");
    36       PS_ASSERT (status, NULL);
    37       NSIGMA_SMTH = psMetadataLookupF32 (&status, recipe, "PEAKS_SMOOTH_NSIGMA");
    38       PS_ASSERT (status, NULL);
    39       guess = true;
     36        // if we do not know the FWHM, use the guess smoothing kernel supplied.
     37        // it is a configuration error if these are not supplied
     38        SIGMA_SMTH  = psMetadataLookupF32 (&status, recipe, "PEAKS_SMOOTH_SIGMA");
     39        PS_ASSERT (status, NULL);
     40        NSIGMA_SMTH = psMetadataLookupF32 (&status, recipe, "PEAKS_SMOOTH_NSIGMA");
     41        PS_ASSERT (status, NULL);
     42        guess = true;
    4043    }
    4144    // record the actual smoothing sigma
Note: See TracChangeset for help on using the changeset viewer.