Changeset 17630 for branches/eam_branch_20080511/ppSim/src/ppSimCreate.c
- Timestamp:
- May 11, 2008, 10:10:06 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20080511/ppSim/src/ppSimCreate.c
r17557 r17630 40 40 } 41 41 42 // define the output image file 42 // define the output image file -- this is the basis for the ppSimLoop 43 43 pmFPAfile *file = pmFPAfileDefineOutput(config, fpa, OUTPUT_FILE); 44 44 if (!file) { … … 53 53 return NULL; 54 54 } 55 // XXX we should not require the output image to be written 55 56 file->save = true; 56 57 … … 58 59 config->formatName = psStringCopy (file->formatName); 59 60 60 // have we supplied a psf model?61 if (psMetadataLookupPtr(NULL, config->arguments, "PSPHOT.PSF")) {62 bool status = false; 61 // For photometry, we operate on the chip-mosaicked image. we create a copy of the mosaicked 62 // image for psphot so we can write out a clean image 63 if (options->doPhotom) { 63 64 64 // tie the psf file to the chipMosaic 65 pmFPAfileBindFromArgs(&status, file, config, "PSPHOT.PSF.LOAD", "PSPHOT.PSF"); 66 if (!status) { 67 psError(PS_ERR_UNKNOWN, false, "Failed to find/build PSPHOT.PSF.LOAD"); 68 psFree(fpa); 69 psFree(file); 70 return NULL; 65 // we need a chip image if we perform photometry (is it necessary to build it if we don't use it?) 66 pmFPAfile *chipImage = pmFPAfileDefineChipMosaic(config, output->fpa, "PPSIM.CHIP"); 67 if (!chipImage) { 68 psError(PS_ERR_IO, false, _("Unable to generate new file from PPSIM.CHIP")); 69 psFree(options); 70 return NULL; 71 } 72 if (chipImage->type != PM_FPA_FILE_IMAGE) { 73 psError(PS_ERR_IO, true, "PPSIM.CHIP is not of type IMAGE"); 74 psFree(options); 75 return NULL; 76 } 77 78 // this file is just used as a carrier; output files (eg, PSPHOT.RESID) are defined by 79 // psphotDefineFiles 80 pmFPAfile *psphotInput = pmFPAfileDefineFromFile (config, chipImage, 1, 1, "PSPHOT.INPUT"); 81 PS_ASSERT (psphotInput, false); 82 83 // define associated psphot input/output files 84 if (!psphotDefineFiles (config, psphotInput)) { 85 psError(PSPHOT_ERR_CONFIG, false, "Trouble defining the additional input/output files for psphot"); 86 return false; 71 87 } 88 } else { 89 // have we supplied a psf model? this happens in psphotDefineFiles if we request a photometry 90 // analysis. however, even if we do not, a psf model may be used to generate the fake 91 // sources. 92 if (psMetadataLookupPtr(NULL, config->arguments, "PSPHOT.PSF")) { 93 // tie the psf file to the chipMosaic 94 pmFPAfileBindFromArgs(&status, file, config, "PSPHOT.PSF.LOAD", "PSPHOT.PSF"); 95 if (!status) { 96 psError(PS_ERR_UNKNOWN, false, "Failed to find/build PSPHOT.PSF.LOAD"); 97 psFree(fpa); 98 psFree(file); 99 return NULL; 100 } 101 } 72 102 } 73 103 104 // PPSIM.SOURCES carries the constructed, fake sources with their true parameters 74 105 // XXX only invoke this code for OBJECT types of images 75 // PPSIM.SOURCES carries the constructed, fake sources with their true parameters76 106 pmFPAfile *simSources = pmFPAfileDefineOutput (config, file->fpa, "PPSIM.SOURCES"); 77 107 if (!simSources) {
Note:
See TracChangeset
for help on using the changeset viewer.
