Changeset 10512
- Timestamp:
- Dec 6, 2006, 2:46:09 PM (19 years ago)
- Location:
- trunk/psModules/src/camera
- Files:
-
- 3 edited
-
pmFPACopy.c (modified) (1 diff)
-
pmFPAMosaic.c (modified) (1 diff)
-
pmFPAWrite.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPACopy.c
r9589 r10512 333 333 // Update the concepts 334 334 psMetadataCopy(target->concepts, source->concepts); 335 psMetadataCopy(target->parent->concepts, source->parent->concepts); 335 336 336 337 target->data_exists = true; -
trunk/psModules/src/camera/pmFPAMosaic.c
r9945 r10512 1033 1033 // Currently, there's nothing interesting in the chip concepts that needs to be updated. 1034 1034 1035 // Copy the concepts for the target FPA 1036 target->parent->concepts = psMetadataCopy(target->parent->concepts, source->parent->concepts); 1037 1035 1038 // Now make a new readout to go in the target cell 1036 1039 pmReadout *newReadout = pmReadoutAlloc(targetCell); // New readout -
trunk/psModules/src/camera/pmFPAWrite.c
r10081 r10512 29 29 // File-static (private) functions 30 30 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 31 32 33 // Update the FPA.NAME, CHIP.NAME and CELL.NAME in the FITS header, if required 34 static bool updateNames(pmFPA *fpa, pmChip *chip, pmCell *cell) 35 { 36 pmHDU *hdu = pmHDUGetHighest(fpa, chip, cell); // Highest HDU, i.e., the PHU 37 if (!hdu) { 38 psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find HDU.\n"); 39 return false; 40 } 41 bool mdok; // Status of MD lookup 42 psMetadata *fileData = psMetadataLookupMetadata(&mdok, hdu->format, "FILE"); // File information 43 if (!mdok || !fileData) { 44 psError(PS_ERR_UNKNOWN, true, "Unable to find FILE information in camera format.\n"); 45 return false; 46 } 47 if (fpa) { 48 const char *fpaNameHdr = psMetadataLookupStr(&mdok, fileData, "FPA.NAME"); 49 if (mdok && fpaNameHdr && strlen(fpaNameHdr) > 0) { 50 const char *fpaName = psMetadataLookupStr(NULL, fpa->concepts, "FPA.NAME"); 51 psMetadataAddStr(hdu->header, PS_LIST_TAIL, fpaNameHdr, PS_META_REPLACE, "FPA name", fpaName); 52 } 53 } 54 if (chip) { 55 const char *chipNameHdr = psMetadataLookupStr(&mdok, fileData, "CHIP.NAME"); 56 if (mdok && chipNameHdr && strlen(chipNameHdr) > 0) { 57 const char *chipName = psMetadataLookupStr(NULL, chip->concepts, "CHIP.NAME"); 58 psMetadataAddStr(hdu->header, PS_LIST_TAIL, chipNameHdr, PS_META_REPLACE, "Chip name", chipName); 59 } 60 } 61 if (cell) { 62 const char *cellNameHdr = psMetadataLookupStr(&mdok, fileData, "CELL.NAME"); 63 if (mdok && cellNameHdr && strlen(cellNameHdr) > 0) { 64 const char *cellName = psMetadataLookupStr(NULL, cell->concepts, "CELL.NAME"); 65 psMetadataAddStr(hdu->header, PS_LIST_TAIL, cellNameHdr, PS_META_REPLACE, "Cell name", cellName); 66 } 67 } 68 return true; 69 } 31 70 32 71 // Return the appropriate image array for the given type … … 66 105 return false; 67 106 } 68 69 107 // Write a cell image/mask/weight 70 108 static bool cellWrite(pmCell *cell, // Cell to write … … 99 137 100 138 if (writeBlank || writeImage) { 139 updateNames(cell->parent->parent, cell->parent, cell); 101 140 pmConceptSource source = PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CELLS | 102 141 PM_CONCEPT_SOURCE_DEFAULTS; … … 147 186 148 187 if (writeBlank || writeImage) { 188 updateNames(chip->parent, chip, NULL); 149 189 pmConceptSource source = PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CELLS | 150 190 PM_CONCEPT_SOURCE_DEFAULTS; … … 176 216 } 177 217 218 178 219 // Write an FPA image/mask/weight 179 220 static bool fpaWrite(pmFPA *fpa, // FPA to write … … 208 249 209 250 if (writeBlank || writeImage) { 251 updateNames(fpa, NULL, NULL); 210 252 pmConceptSource source = PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CELLS | 211 253 PM_CONCEPT_SOURCE_DEFAULTS;
Note:
See TracChangeset
for help on using the changeset viewer.
