Changeset 11375 for trunk/psModules/src/config/pmConfigCamera.c
- Timestamp:
- Jan 29, 2007, 11:46:38 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/config/pmConfigCamera.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/config/pmConfigCamera.c
r11370 r11375 8 8 9 9 10 // Update the sources of the concepts, so that they all come from the headers. 11 static void updateConceptsSources(psList *concepts, // List of concepts 12 psMetadata *translation, // Header concepts 13 psMetadata *database, // Database concepts 14 psMetadata *defaults, // Defaults concepts 15 psMetadata *formats, // Concepts formats 16 pmFPALevel level // Mosaic level 10 // Remove a concept from the list of sources. Need to check to see if it exists first, to avoid a warning. 11 static void removeConcept(psMetadata *source, // Source from which to remove concept 12 const char *concept // Concept name to remove 13 ) 14 { 15 assert(source); 16 assert(concept && strlen(concept) > 0); 17 18 if (psMetadataLookup(source, concept)) { 19 psMetadataRemoveKey(source, concept); 20 } 21 22 return; 23 } 24 25 // Remove certain concepts from the list of sources. These concepts are important in the mosaicking process, 26 // and are added explicitly to the defaults (elsewhere) so that the user can't get them wrong. 27 static void removeConceptsSources(psMetadata *source // Source for concepts 17 28 ) 18 29 { 19 assert(concepts); 20 assert(translation); 21 assert(level == PM_FPA_LEVEL_CHIP || level == PM_FPA_LEVEL_FPA); 22 return; 23 24 psListIterator *iter = psListIteratorAlloc(concepts, PS_LIST_HEAD, false); // Iterator 25 psString concept; // Concept, from iteration 26 while ((concept = psListGetAndIncrement(iter))) { 27 // skip concepts added explicitly 28 if (!strcmp(concept, "CELL.BIASSEC")) 29 goto skip; 30 if (!strcmp(concept, "CELL.TRIMSEC")) 31 goto skip; 32 if (!strcmp(concept, "CELL.XPARITY")) 33 goto skip; 34 if (!strcmp(concept, "CELL.YPARITY")) 35 goto skip; 36 if (!strcmp(concept, "CELL.X0")) 37 goto skip; 38 if (!strcmp(concept, "CELL.Y0")) 39 goto skip; 40 if ((level == PM_FPA_LEVEL_FPA) && !strcmp(concept, "CHIP.XPARITY")) 41 goto skip; 42 if ((level == PM_FPA_LEVEL_FPA) && !strcmp(concept, "CHIP.YPARITY")) 43 goto skip; 44 if ((level == PM_FPA_LEVEL_FPA) && !strcmp(concept, "CHIP.X0")) 45 goto skip; 46 if ((level == PM_FPA_LEVEL_FPA) && !strcmp(concept, "CHIP.Y0")) 47 goto skip; 48 psMetadataAddStr(translation, PS_LIST_TAIL, concept, PS_META_REPLACE, NULL, concept); 49 skip: 50 if (database && psMetadataLookup(database, concept)) { 51 psMetadataRemoveKey(database, concept); 52 } 53 if (defaults && psMetadataLookup(defaults, concept)) { 54 psMetadataRemoveKey(defaults, concept); 55 } 56 } 57 psFree(iter); 30 if (!source) { 31 return; 32 } 33 34 removeConcept(source, "CELL.BIASSEC"); 35 removeConcept(source, "CELL.TRIMSEC"); 36 removeConcept(source, "CELL.XPARITY"); 37 removeConcept(source, "CELL.YPARITY"); 38 removeConcept(source, "CELL.X0"); 39 removeConcept(source, "CELL.Y0"); 40 removeConcept(source, "CHIP.XPARITY"); 41 removeConcept(source, "CHIP.YPARITY"); 42 removeConcept(source, "CHIP.X0"); 43 removeConcept(source, "CHIP.Y0"); 58 44 59 45 return; … … 281 267 // Update the concepts, so that they are all stored in the FITS headers, under headers of the same 282 268 // name as the concept 283 psMetadata *conceptsFormats = psMetadataLookupMetadata(&mdok, format, "FORMATS"); // Concepts FORMATS284 269 psMetadata *database = psMetadataLookupMetadata(&mdok, format, "DATABASE"); // DATABASE concepts 285 270 psMetadata *defaults = psMetadataLookupMetadata(&mdok, format, "DEFAULTS"); // DEFAULTS concepts … … 295 280 continue; 296 281 } 297 psList *concepts = pmConceptsList(PM_FPA_LEVEL_CELL); // List of concepts 298 updateConceptsSources(concepts, translation, database, defaults, conceptsFormats, level); 299 psFree(concepts); 300 concepts = pmConceptsList(PM_FPA_LEVEL_CHIP); 301 updateConceptsSources(concepts, translation, database, defaults, conceptsFormats, level); 302 psFree(concepts); 303 concepts = pmConceptsList(PM_FPA_LEVEL_FPA); 304 updateConceptsSources(concepts, translation, database, defaults, conceptsFormats, level); 305 psFree(concepts); 282 283 removeConceptsSources(translation); 284 removeConceptsSources(database); 285 removeConceptsSources(defaults); 306 286 307 287 // Add in the positioning concepts 308 psMetadataAddS32(defaults, PS_LIST_TAIL, "CHIP.XPARITY", PS_META_REPLACE, NULL, 1);309 psMetadataAddS32(defaults, PS_LIST_TAIL, "CHIP.YPARITY", PS_META_REPLACE, NULL, 1);310 psMetadataAddS32(defaults, PS_LIST_TAIL, "CELL.XPARITY", PS_META_REPLACE, NULL, 1);311 psMetadataAddS32(defaults, PS_LIST_TAIL, "CELL.YPARITY", PS_META_REPLACE, NULL, 1);312 psMetadataAddS32(defaults, PS_LIST_TAIL, "CELL.X0", PS_META_REPLACE, NULL, 0);313 psMetadataAddS32(defaults, PS_LIST_TAIL, "CELL.Y0", PS_META_REPLACE, NULL, 0);288 psMetadataAddS32(defaults, PS_LIST_TAIL, "CHIP.XPARITY", 0, NULL, 1); 289 psMetadataAddS32(defaults, PS_LIST_TAIL, "CHIP.YPARITY", 0, NULL, 1); 290 psMetadataAddS32(defaults, PS_LIST_TAIL, "CELL.XPARITY", 0, NULL, 1); 291 psMetadataAddS32(defaults, PS_LIST_TAIL, "CELL.YPARITY", 0, NULL, 1); 292 psMetadataAddS32(defaults, PS_LIST_TAIL, "CELL.X0", 0, NULL, 0); 293 psMetadataAddS32(defaults, PS_LIST_TAIL, "CELL.Y0", 0, NULL, 0); 314 294 if (formats) { 315 295 if (psMetadataLookup(formats, "CELL.X0")) { … … 322 302 323 303 if (level == PM_FPA_LEVEL_FPA) { 324 psMetadataAddS32(defaults, PS_LIST_TAIL, "CHIP.X0", PS_META_REPLACE, NULL, 0);325 psMetadataAddS32(defaults, PS_LIST_TAIL, "CHIP.Y0", PS_META_REPLACE, NULL, 0);304 psMetadataAddS32(defaults, PS_LIST_TAIL, "CHIP.X0", 0, NULL, 0); 305 psMetadataAddS32(defaults, PS_LIST_TAIL, "CHIP.Y0", 0, NULL, 0); 326 306 if (formats) { 327 307 if (psMetadataLookup(formats, "CHIP.X0")) {
Note:
See TracChangeset
for help on using the changeset viewer.
