Changeset 6552 for branches/rel10_ifa/psModules/src/astrom/pmHDU.c
- Timestamp:
- Mar 8, 2006, 5:08:08 PM (20 years ago)
- File:
-
- 1 edited
-
branches/rel10_ifa/psModules/src/astrom/pmHDU.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/rel10_ifa/psModules/src/astrom/pmHDU.c
r6519 r6552 9 9 { 10 10 psFree(hdu->extname); 11 psFree(hdu->format); 11 12 psFree(hdu->header); 12 13 psFree(hdu->images); … … 32 33 hdu->extname = psStringCopy(extname); 33 34 } 35 hdu->format = NULL; 34 36 hdu->header = NULL; 35 37 hdu->images = NULL; 36 38 hdu->table = NULL; 37 39 38 return file;40 return hdu; 39 41 } 40 42 … … 54 56 return false; 55 57 } 56 } else if (! psFitsMoveExtName(fits, hdu->extname)) { 57 psError(PS_ERR_IO, false, "Unable to move to extension %s\n", hdu->extname); 58 hdu->phu = true; 59 } else { 60 if (! psFitsMoveExtName(fits, hdu->extname)) { 61 psError(PS_ERR_IO, false, "Unable to move to extension %s\n", hdu->extname); 62 } 63 // Now, just in case for some reason the PHU has an extension name that we've moved to.... 64 if (psFitsGetExtNum(fits) == 0) { 65 hdu->phu = true; 66 } else { 67 hdu->phu = false; 68 } 58 69 } 59 70 … … 63 74 } 64 75 76 #ifdef FITS_TABLES 65 77 // What type is it? 66 78 if (psFitsIsImage(hdu->header)) { 79 #endif 67 80 if (hdu->images) { 68 81 psFree(hdu->images); // Blow away anything existing … … 70 83 hdu->images = psFitsReadImageCube(fits, psRegionSet(0,0,0,0)); 71 84 return true; 85 #ifdef FITS_TABLES 86 72 87 } 73 88 if (psFitsIsTable(hdu->table)) { … … 82 97 psError(PS_ERR_UNKNOWN, true, "No idea what this HDU consists of!\n"); 83 98 return false; 99 #endif 84 100 } 85 101 … … 99 115 } 100 116 117 #ifdef FITS_TABLES 101 118 if (hdu->images && (!hdu->table || psFitsIsImage(hdu->header))) { 119 #endif 102 120 psFitsWriteImageCube(fits, hdu->header, hdu->images, hdu->extname); 103 121 return true; 122 #ifdef FITS_TABLES 123 104 124 } 105 125 … … 111 131 psError(PS_ERR_IO, true, "No idea what this HDU consists of!\n"); 112 132 return false; 113 } 114 115 116 pmHDU *pmHDUFromFPA(pmFPA *fpa // FPA for which to find HDU 117 ) 118 { 119 return fpa->hdu; 120 } 121 122 pmHDU *pmHDUFromChip(pmChip *chip // Chip for which to find HDU 123 ) 124 { 125 pmHDU *hdu = chip->hdu; // The HDU information 126 if (!hdu) { 127 hdu = pmHDUFromFPA(chip->parent); // Grab HDU info from the FPA 128 } 129 130 return hdu; 131 } 132 133 pmHDU *pmHDUFromCell(pmCell *cell // Cell for which to find HDU 134 ) 135 { 136 pmHDU *hdu = cell->hdu; // The HDU information 137 if (!hdu) { 138 hdu = pmHDUFromChip(cell->parent); // Grab HDU info from the chip 139 } 140 141 return hdu; 142 } 143 133 #endif 134 } 144 135 145 136
Note:
See TracChangeset
for help on using the changeset viewer.
