Changeset 18601 for trunk/psModules/src/objects/pmPSF_IO.c
- Timestamp:
- Jul 17, 2008, 12:38:15 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmPSF_IO.c (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmPSF_IO.c
r18600 r18601 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.3 3$ $Name: not supported by cvs2svn $9 * @date $Date: 2008-07-17 2 0:43:38$8 * @version $Revision: 1.34 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2008-07-17 22:38:15 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 35 35 #include "pmFPAview.h" 36 36 #include "pmFPAfile.h" 37 #include "pmFPAfileFitsIO.h" 37 38 38 39 #include "pmPeaks.h" … … 107 108 } 108 109 109 bool pmPSFmodelWriteForView (const pmFPAview *view, pmFPAfile *file, constpmConfig *config)110 bool pmPSFmodelWriteForView (const pmFPAview *view, pmFPAfile *file, pmConfig *config) 110 111 { 111 112 PS_ASSERT_PTR_NON_NULL(view, false); … … 142 143 143 144 // read in all chip-level PSFmodel files for this FPA 144 bool pmPSFmodelWriteFPA (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, constpmConfig *config)145 bool pmPSFmodelWriteFPA (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config) 145 146 { 146 147 PS_ASSERT_PTR_NON_NULL(view, false); … … 164 165 165 166 // read in all cell-level PSFmodel files for this chip 166 bool pmPSFmodelWriteChip (pmChip *chip, const pmFPAview *view, pmFPAfile *file, constpmConfig *config)167 bool pmPSFmodelWriteChip (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config) 167 168 { 168 169 PS_ASSERT_PTR_NON_NULL(view, false); … … 185 186 // - psf table (+header) : FITS Table 186 187 bool pmPSFmodelWrite (psMetadata *analysis, const pmFPAview *view, 187 pmFPAfile *file, constpmConfig *config)188 pmFPAfile *file, pmConfig *config) 188 189 { 189 190 PS_ASSERT_PTR_NON_NULL(view, false); … … 208 209 209 210 // get the current header 210 pmHDU *hdu = pmFPAviewThisHDU (view, file->fpa); 211 pmFPA *fpa = pmFPAfileSuitableFPA(file, view, config, false); // Suitable FPA for writing 212 pmHDU *hdu = psMemIncrRefCounter(pmFPAviewThisHDU(view, fpa)); 213 psFree(fpa); 211 214 if (!hdu) { 212 215 psError(PS_ERR_UNKNOWN, false, "Unable to find HDU"); … … 229 232 if (!menu) { 230 233 psError(PS_ERR_UNKNOWN, true, "missing EXTNAME.RULES in camera.config"); 234 psFree(hdu); 231 235 return false; 232 236 } … … 236 240 if (!rule) { 237 241 psError(PS_ERR_UNKNOWN, false, "missing entry for PSF.HEAD in EXTNAME.RULES in camera.config"); 242 psFree(hdu); 238 243 return false; 239 244 } … … 245 250 psError(PS_ERR_UNKNOWN, false, "missing entry for PSF.TABLE in EXTNAME.RULES in camera.config"); 246 251 psFree (headName); 252 psFree(hdu); 247 253 return false; 248 254 } … … 255 261 psFree (headName); 256 262 psFree (tableName); 263 psFree(hdu); 257 264 return false; 258 265 } … … 278 285 psFree (headName); 279 286 } 287 psFree(hdu); 280 288 281 289 // select the psf of interest … … 481 489 482 490 // if this file needs to have a PHU written out, write one 483 bool pmPSFmodelWritePHU (const pmFPAview *view, pmFPAfile *file, constpmConfig *config)491 bool pmPSFmodelWritePHU (const pmFPAview *view, pmFPAfile *file, pmConfig *config) 484 492 { 485 493 PS_ASSERT_PTR_NON_NULL(view, false); … … 496 504 if (file->fpa->chips->n == 1) return true; 497 505 506 498 507 // find the FPA phu 499 pmHDU *phu = pmFPAviewThisPHU (view, file->fpa); 508 pmFPA *fpa = pmFPAfileSuitableFPA(file, view, config, false); // Suitable FPA for writing 509 pmHDU *phu = psMemIncrRefCounter(pmFPAviewThisPHU(view, fpa)); 510 psFree(fpa); 500 511 501 512 // if there is no PHU, this is a single header+image (extension-less) file. This could be … … 508 519 pmConfigConformHeader (outhead, file->format); 509 520 } 521 psFree(phu); 510 522 511 523 psMetadataAddBool (outhead, PS_LIST_TAIL, "EXTEND", PS_META_REPLACE, "this file has extensions", true);
Note:
See TracChangeset
for help on using the changeset viewer.
