IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14521


Ignore:
Timestamp:
Aug 15, 2007, 4:23:37 PM (19 years ago)
Author:
Paul Price
Message:

Adding function to get the kernel type from a string.

Location:
trunk/psModules/src/imcombine
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmSubtractionKernels.c

    r14476 r14521  
    44
    55#include <stdio.h>
     6#include <string.h>
    67#include <pslib.h>
    78
     
    628629    }
    629630}
     631
     632
     633pmSubtractionKernelsType pmSubtractionKernelsTypeFromString(const char *type)
     634{
     635    if (strcasecmp(type, "POIS") == 0) {
     636        return PM_SUBTRACTION_KERNEL_POIS;
     637    }
     638    if (strcasecmp(type, "ISIS") == 0) {
     639        return PM_SUBTRACTION_KERNEL_ISIS;
     640    }
     641    if (strcasecmp(type, "SPAM") == 0) {
     642        return PM_SUBTRACTION_KERNEL_SPAM;
     643    }
     644    if (strcasecmp(type, "FRIES") == 0) {
     645        return PM_SUBTRACTION_KERNEL_FRIES;
     646    }
     647    if (strcasecmp(type, "GUNK") == 0) {
     648        return PM_SUBTRACTION_KERNEL_GUNK;
     649    }
     650    if (strcasecmp(type, "RINGS") == 0) {
     651        return PM_SUBTRACTION_KERNEL_RINGS;
     652    }
     653
     654    psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unrecognised kernel type: %s", type);
     655    return PM_SUBTRACTION_KERNEL_NONE;
     656}
  • trunk/psModules/src/imcombine/pmSubtractionKernels.h

    r14455 r14521  
    66/// Type of subtraction kernel
    77typedef enum {
     8    PM_SUBTRACTION_KERNEL_NONE,         ///< Nothing --- an error
    89    PM_SUBTRACTION_KERNEL_POIS,         ///< Pan-STARRS Optimal Image Subtraction --- delta functions
    910    PM_SUBTRACTION_KERNEL_ISIS,         ///< Traditional kernel --- gaussians modified by polynomials
     
    9192    );
    9293
     94/// Return the appropriate type from a string
     95pmSubtractionKernelsType pmSubtractionKernelsTypeFromString(const char *string // String name for kernel type
     96    );
     97
     98
    9399#endif
Note: See TracChangeset for help on using the changeset viewer.