IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 15, 2008, 1:18:30 PM (17 years ago)
Author:
Paul Price
Message:

Using new pmSourceMatch and pmSourceMatchRelphot to do the source matching and relative photometry. This should be more accurate than measuring the magnitude difference image by image.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackCamera.c

    r20710 r20995  
    7373    bool haveWeights = false;           // Do we have weight maps?
    7474    bool havePSFs = false;              // Do we have PSFs?
    75     bool haveSources = (bool)psMetadataLookup(config->arguments, "PPSTACK.SOURCES"); // Have global sources?
    7675
    7776    psMetadata *inputs = psMetadataLookupMetadata(NULL, config->arguments, "INPUTS"); // The inputs info
     
    195194
    196195        // Add the sources file
    197         if (!haveSources) {
    198             if (!sources || strlen(sources) == 0) {
    199                 if (havePSFs) {
    200                     psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find SOURCES %d", i);
    201                     return false;
    202                 }
    203             } else {
    204                 if (!havePSFs) {
    205                     psWarning("SOURCES provided without PSF --- ignoring.");
    206                 } else {
    207                     psArray *sourcesFiles = psArrayAlloc(1); // Array of filenames for this FPA
    208                     sourcesFiles->data[0] = psMemIncrRefCounter(sources);
    209                     psMetadataAddArray(config->arguments, PS_LIST_TAIL, "SOURCES.FILENAMES", PS_META_REPLACE,
    210                                        "Filenames of SOURCES files", sourcesFiles);
    211                     psFree(sourcesFiles);
    212 
    213                     bool status;
    214                     pmFPAfile *sourcesFile = pmFPAfileBindFromArgs(&status, imageFile, config,
    215                                                                    "PPSTACK.INPUT.SOURCES",
    216                                                                    "SOURCES.FILENAMES");
    217                     if (!status) {
    218                         psError(PS_ERR_UNKNOWN, false, "Unable to define file from sources %d (%s)",
    219                                 i, sources);
    220                         return false;
    221                     }
    222                     if (sourcesFile->type != PM_FPA_FILE_CMF) {
    223                         psError(PS_ERR_IO, true, "PPSTACK.INPUT.SOURCES is not of type CMF");
    224                         return false;
    225                     }
    226                 }
     196        {
     197            psArray *sourcesFiles = psArrayAlloc(1); // Array of filenames for this FPA
     198            sourcesFiles->data[0] = psMemIncrRefCounter(sources);
     199            psMetadataAddArray(config->arguments, PS_LIST_TAIL, "SOURCES.FILENAMES", PS_META_REPLACE,
     200                               "Filenames of SOURCES files", sourcesFiles);
     201            psFree(sourcesFiles);
     202
     203            bool status;
     204            pmFPAfile *sourcesFile = pmFPAfileBindFromArgs(&status, imageFile, config,
     205                                                           "PPSTACK.INPUT.SOURCES", "SOURCES.FILENAMES");
     206            if (!status) {
     207                psError(PS_ERR_UNKNOWN, false, "Unable to define file from sources %d (%s)",
     208                        i, sources);
     209                return false;
     210            }
     211            if (sourcesFile->type != PM_FPA_FILE_CMF) {
     212                psError(PS_ERR_IO, true, "PPSTACK.INPUT.SOURCES is not of type CMF");
     213                return false;
    227214            }
    228215        }
     
    269256    }
    270257
    271     if (haveSources) {
    272         // Global list of sources for use as stamps
    273         bool status = false;            // Found the file?
    274         if (havePSFs) {
    275             pmFPAfile *sources = pmFPAfileDefineFromArgs(&status, config, "PPSTACK.INPUT.SOURCES",
    276                                                          "PPSTACK.SOURCES");
    277             if (!status) {
    278                 psError(PS_ERR_IO, false, "Failed to load file definition PPSTACK.INPUT.SOURCES");
    279                 return false;
    280             }
    281             if (sources && sources->type != PM_FPA_FILE_CMF) {
    282                 psError(PS_ERR_IO, true, "PPSTACK.SOURCES is not of type CMF");
    283                 return false;
    284             }
    285         }
    286     }
    287 
    288258    psMetadataAddS32(config->arguments, PS_LIST_TAIL, "INPUTS.NUM", 0, "Number of input files", i);
    289259    psMetadataAddBool(config->arguments, PS_LIST_TAIL, "HAVE.PSF", 0, "Have PSFs available?", havePSFs);
    290     psMetadataAddBool(config->arguments, PS_LIST_TAIL, "HAVE.SOURCES", 0, "Have global sources?",
    291                       haveSources);
    292260
    293261    // Output image
Note: See TracChangeset for help on using the changeset viewer.