Changeset 23719 for branches/pap/ppSub/src/ppSubCamera.c
- Timestamp:
- Apr 6, 2009, 6:52:51 PM (17 years ago)
- Location:
- branches/pap/ppSub/src
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ppSubCamera.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap/ppSub/src
- Property svn:ignore
-
old new 10 10 stamp-h1 11 11 ppSubKernel 12 ppSubErrorCodes.h 13 ppSubErrorCodes.c
-
- Property svn:ignore
-
branches/pap/ppSub/src/ppSubCamera.c
r23711 r23719 134 134 135 135 136 bool ppSubCamera(pmConfig *config )136 bool ppSubCamera(pmConfig *config, ppSubData *data) 137 137 { 138 138 psAssert(config, "Require configuration"); … … 147 147 pmFPAfile *inVar = defineInputFile(config, input, "PPSUB.INPUT.VARIANCE", "INPUT.VARIANCE", 148 148 PM_FPA_FILE_VARIANCE); 149 defineInputFile(config, input, "PPSUB.INPUT.SOURCES", "INPUT.SOURCES", PM_FPA_FILE_CMF);149 defineInputFile(config, NULL, "PPSUB.INPUT.SOURCES", "INPUT.SOURCES", PM_FPA_FILE_CMF); 150 150 151 151 // Reference image … … 158 158 pmFPAfile *refVar = defineInputFile(config, ref, "PPSUB.REF.VARIANCE", "REF.VARIANCE", 159 159 PM_FPA_FILE_VARIANCE); 160 defineInputFile(config, ref, "PPSUB.REF.SOURCES", "REF.SOURCES", PM_FPA_FILE_CMF); 160 defineInputFile(config, NULL, "PPSUB.REF.SOURCES", "REF.SOURCES", PM_FPA_FILE_CMF); 161 162 163 // Convolved input image 164 pmFPAfile *inConvImage = defineOutputFile(config, input, true, "PPSUB.INPUT.CONV", PM_FPA_FILE_IMAGE); 165 pmFPAfile *inConvMask = defineOutputFile(config, inConvImage, false, "PPSUB.INPUT.CONV.MASK", 166 PM_FPA_FILE_MASK); 167 if (!inConvImage || !inConvMask) { 168 psError(PS_ERR_UNKNOWN, false, "Unable to define output files"); 169 return false; 170 } 171 if (inVar) { 172 pmFPAfile *inConvVar = defineOutputFile(config, inConvImage, false, "PPSUB.INPUT.CONV.VARIANCE", 173 PM_FPA_FILE_VARIANCE); 174 if (!inConvVar) { 175 psError(PS_ERR_UNKNOWN, false, "Unable to define output files"); 176 return false; 177 } 178 } 179 180 // Convolved ref image 181 pmFPAfile *refConvImage = defineOutputFile(config, input, true, "PPSUB.REF.CONV", PM_FPA_FILE_IMAGE); 182 pmFPAfile *refConvMask = defineOutputFile(config, refConvImage, false, "PPSUB.REF.CONV.MASK", 183 PM_FPA_FILE_MASK); 184 if (!refConvImage || !refConvMask) { 185 psError(PS_ERR_UNKNOWN, false, "Unable to define output files"); 186 return false; 187 } 188 if (refVar) { 189 pmFPAfile *refConvVar = defineOutputFile(config, refConvImage, false, "PPSUB.REF.CONV.VARIANCE", 190 PM_FPA_FILE_VARIANCE); 191 if (!refConvVar) { 192 psError(PS_ERR_UNKNOWN, false, "Unable to define output files"); 193 return false; 194 } 195 } 161 196 162 197 … … 172 207 173 208 // Output image 174 pmFPAfile *output = defineOutputFile(config, in put, true, "PPSUB.OUTPUT", PM_FPA_FILE_IMAGE);209 pmFPAfile *output = defineOutputFile(config, inConvImage, true, "PPSUB.OUTPUT", PM_FPA_FILE_IMAGE); 175 210 pmFPAfile *outMask = defineOutputFile(config, output, false, "PPSUB.OUTPUT.MASK", PM_FPA_FILE_MASK); 176 211 if (!output || !outMask) { … … 190 225 } 191 226 227 pmFPAfile *inverse = NULL; // Inverse output image 192 228 if (data->inverse) { 193 229 // Inverse output image 194 pmFPAfile *inverse = defineOutputFile(config, input, true, "PPSUB.INV", PM_FPA_FILE_IMAGE);230 inverse = defineOutputFile(config, output, true, "PPSUB.INVERSE", PM_FPA_FILE_IMAGE); 195 231 pmFPAfile *invMask = defineOutputFile(config, inverse, false, "PPSUB.INVERSE.MASK", 196 232 PM_FPA_FILE_MASK); 197 if (!inv || !invMask) {233 if (!inverse || !invMask) { 198 234 psError(PS_ERR_UNKNOWN, false, "Unable to define output files"); 199 235 return false; … … 212 248 } 213 249 214 // Convolved input image215 pmFPAfile *inConvImage = defineOutputFile(config, input, true, "PPSUB.INPUT.CONV", PM_FPA_FILE_IMAGE);216 pmFPAfile *inConvMask = defineOutputFile(config, inConvImage, false, "PPSUB.INPUT.CONV.MASK",217 PM_FPA_FILE_MASK);218 if (!inConvImage || !inConvMask) {219 psError(PS_ERR_UNKNOWN, false, "Unable to define output files");220 return false;221 }222 if (inVar) {223 pmFPAfile *inConvVar = defineOutputFile(config, inConvImage, false, "PPSUB.INPUT.CONV.VARIANCE",224 PM_FPA_FILE_VARIANCE);225 if (!inConvVar) {226 psError(PS_ERR_UNKNOWN, false, "Unable to define output files");227 return false;228 }229 }230 231 // Convolved ref image232 pmFPAfile *refConvImage = defineOutputFile(config, input, true, "PPSUB.REF.CONV", PM_FPA_FILE_IMAGE);233 pmFPAfile *refConvMask = defineOutputFile(config, refConvImage, false, "PPSUB.REF.CONV.MASK",234 PM_FPA_FILE_MASK);235 if (!refConvImage || !refConvMask) {236 psError(PS_ERR_UNKNOWN, false, "Unable to define output files");237 return false;238 }239 if (refVar) {240 pmFPAfile *refConvVar = defineOutputFile(config, refConvImage, false, "PPSUB.REF.CONV.VARIANCE",241 PM_FPA_FILE_VARIANCE);242 if (!refConvVar) {243 psError(PS_ERR_UNKNOWN, false, "Unable to define output files");244 return false;245 }246 }247 248 250 249 251 // Output JPEGs … … 276 278 } 277 279 278 psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSUB_RECIPE); // Recipe for ppSim279 if (!recipe) {280 psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find recipe %s", PPSUB_RECIPE);281 return false;282 }283 284 280 // psPhot input 285 281 if (data->photometry) { 286 282 psphotModelClassInit(); // load implementation-specific models 287 283 288 // Internal-ish file for getting the PSF from the minuend289 pmFPAfile *psf = pmFPAfileDefineOutputFromFile(config, output, "PSPHOT.PSF.LOAD");290 if (!psf) {291 psError(PS_ERR_IO, false, "Failed to build FPA from PSPHOT.PSF.LOAD");292 return false;293 }294 if (psf->type != PM_FPA_FILE_PSF) {295 psError(PS_ERR_IO, true, "PSPHOT.PSF.LOAD is not of type PSF");296 return false;297 }298 pmFPAfileActivate(config->files, false, "PSPHOT.PSF.LOAD");299 300 284 pmFPAfile *psphot = pmFPAfileDefineFromFPA(config, output->fpa, 1, 1, "PSPHOT.INPUT"); 301 285 if (!psphot) { … … 307 291 return false; 308 292 } 293 pmFPAfileActivate(config->files, false, "PSPHOT.INPUT"); 294 295 // Internal-ish file for getting the PSF from the minuend 296 pmFPAfile *psf = pmFPAfileDefineOutputFromFile(config, psphot, "PSPHOT.PSF.LOAD"); 297 if (!psf) { 298 psError(PS_ERR_IO, false, "Failed to build FPA from PSPHOT.PSF.LOAD"); 299 return false; 300 } 301 if (psf->type != PM_FPA_FILE_PSF) { 302 psError(PS_ERR_IO, true, "PSPHOT.PSF.LOAD is not of type PSF"); 303 return false; 304 } 305 pmFPAfileActivate(config->files, false, "PSPHOT.PSF.LOAD"); 309 306 310 307 if (!psphotDefineFiles(config, psphot)) { … … 326 323 327 324 if (data->inverse) { 328 pmFPAfile *invSources = defineOutputFile(config, inverse, false, "PPSUB. OUTPUT.SOURCES",325 pmFPAfile *invSources = defineOutputFile(config, inverse, false, "PPSUB.INVERSE.SOURCES", 329 326 PM_FPA_FILE_CMF); 330 327 if (!invSources) { … … 332 329 return false; 333 330 } 334 }335 invSources->save = true;331 invSources->save = true; 332 } 336 333 } 337 334
Note:
See TracChangeset
for help on using the changeset viewer.
