- Timestamp:
- Apr 9, 2010, 4:41:16 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/stackphot.20100406/psphot/src/psphotStackParseCamera.c
r27625 r27649 15 15 } 16 16 17 psMetadataItem *item = NULL;18 int nInputs = 0;19 while ((item = psMetadataGet(inputs, nInputs)) != NULL) { 17 int nInputs = inputs->list->n; 18 for (int i = 0; i < nInputs; i++) { 19 psMetadataItem *item = psMetadataGet(inputs, i); 20 20 if (item->type != PS_DATA_METADATA) { 21 21 psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Component %s of the input metadata is not of type METADATA", item->name); … … 34 34 pmFPAfile *imageFile = defineFile(config, NULL, "PSPHOT.INPUT", image, PM_FPA_FILE_IMAGE); // File for image 35 35 if (!imageFile) { 36 psError(PS_ERR_UNKNOWN, false, "Unable to define file from image %d (%s)", nInputs, image);36 psError(PS_ERR_UNKNOWN, false, "Unable to define file from image %d (%s)", i, image); 37 37 return false; 38 38 } … … 40 40 psString mask = psMetadataLookupStr(&status, input, "MASK"); // Name of mask 41 41 if (mask && strlen(mask) > 0) { 42 if (!defineFile(config, imageFile, "PSPHOT. INPUT.MASK", mask, PM_FPA_FILE_MASK)) {43 psError(PS_ERR_UNKNOWN, false, "Unable to define file from mask %d (%s)", nInputs, mask);42 if (!defineFile(config, imageFile, "PSPHOT.MASK", mask, PM_FPA_FILE_MASK)) { 43 psError(PS_ERR_UNKNOWN, false, "Unable to define file from mask %d (%s)", i, mask); 44 44 return false; 45 45 } … … 48 48 psString variance = psMetadataLookupStr(&status, input, "VARIANCE"); // Name of variance map 49 49 if (variance && strlen(variance) > 0) { 50 if (!defineFile(config, imageFile, "PSPHOT. INPUT.VARIANCE", variance, PM_FPA_FILE_VARIANCE)) {51 psError(PS_ERR_UNKNOWN, false, "Unable to define file from variance %d (%s)", nInputs, variance);50 if (!defineFile(config, imageFile, "PSPHOT.VARIANCE", variance, PM_FPA_FILE_VARIANCE)) { 51 psError(PS_ERR_UNKNOWN, false, "Unable to define file from variance %d (%s)", i, variance); 52 52 return false; 53 53 } 54 54 } 55 nInputs ++; 55 // the output sources are carried on the input->fpa structures 56 pmFPAfile *outsources = pmFPAfileDefineOutputFromFile (config, imageFile, "PSPHOT.STACK.OUTPUT"); 57 if (!outsources) { 58 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.STACK.OUTPUT"); 59 return false; 60 } 61 outsources->save = true; 62 outsources->fileID = i; // this is used to generate output names 56 63 } 57 64 psMetadataRemoveKey(config->arguments, "FILENAMES"); 58 65 psMetadataAddS32 (config->arguments, PS_LIST_TAIL, "PSPHOT.INPUT.NUM", PS_META_REPLACE, "number of inputs", nInputs); 66 67 if (!psphotSetMaskBits (config)) { 68 psError (PS_ERR_UNKNOWN, false, "failed to set mask bit values"); 69 return NULL; 70 } 59 71 60 72 // generate an pmFPAimage for the chisqImage … … 64 76 return false; 65 77 } 66 pmFPAfile *chisqMask = pmFPAfileDefineOutput(config, chisqImage->fpa, "PPIMAGE.CHISQ.MASK"); 78 chisqImage->save = true; 79 80 pmFPAfile *chisqMask = pmFPAfileDefineOutput(config, chisqImage->fpa, "PSPHOT.CHISQ.MASK"); 67 81 if (!chisqMask) { 68 psError(PS_ERR_IO, false, _("Unable to generate output file from P PIMAGE.CHISQ.MASK"));82 psError(PS_ERR_IO, false, _("Unable to generate output file from PSPHOT.CHISQ.MASK")); 69 83 return NULL; 70 84 } 71 85 if (chisqMask->type != PM_FPA_FILE_MASK) { 72 psError(PS_ERR_IO, true, "P PIMAGE.CHISQ.MASK is not of type MASK");86 psError(PS_ERR_IO, true, "PSPHOT.CHISQ.MASK is not of type MASK"); 73 87 return NULL; 74 88 } 75 pmFPAfile *chisqVariance = pmFPAfileDefineOutput(config, chisqImage->fpa, "PPIMAGE.CHISQ.VARIANCE"); 89 chisqMask->save = true; 90 91 pmFPAfile *chisqVariance = pmFPAfileDefineOutput(config, chisqImage->fpa, "PSPHOT.CHISQ.VARIANCE"); 76 92 if (!chisqVariance) { 77 psError(PS_ERR_IO, false, _("Unable to generate output file from P PIMAGE.CHISQ.VARIANCE"));93 psError(PS_ERR_IO, false, _("Unable to generate output file from PSPHOT.CHISQ.VARIANCE")); 78 94 return NULL; 79 95 } 80 96 if (chisqVariance->type != PM_FPA_FILE_VARIANCE) { 81 psError(PS_ERR_IO, true, "P PIMAGE.CHISQ.VARIANCE is not of type VARIANCE");97 psError(PS_ERR_IO, true, "PSPHOT.CHISQ.VARIANCE is not of type VARIANCE"); 82 98 return NULL; 83 99 } 100 chisqVariance->save = true; 84 101 85 102 # if (0)
Note:
See TracChangeset
for help on using the changeset viewer.
