- Timestamp:
- Dec 24, 2010, 3:02:58 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20101205/ppSim/src/ppSimCreate.c
r29125 r30151 132 132 bool doPhotom = psMetadataLookupBool(&status, recipe, "PHOTOM"); // Density of fakes 133 133 if (doPhotom) { 134 135 // XXX at the moment, we can perform photometry on the fake sources and the forced 136 // photometry positions, but not one or the other. Also, we only support photometry in 137 // the context of an image previously analysed by psphot. Add support for: 138 // * photometry of a pure fake image (requires peak detection and psf creation) 139 // * photometry of forced source positions without fake image (this might work, it just 140 // requires not generating any fake features). 141 142 if (!input) { 143 psError(PS_ERR_UNKNOWN, false, "input image not found; currently required for photometry"); 144 return NULL; 145 } 146 147 // we need a chip image if we perform photometry (is it necessary to build it if we don't use it?) 148 pmFPAfile *fakeImage = pmFPAfileDefineChipMosaic(config, output->fpa, "PPSIM.FAKE.CHIP"); 149 if (!fakeImage) { 150 psError(PS_ERR_IO, false, _("Unable to generate new file from PPSIM.FAKE.CHIP")); 151 psFree(fpa); 152 return NULL; 153 } 154 if (fakeImage->type != PM_FPA_FILE_IMAGE) { 155 psError(PS_ERR_IO, true, "PPSIM.FAKE.CHIP is not of type IMAGE"); 156 psFree(fpa); 157 return NULL; 158 } 159 160 // we need a chip image if we perform photometry (is it necessary to build it if we don't use it?) 161 pmFPAfile *forceImage = NULL; 162 if (input) { 163 forceImage = pmFPAfileDefineChipMosaic(config, input->fpa, "PPSIM.FORCE.CHIP"); 164 if (!forceImage) { 165 psError(PS_ERR_IO, false, _("Unable to generate new file from PPSIM.FORCE.CHIP")); 166 psFree(fpa); 167 return NULL; 168 } 169 if (forceImage->type != PM_FPA_FILE_IMAGE) { 170 psError(PS_ERR_IO, true, "PPSIM.FORCE.CHIP is not of type IMAGE"); 171 psFree(fpa); 172 return NULL; 173 } 174 } 175 176 // define associated psphot input/output files 177 if (!ppSimPhotomFiles (config, fakeImage, forceImage)) { 178 psError(PSPHOT_ERR_CONFIG, false, "Trouble defining the additional input/output files for psphot"); 179 psFree(fpa); 180 return NULL; 181 } 182 } else { 183 // have we supplied a psf model? this happens in ppSimPhotomFiles if we request a photometry 184 // analysis. however, even if we do not, a psf model may be used to generate the fake 185 // sources. 186 if (psMetadataLookupPtr(NULL, config->arguments, "PSPHOT.PSF")) { 187 // tie the psf file to the chipMosaic 188 pmFPAfileBindFromArgs(&status, output, config, "PSPHOT.PSF.LOAD", "PSPHOT.PSF"); 189 if (!status) { 190 psError(PS_ERR_UNKNOWN, false, "Failed to find/build PSPHOT.PSF.LOAD"); 191 psFree(fpa); 192 return NULL; 193 } 194 } 134 psError(PS_ERR_UNKNOWN, false, "in-line photometry in ppSim had been deprecated"); 135 return NULL; 136 } 137 138 // have we supplied a psf model? this happens in ppSimPhotomFiles if we request a photometry 139 // analysis. however, even if we do not, a psf model may be used to generate the fake 140 // sources. 141 if (psMetadataLookupPtr(NULL, config->arguments, "PSPHOT.PSF")) { 142 // tie the psf file to the chipMosaic 143 pmFPAfileBindFromArgs(&status, output, config, "PSPHOT.PSF.LOAD", "PSPHOT.PSF"); 144 if (!status) { 145 psError(PS_ERR_UNKNOWN, false, "Failed to find/build PSPHOT.PSF.LOAD"); 146 psFree(fpa); 147 return NULL; 148 } 195 149 } 196 150
Note:
See TracChangeset
for help on using the changeset viewer.
