IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 25, 2007, 11:57:36 AM (19 years ago)
Author:
eugene
Message:

added galaxies, some tweaks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSim/src/ppSimCreate.c

    r14657 r14667  
    99pmFPAfile *ppSimCreate(pmConfig *config)
    1010{
     11    bool status;
     12    bool simImage = false;
    1113    PS_ASSERT_PTR_NON_NULL(config, NULL);
     14    pmFPA *fpa = NULL;
    1215
    13     pmFPA *fpa = pmFPAConstruct(config->camera); // FPA to contain the observation
    14     if (!fpa) {
    15         psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to construct an FPA from camera configuration.");
    16         return NULL;
     16    // the input image defines the camera.  if it is not supplied, the user must have
     17    // supplied a camera and other metadata on the command line
     18    pmFPAfile *input = pmFPAfileDefineFromArgs (&status, config, "PPIMAGE.INPUT", "INPUT");
     19    if (!input) {
     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        }
     26    } else {
     27        simImage = false;
     28        if (input->type != PM_FPA_FILE_IMAGE) {
     29            psError(PS_ERR_IO, true, "PPIMAGE.INPUT is not of type IMAGE");
     30            return NULL;
     31        }
     32        fpa = input->fpa;
    1733    }
    1834
     
    5672    }
    5773    simSources->save = true;
     74
     75    // if we have loaded an input image, we do not need to populate the fpa
     76    if (!simImage) {
     77        return file;
     78    }
    5879
    5980    pmFPALevel phuLevel = pmFPAPHULevel(file->format); // Level at which PHU goes
Note: See TracChangeset for help on using the changeset viewer.