IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 15, 2008, 12:01:36 PM (18 years ago)
Author:
eugene
Message:

working on getting the input image options right

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20080511/ppSim/src/ppSimCreate.c

    r17672 r17702  
    1717            return NULL;
    1818        }
    19 
    20         simImage = true;
    21         fpa = pmFPAConstruct(config->camera); // FPA to contain the observation
    22         if (!fpa) {
    23             psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to construct an FPA from camera configuration.");
    24             return NULL;
    25         }
    2619    } else {
     20      // If an image is supplied, we still generate a fake image and merge them together downstream
     21      // (otherwise, we get the variance wrong).
    2722        simImage = false;
    2823        if (input->type != PM_FPA_FILE_IMAGE) {
     
    3025            return NULL;
    3126        }
    32         fpa = psMemIncrRefCounter (input->fpa);
     27    }
     28
     29    // generate the fpa structure used by the output camera (determined from INPUT or specified)
     30    assert (config->camera);
     31    fpa = pmFPAConstruct(config->camera); // FPA to contain the observation
     32    if (!fpa) {
     33      psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to construct an FPA from camera configuration.");
     34      return NULL;
    3335    }
    3436
     
    98100
    99101    // PPSIM.SOURCES carries the constructed, fake sources with their true parameters
    100     // XXX only invoke this code for OBJECT types of images
     102    // XXX only invoke this code for OBJECT types of images?
    101103    pmFPAfile *simSources = pmFPAfileDefineOutput (config, output->fpa, "PPSIM.SOURCES");
    102104    if (!simSources) {
     
    106108    simSources->save = true;
    107109
    108     // if we have loaded an input image, we do not need to populate the fpa
    109     if (!simImage) {
     110    // if we have loaded an input image, we derive certain values from the image, if possible
     111    if (input) {
    110112        // we need to extract certain metadata from the image and populate the recipe.
    111113        // or else we need to set the fpa concepts based on the recipe options...
     
    118120        float zp = ppSimGetZeroPoint (recipe, filter);
    119121        psMetadataAddF32(recipe, PS_LIST_TAIL, "ZEROPOINT", PS_META_REPLACE, "Photometric zeropoint", zp);
    120 
    121         return output;
    122122    }
    123123
Note: See TracChangeset for help on using the changeset viewer.