Changeset 14657 for trunk/ppSim/src/ppSimCreate.c
- Timestamp:
- Aug 23, 2007, 2:52:55 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ppSim/src/ppSimCreate.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSim/src/ppSimCreate.c
r14531 r14657 1 1 # include "ppSim.h" 2 3 // XXX this function forces us to define the camera (on the command line) and format (via the 4 // PPSIM.OUTPUT entry). In this case, we need to set config->format,formatName based on these 5 // values. This will be a problem when we want to load an input image (in order to add fake 6 // stars). We will need to add some logic in ppSimArguments to distinguish the cases of 1) 7 // input image and 2) specified camera 2 8 3 9 pmFPAfile *ppSimCreate(pmConfig *config) … … 12 18 13 19 pmFPAfile *file = pmFPAfileDefineOutput(config, fpa, OUTPUT_FILE); 14 psFree(fpa);15 20 if (!file) { 16 21 psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to create output file from %s. " … … 20 25 if (file->type != PM_FPA_FILE_IMAGE) { 21 26 psError(PS_ERR_BAD_PARAMETER_TYPE, true, "%s type is not IMAGE", OUTPUT_FILE); 27 psFree(fpa); 22 28 psFree(file); 23 29 return NULL; … … 25 31 file->save = true; 26 32 33 config->format = psMemIncrRefCounter (file->format); 34 config->formatName = psStringCopy (file->formatName); 35 27 36 // have we supplied a psf model? 28 37 if (psMetadataLookupPtr(NULL, config->arguments, "PSPHOT.PSF")) { 29 38 bool status = false; 39 40 // tie the psf file to the chipMosaic 30 41 pmFPAfileBindFromArgs(&status, file, config, "PSPHOT.PSF.LOAD", "PSPHOT.PSF"); 31 42 if (!status) { 32 43 psError(PS_ERR_UNKNOWN, false, "Failed to find/build PSPHOT.PSF.LOAD"); 33 return status; 44 psFree(fpa); 45 psFree(file); 46 return NULL; 34 47 } 35 48 } 49 50 // XXX only invoke this code for OBJECT types of images 51 // PPSIM.SOURCES carries the constructed, fake sources with their true parameters 52 pmFPAfile *simSources = pmFPAfileDefineOutput (config, file->fpa, "PPSIM.SOURCES"); 53 if (!simSources) { 54 psError(PS_ERR_UNKNOWN, false, "Cannot find a rule for PPSIM.SOURCES"); 55 return false; 56 } 57 simSources->save = true; 36 58 37 59 pmFPALevel phuLevel = pmFPAPHULevel(file->format); // Level at which PHU goes … … 44 66 psFree(fpa); 45 67 psFree(view); 68 psFree(file); 46 69 return NULL; 47 70 } … … 55 78 psFree(fpa); 56 79 psFree(view); 80 psFree(file); 57 81 return NULL; 58 82 } … … 66 90 psFree(fpa); 67 91 psFree(view); 92 psFree(file); 68 93 return NULL; 69 94 } … … 71 96 } 72 97 } 98 99 psFree(fpa); 73 100 psFree(view); 74 101
Note:
See TracChangeset
for help on using the changeset viewer.
