IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27883


Ignore:
Timestamp:
May 8, 2010, 10:16:06 AM (16 years ago)
Author:
eugene
Message:

working on psphotStack psf matching

Location:
branches/eam_branches/psphot.20100506/src
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/psphot.20100506/src/Makefile.am

    r27876 r27883  
    9595        psphotFitSourcesLinearStack.c \
    9696        psphotSourceMatch.c           \
    97         psphotStackMatchPSFs.c       \
    98         psphotStackMatchPSFsUtils.c  \
     97        psphotStackMatchPSFs.c        \
     98        psphotStackMatchPSFsUtils.c   \
     99        psphotStackMatchPSFsPrepare.c \
     100        psphotStackOptions.c          \
     101        psphotStackPSF.c              \
    99102        psphotCleanup.c
    100103
  • branches/eam_branches/psphot.20100506/src/psphot.h

    r27876 r27883  
    367367int pmPhotObjSortByX (const void **a, const void **b);
    368368
     369typedef enum {
     370    PSPHOT_CNV_SRC_NONE,
     371    PSPHOT_CNV_SRC_AUTO,
     372    PSPHOT_CNV_SRC_CNV,
     373    PSPHOT_CNV_SRC_RAW,
     374} psphotStackConvolveSource;
     375
    369376/// Options for stacking process
    370377typedef struct {
    371378    // Setup
    372379   
     380    int numCols;                            // size of image (X)
     381    int numRows;                            // size of image (Y)
     382
    373383    int num;                            // Number of inputs
    374384    bool convolve;                      // Convolve images?
     385    psphotStackConvolveSource convolveSource;
    375386    // psArray *convImages, *convMasks, *convVariances; // Filenames for the temporary convolved images
    376387
     
    420431bool psphotStackMatchPSFs (pmConfig *config, const pmFPAview *view);
    421432bool psphotStackMatchPSFsReadout (pmConfig *config, const pmFPAview *view, psphotStackOptions *options, int index);
     433bool psphotStackMatchPSFsPrepare (pmConfig *config, const pmFPAview *view, psphotStackOptions *options, int index);
    422434
    423435// psphotStackMatchPSFsUtils
     
    437449bool readImage(psImage **target, const char *name, const pmConfig *config);
    438450
     451pmPSF *psphotStackPSF(const pmConfig *config, int numCols, int numRows, const psArray *psfs, const psVector *inputMask);
     452
     453psphotStackOptions *psphotStackOptionsAlloc (int num);
     454psphotStackConvolveSource psphotStackConvolveSourceFromString (const char *string);
     455
    439456#endif
  • branches/eam_branches/psphot.20100506/src/psphotStackArguments.c

    r27876 r27883  
    11# include "psphotStandAlone.h"
    22
     3static void dumpTemplate(void);
    34static void usage(pmConfig *config, int exitCode);
    45static void writeHelpInfo(FILE* ofile);
  • branches/eam_branches/psphot.20100506/src/psphotStackMatchPSFs.c

    r27876 r27883  
    3636    // Generate target PSF
    3737    if (options->convolve) {
    38         options->psf = ppStackPSF(config, options->numCols, options->numRows, options->psfs, options->inputMask);
     38        options->psf = psphotStackPSF(config, options->numCols, options->numRows, options->psfs, options->inputMask);
    3939        if (!options->psf) {
    4040            psError(psErrorCodeLast(), false, "Unable to determine output PSF.");
  • branches/eam_branches/psphot.20100506/src/psphotStackMatchPSFsPrepare.c

    r27876 r27883  
    1818
    1919    switch (options->convolveSource) {
    20       case AUTO:
     20      case PSPHOT_CNV_SRC_AUTO:
    2121        fileSrc = fileCnv ? fileCnv : fileRaw;
    2222        break;
    2323
    24       case RAW:
     24      case PSPHOT_CNV_SRC_RAW:
    2525        fileSrc = fileRaw;
    2626        break;
    2727
    28       case CNV:
     28      case PSPHOT_CNV_SRC_CNV:
    2929        fileSrc = fileCnv;
    3030        break;
     
    3434    }
    3535    if (!fileSrc) {
    36         psError(PSPHOT_ERR_CONFIG, "desired convolution source is missing (cnv : %llx, raw : %llx)", (long long) fileCnv, (long long) fileRaw);
     36        psError(PSPHOT_ERR_CONFIG, true, "desired convolution source is missing (cnv : %llx, raw : %llx)", (long long) fileCnv, (long long) fileRaw);
    3737        return false;
    3838    }
     
    4444        if (!psf) {
    4545            // XXX if we were not supplied a PSF, we should be able to generate one by calling psphot
    46             psError(PPSTACK_ERR_PROG, false, "Unable to find PSF.");
     46            psError(PSPHOT_ERR_PROG, false, "Unable to find PSF.");
    4747            return false;
    4848        }
     
    7878        pmFPAfile *outputImage = pmFPAfileDefineOutput(config, NULL, "PSPHOT.STACK.OUTPUT.IMAGE");
    7979        pmReadout *readout = pmFPAviewThisReadout(view, outputImage->fpa); // Readout with sources
    80         detections = psMetadataLookupPtr(NULL, readout->analysis, "PSPHOT.DETECTIONS"); // Sources
     80        pmDetections *detections = psMetadataLookupPtr(NULL, readout->analysis, "PSPHOT.DETECTIONS"); // Sources
    8181        if (!detections || !detections->allSources) {
    82             psWarning("No detections found for image %d --- rejecting.", i);
    83             options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PPSTACK_MASK_CAL;
    84             continue;
     82            psWarning("No detections found for image %d --- rejecting.", index);
     83            options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[index] = 0x01;
     84            return true;  // XXX not an error: we continue processing other images
    8585        }
    8686        psAssert (detections->allSources, "missing sources?");
    87         options->sourceLists->data[i] = psMemIncrRefCounter(detections->allSources);
     87        options->sourceLists->data[index] = psMemIncrRefCounter(detections->allSources);
    8888    }
    8989
     
    108108        if (numFWHM == 0) {
    109109            options->inputSeeing->data.F32[index] = NAN;
    110             options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[index] = PPSTACK_MASK_PSF;
     110            options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[index] = 0x02;
    111111            psLogMsg("ppStack", PS_LOG_INFO, "Unable to measure PSF FWHM for image %d --- rejected.", index);
    112112        } else {
  • branches/eam_branches/psphot.20100506/src/psphotStackMatchPSFsUtils.c

    r27876 r27883  
    180180// It implicitly assumes the output root name is the same between invocations.
    181181
     182# if (0)
    182183bool loadKernel (pmConfig *config, pmReadout *readoutCnv, psphotStackOptions *options, int index) {
    183184
     
    228229    return true;
    229230}
     231# endif
    230232
    231233bool dumpImage(pmReadout *readoutOut, pmReadout *readoutRef, int index, char *rootname) {
  • branches/eam_branches/psphot.20100506/src/psphotStackOptions.c

    r27876 r27883  
    11# include "psphotInternal.h"
    2 
    3 typedef enum {
    4     PSPHOT_CNV_SRC_NONE,
    5     PSPHOT_CNV_SRC_AUTO,
    6     PSPHOT_CNV_SRC_CNV,
    7     PSPHOT_CNV_SRC_RAW,
    8 } psphotStackConvolveSource;
    92
    103static void psphotStackOptionsFree (psphotStackOptions *options) {
     
    3528    options->psf = NULL;
    3629    options->convolve = false;
     30    options->convolveSource = PSPHOT_CNV_SRC_NONE;
    3731
    3832    options->psfs = psArrayAlloc(num);
  • branches/eam_branches/psphot.20100506/src/psphotStackParseCamera.c

    r27876 r27883  
    113113            }
    114114            outputImage->save = true;
    115             outsources->fileID = i;             // this is used to generate output names
     115            outputImage->fileID = i;            // this is used to generate output names
    116116
    117117            pmFPAfile *outputMask = pmFPAfileDefineOutput(config, outputImage->fpa, "PSPHOT.STACK.OUTPUT.MASK");
Note: See TracChangeset for help on using the changeset viewer.