IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 26, 2007, 5:35:29 PM (19 years ago)
Author:
eugene
Message:

adding PS1_DEV_1 as pmSource I/O format; various cleanups of I/O operations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmPeaks.c

    r14652 r15039  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-08-24 00:11:02 $
     8 *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-09-27 03:35:29 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5151
    5252    // calculate peak position relative to ix,iy
     53    // XXX these functions need to take a mask, weight, and calculate the errors
    5354    psPolynomial2D *bicube = psImageBicubeFit (image, ix + image->col0, iy + image->row0);
    5455    psPlane min = psImageBicubeMin (bicube);
     
    5960        peak->xf = min.x + ix + image->col0;
    6061        peak->yf = min.y + iy + image->row0;
     62        peak->dx = 0.0;
     63        peak->dy = 0.0;
    6164    } else {
    6265        peak->xf = ix;
    6366        peak->yf = iy;
     67        peak->dx = 1.0;
     68        peak->dy = 1.0;
    6469    }
    6570
     
    189194    }
    190195    psTrace("psModules.objects", 3, "---- %s(0) end ----\n", __func__);
     196    return (0);
     197}
     198
     199// sort by SN (descending)
     200int pmPeakSortBySN (const void **a, const void **b)
     201{
     202    pmPeak *A = *(pmPeak **)a;
     203    pmPeak *B = *(pmPeak **)b;
     204
     205    psF32 fA = A->SN;
     206    psF32 fB = B->SN;
     207    if (isnan (fA)) fA = 0;
     208    if (isnan (fB)) fB = 0;
     209
     210    psF32 diff = fA - fB;
     211    if (diff > FLT_EPSILON) return (-1);
     212    if (diff < FLT_EPSILON) return (+1);
     213    return (0);
     214}
     215
     216// sort by Y (ascending)
     217int pmPeakSortByY (const void **a, const void **b)
     218{
     219    pmPeak *A = *(pmPeak **)a;
     220    pmPeak *B = *(pmPeak **)b;
     221
     222    psF32 fA = A->y;
     223    psF32 fB = B->y;
     224
     225    psF32 diff = fA - fB;
     226    if (diff > FLT_EPSILON) return (+1);
     227    if (diff < FLT_EPSILON) return (-1);
    191228    return (0);
    192229}
Note: See TracChangeset for help on using the changeset viewer.