IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 14, 2006, 11:43:59 AM (20 years ago)
Author:
magnier
Message:

added JPEG and PSF I/O methods to pmFPAfile, added pmSourcePixelWeights

Location:
branches/rel10_ifa/psModules/src/pslib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/rel10_ifa/psModules/src/pslib/psAdditionals.c

    r6725 r6859  
    143143{
    144144    psList *values = psListAlloc(NULL); // The list of values to return
     145    if (string == NULL)
     146        return values;  // NULL string is not an error, just an empty list
     147
    145148    unsigned int length = strlen(string); // The length of the string
    146149    unsigned int numSplitters = strlen(splitters); // Number of characters that might split
     
    176179}
    177180
     181psArray *psStringSplitArray (const char *string, const char *splitters)
     182{
     183
     184    psList *list = psStringSplit (string, splitters);
     185    psArray *array = psListToArray (list);
     186    psFree (list);
     187    return array;
     188}
     189
    178190#ifndef whitespace
    179191#define whitespace(c) (((c) == ' ') || ((c) == '\t'))
  • branches/rel10_ifa/psModules/src/pslib/psAdditionals.h

    r6848 r6859  
    3030                     );
    3131
     32// Split string on given characters
     33psArray *psStringSplitArray(const char *string, // String to split
     34                            const char *splitters // Characters on which to split
     35                           );
     36
    3237// strip whitespace from head and tail of string
    3338int psStringStrip (char *string);
  • branches/rel10_ifa/psModules/src/pslib/psImageUnbin.c

    r6826 r6859  
    179179}
    180180
    181 double psImageClippedStats (psImage *image, psImage *mask, psU8 maskValue, double fmin, double fmax)
     181psStats *psImageClippedStats (psImage *image, psImage *mask, psU8 maskValue, double fmin, double fmax)
    182182{
    183183    double value;
     
    185185    int ny = image->numRows;
    186186
     187    psStats *stats = psStatsAlloc (PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_QUARTILE);
    187188    if (nx*ny <= 0)
    188         return 0.0;
     189        return stats;
    189190
    190191    int Nsubset = PS_MIN (MAX_SAMPLE_PIXELS, nx*ny);
     
    203204        int iy = pixel / nx;
    204205
    205         if (mask->data.U8[iy][ix] & maskValue)
     206        if (mask && mask->data.U8[iy][ix] & maskValue)
    206207            continue;
    207208
     
    226227    value = value / npts;
    227228
     229    stats->robustMedian = value;
     230    stats->robustUQ = values->data.F32[imax];
     231    stats->robustLQ = values->data.F32[imin];
     232
     233    psFree (values);
     234    return stats;
    228235    // XXX correct for selection bias??
    229 
    230     psFree (values);
    231     return value;
    232236}
    233237
  • branches/rel10_ifa/psModules/src/pslib/psImageUnbin.h

    r6826 r6859  
    1111
    1212// my temporary image stats function; seems to be much faster than psLib???
    13 double psImageClippedStats (psImage *image, psImage *mask, psU8 maskValue, double fmin, double fmax);
     13psStats *psImageClippedStats (psImage *image, psImage *mask, psU8 maskValue, double fmin, double fmax);
    1414
    1515// my temporary sort which is based on N.R.; seems to be faster than psLib sort???
Note: See TracChangeset for help on using the changeset viewer.