IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 8, 2010, 1:55:26 PM (16 years ago)
Author:
eugene
Message:

working on psphotStack psf matching

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/psphot.20100506/src/psphotStackOptions.c

    r27883 r27884  
    2929    options->convolve = false;
    3030    options->convolveSource = PSPHOT_CNV_SRC_NONE;
    31 
    32     options->psfs = psArrayAlloc(num);
    33 
    34     options->inputSeeing = psVectorAlloc(num, PS_TYPE_F32);
    35     psVectorInit(options->inputSeeing, NAN);
    36 
    37     options->matchChi2 = psVectorAlloc(num, PS_TYPE_F32);
    38     psVectorInit(options->matchChi2, NAN);
    39 
    40     options->inputMask = psVectorAlloc(num, PS_TYPE_VECTOR_MASK); // Mask for inputs
    41     psVectorInit(options->inputMask, 0);
    42 
    4331    options->targetSeeing = NAN;
    4432
     33    options->psfs        = psArrayAlloc(num);
    4534    options->sourceLists = psArrayAlloc(num); // Individual lists of sources for matching
    46     options->norm = psVectorAlloc(num, PS_TYPE_F32);
    47     psVectorInit(options->norm, NAN);
     35    options->kernels     = psArrayAlloc(num);
     36    options->regions     = psArrayAlloc(num);
    4837
    49     options->kernels = NULL;
    50     options->regions = NULL;
    51     options->matchChi2 = NULL;
    52     options->weightings = NULL;
     38    options->inputMask   = psVectorAlloc(num, PS_TYPE_VECTOR_MASK); // Mask for inputs
     39    options->inputSeeing = psVectorAlloc(num, PS_TYPE_F32);
     40    options->norm        = psVectorAlloc(num, PS_TYPE_F32);
     41    options->matchChi2   = psVectorAlloc(num, PS_TYPE_F32); // chi^2 for stamps when matching
     42    options->weightings  = psVectorAlloc(num, PS_TYPE_F32); // Combination weightings for images (1/noise^2)
     43
     44    psVectorInit(options->inputMask,   0);
     45    psVectorInit(options->inputSeeing, NAN);
     46    psVectorInit(options->norm,        NAN);
     47    psVectorInit(options->matchChi2,   NAN);
     48    psVectorInit(options->weightings,  NAN);
    5349
    5450    return options;
     
    6258    return PSPHOT_CNV_SRC_NONE;
    6359}
     60
     61pmFPAfile *psphotStackGetConvolveSource (pmConfig *config, psphotStackOptions *options, int index) {
     62
     63    // which image do we want to convolve?  RAW, CNV, AUTO?
     64    // find the currently selected readout
     65    pmFPAfile *fileRaw = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.RAW", index); // File of interest
     66    pmFPAfile *fileCnv = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.CNV", index); // File of interest
     67
     68    pmFPAfile *fileSrc = NULL;
     69
     70    switch (options->convolveSource) {
     71      case PSPHOT_CNV_SRC_AUTO:
     72        fileSrc = fileCnv ? fileCnv : fileRaw;
     73        break;
     74
     75      case PSPHOT_CNV_SRC_RAW:
     76        fileSrc = fileRaw;
     77        break;
     78
     79      case PSPHOT_CNV_SRC_CNV:
     80        fileSrc = fileCnv;
     81        break;
     82
     83      default:
     84        psAbort("impossible case");
     85    }
     86    if (!fileSrc) {
     87        psError(PSPHOT_ERR_CONFIG, true, "desired convolution source is missing (cnv : %llx, raw : %llx)", (long long) fileCnv, (long long) fileRaw);
     88    }
     89   
     90    return fileSrc;
     91}
Note: See TracChangeset for help on using the changeset viewer.