Changeset 12832
- Timestamp:
- Apr 13, 2007, 5:22:48 PM (19 years ago)
- Location:
- trunk/psModules/src
- Files:
-
- 14 edited
-
camera/pmFPA_JPEG.c (modified) (6 diffs)
-
camera/pmFPA_JPEG.h (modified) (2 diffs)
-
camera/pmFPAfileFitsIO.c (modified) (3 diffs)
-
camera/pmFPAfileFitsIO.h (modified) (5 diffs)
-
camera/pmFPAfileIO.c (modified) (3 diffs)
-
camera/pmFPAfileIO.h (modified) (2 diffs)
-
objects/pmPSF_IO.c (modified) (11 diffs)
-
objects/pmPSF_IO.h (modified) (2 diffs)
-
objects/pmSourceIO.c (modified) (21 diffs)
-
objects/pmSourceIO.h (modified) (2 diffs)
-
objects/pmSourcePlotMoments.c (modified) (3 diffs)
-
objects/pmSourcePlotPSFModel.c (modified) (3 diffs)
-
objects/pmSourcePlots.c (modified) (5 diffs)
-
objects/pmSourcePlots.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPA_JPEG.c
r12696 r12832 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $8 * @date $Date: 2007-0 3-30 21:12:56$7 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-04-14 03:22:47 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 35 35 36 36 37 bool pmFPAviewWriteJPEG(const pmFPAview *view, pmFPAfile *file, pmConfig *config)37 bool pmFPAviewWriteJPEG(const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 38 38 { 39 39 PS_ASSERT_PTR_NON_NULL(view, false); … … 77 77 78 78 // read in all chip-level JPEG files for this FPA 79 bool pmFPAWriteJPEG (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config)79 bool pmFPAWriteJPEG (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 80 80 { 81 81 PS_ASSERT_PTR_NON_NULL(fpa, false); … … 92 92 93 93 // read in all cell-level JPEG files for this chip 94 bool pmChipWriteJPEG (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config)94 bool pmChipWriteJPEG (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 95 95 { 96 96 PS_ASSERT_PTR_NON_NULL(chip, false); … … 107 107 108 108 // read in all readout-level JPEG files for this cell 109 bool pmCellWriteJPEG (pmCell *cell, const pmFPAview *view, pmFPAfile *file, pmConfig *config)109 bool pmCellWriteJPEG (pmCell *cell, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 110 110 { 111 111 PS_ASSERT_PTR_NON_NULL(cell, false); … … 125 125 // just because the values are in a poor range. it is more convenient to know you are getting 126 126 // a jpeg which is weird than to fail to get the file at all. 127 bool pmReadoutWriteJPEG (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, pmConfig *config)127 bool pmReadoutWriteJPEG (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 128 128 { 129 129 bool status; -
trunk/psModules/src/camera/pmFPA_JPEG.h
r11253 r12832 4 4 * @author EAM, IfA 5 5 * 6 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $7 * @date $Date: 2007-0 1-24 02:54:14$6 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-04-14 03:22:47 $ 8 8 * Copyright 2004-2005 Institute for Astronomy, University of Hawaii 9 9 */ … … 15 15 /// @{ 16 16 17 bool pmFPAviewWriteJPEG (const pmFPAview *view, pmFPAfile *file, pmConfig *config);18 bool pmFPAWriteJPEG (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config);19 bool pmChipWriteJPEG (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config);20 bool pmCellWriteJPEG (pmCell *cell, const pmFPAview *view, pmFPAfile *file, pmConfig *config);21 bool pmReadoutWriteJPEG (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, pmConfig *config);17 bool pmFPAviewWriteJPEG (const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 18 bool pmFPAWriteJPEG (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 19 bool pmChipWriteJPEG (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 20 bool pmCellWriteJPEG (pmCell *cell, const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 21 bool pmReadoutWriteJPEG (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 22 22 23 23 /// @} -
trunk/psModules/src/camera/pmFPAfileFitsIO.c
r12696 r12832 322 322 } 323 323 324 bool pmFPAviewWriteFitsImage(const pmFPAview *view, pmFPAfile *file, pmConfig *config)324 bool pmFPAviewWriteFitsImage(const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 325 325 { 326 326 PS_ASSERT_PTR_NON_NULL(view, false); … … 329 329 } 330 330 331 bool pmFPAviewWriteFitsMask(const pmFPAview *view, pmFPAfile *file, pmConfig *config)331 bool pmFPAviewWriteFitsMask(const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 332 332 { 333 333 PS_ASSERT_PTR_NON_NULL(view, false); … … 336 336 } 337 337 338 bool pmFPAviewWriteFitsWeight(const pmFPAview *view, pmFPAfile *file, pmConfig *config)338 bool pmFPAviewWriteFitsWeight(const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 339 339 { 340 340 PS_ASSERT_PTR_NON_NULL(view, false); -
trunk/psModules/src/camera/pmFPAfileFitsIO.h
r11793 r12832 5 5 * @author PAP, IfA 6 6 * 7 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $8 * @date $Date: 2007-0 2-15 00:34:00$7 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-04-14 03:22:47 $ 9 9 * Copyright 2004-2005 Institute for Astronomy, University of Hawaii 10 10 */ … … 32 32 /// Read an image header into the current view 33 33 bool pmFPAviewReadFitsHeaderSet(const pmFPAview *view, ///< View specifying level of interest 34 pmFPAfile *file ///< FPA file into which to read34 pmFPAfile *file ///< FPA file into which to read 35 35 ); 36 36 … … 38 38 bool pmFPAviewWriteFitsImage(const pmFPAview *view, ///< View specifying level of interest 39 39 pmFPAfile *file, ///< FPA file to write 40 pmConfig *config ///< Configuration40 const pmConfig *config ///< Configuration 41 41 ); 42 42 … … 44 44 bool pmFPAviewWriteFitsMask(const pmFPAview *view, ///< View specifying level of interest 45 45 pmFPAfile *file, ///< FPA file to write 46 pmConfig *config ///< Configuration46 const pmConfig *config ///< Configuration 47 47 ); 48 48 … … 50 50 bool pmFPAviewWriteFitsWeight(const pmFPAview *view, ///< View specifying level of interest 51 51 pmFPAfile *file, ///< FPA file to write 52 pmConfig *config ///< Configuration52 const pmConfig *config ///< Configuration 53 53 ); 54 54 -
trunk/psModules/src/camera/pmFPAfileIO.c
r12810 r12832 498 498 case PM_FPA_FILE_CMF: 499 499 psTrace ("psModules.camera", 5, "NOT freeing %s (%s) : save for further analysis\n", file->filename, file->name); 500 return true;500 return true; 501 501 case PM_FPA_FILE_PSF: 502 502 case PM_FPA_FILE_JPEG: 503 503 case PM_FPA_FILE_KAPA: 504 504 psTrace ("psModules.camera", 5, "nothing to free for %s (%s)\n", file->filename, file->name); 505 return true;505 return true; 506 506 default: 507 507 psError(PS_ERR_IO, true, "warning: type mismatch; saw type %d", file->type); … … 719 719 psMetadata *phu = psFitsReadHeader (NULL, file->fits); 720 720 if (!file->format) { 721 // XXX do we need to read the recipe here? these files are supplemental, and probably 722 // do not need to re-load the recipes721 // XXX do we need to read the recipe here? these files are supplemental, and probably 722 // do not need to re-load the recipes 723 723 file->format = pmConfigCameraFormatFromHeader (config, phu, false); 724 724 if (!file->format) { … … 748 748 749 749 // XXX this function is only called from pmFPAfileWrite 750 bool pmFPAfileWritePHU(pmFPAfile *file, const pmFPAview *view, pmConfig *config)750 bool pmFPAfileWritePHU(pmFPAfile *file, const pmFPAview *view, const pmConfig *config) 751 751 { 752 752 PS_ASSERT_PTR_NON_NULL(file, false); -
trunk/psModules/src/camera/pmFPAfileIO.h
r12585 r12832 4 4 * @author EAM, IfA 5 5 * 6 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $7 * @date $Date: 2007-0 3-24 17:53:55$6 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-04-14 03:22:47 $ 8 8 * Copyright 2004-2005 Institute for Astronomy, University of Hawaii 9 9 */ … … 39 39 bool pmFPAfileIOChecks (pmConfig *config, const pmFPAview *view, pmFPAfilePlace place); 40 40 41 bool pmFPAfileWritePHU(pmFPAfile *file, const pmFPAview *view, pmConfig *config);41 bool pmFPAfileWritePHU(pmFPAfile *file, const pmFPAview *view, const pmConfig *config); 42 42 bool pmFPAfileReadPHU (pmFPAfile *file, const pmFPAview *view, pmConfig *config); 43 43 -
trunk/psModules/src/objects/pmPSF_IO.c
r12696 r12832 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2007-0 3-30 21:12:56$8 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-04-14 03:22:48 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 123 123 } 124 124 125 bool pmFPAviewWritePSFmodel (const pmFPAview *view, pmFPAfile *file, pmConfig *config)125 bool pmFPAviewWritePSFmodel (const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 126 126 { 127 127 … … 163 163 164 164 // read in all chip-level PSFmodel files for this FPA 165 bool pmFPAWritePSFmodel (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config)165 bool pmFPAWritePSFmodel (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 166 166 { 167 167 … … 175 175 176 176 // read in all cell-level PSFmodel files for this chip 177 bool pmChipWritePSFmodel (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config)177 bool pmChipWritePSFmodel (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 178 178 { 179 179 … … 187 187 188 188 // read in all readout-level PSFmodel files for this cell 189 bool pmCellWritePSFmodel (pmCell *cell, const pmFPAview *view, pmFPAfile *file, pmConfig *config)189 bool pmCellWritePSFmodel (pmCell *cell, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 190 190 { 191 191 … … 199 199 200 200 // read in all readout-level Objects files for this cell 201 bool pmReadoutWritePSFmodel (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, pmConfig *config)201 bool pmReadoutWritePSFmodel (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 202 202 { 203 203 bool status; … … 229 229 230 230 231 bool pmFPAviewReadPSFmodel (const pmFPAview *view, pmFPAfile *file, pmConfig *config)231 bool pmFPAviewReadPSFmodel (const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 232 232 { 233 233 … … 269 269 270 270 // read in all chip-level PSFmodel files for this FPA 271 bool pmFPAReadPSFmodel (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config)271 bool pmFPAReadPSFmodel (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 272 272 { 273 273 … … 281 281 282 282 // read in all cell-level PSFmodel files for this chip 283 bool pmChipReadPSFmodel (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config)283 bool pmChipReadPSFmodel (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 284 284 { 285 285 … … 293 293 294 294 // read in all readout-level PSFmodel files for this cell 295 bool pmCellReadPSFmodel (pmCell *cell, const pmFPAview *view, pmFPAfile *file, pmConfig *config)295 bool pmCellReadPSFmodel (pmCell *cell, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 296 296 { 297 297 … … 305 305 306 306 // read in all readout-level Objects files for this cell 307 bool pmReadoutReadPSFmodel (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, pmConfig *config)307 bool pmReadoutReadPSFmodel (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 308 308 { 309 309 -
trunk/psModules/src/objects/pmPSF_IO.h
r11253 r12832 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $9 * @date $Date: 2007-0 1-24 02:54:15$8 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-04-14 03:22:48 $ 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 11 11 */ … … 19 19 psMetadata *pmPSFtoMetadata (psMetadata *metadata, pmPSF *psf); 20 20 pmPSF *pmPSFfromMetadata (psMetadata *metadata); 21 bool pmFPAviewWritePSFmodel (const pmFPAview *view, pmFPAfile *file, pmConfig *config);22 bool pmFPAWritePSFmodel (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config);23 bool pmChipWritePSFmodel (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config);24 bool pmCellWritePSFmodel (pmCell *cell, const pmFPAview *view, pmFPAfile *file, pmConfig *config);25 bool pmReadoutWritePSFmodel (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, pmConfig *config);21 bool pmFPAviewWritePSFmodel (const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 22 bool pmFPAWritePSFmodel (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 23 bool pmChipWritePSFmodel (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 24 bool pmCellWritePSFmodel (pmCell *cell, const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 25 bool pmReadoutWritePSFmodel (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 26 26 27 bool pmFPAviewReadPSFmodel (const pmFPAview *view, pmFPAfile *file, pmConfig *config);28 bool pmFPAReadPSFmodel (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config);29 bool pmChipReadPSFmodel (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config);30 bool pmCellReadPSFmodel (pmCell *cell, const pmFPAview *view, pmFPAfile *file, pmConfig *config);31 bool pmReadoutReadPSFmodel (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, pmConfig *config);27 bool pmFPAviewReadPSFmodel (const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 28 bool pmFPAReadPSFmodel (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 29 bool pmChipReadPSFmodel (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 30 bool pmCellReadPSFmodel (pmCell *cell, const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 31 bool pmReadoutReadPSFmodel (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 32 32 33 33 /// @} -
trunk/psModules/src/objects/pmSourceIO.c
r12706 r12832 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.3 3$ $Name: not supported by cvs2svn $6 * @date $Date: 2007-0 3-31 04:18:04$5 * @version $Revision: 1.34 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-04-14 03:22:48 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 66 66 67 67 // Given a FITS file pointer, write the table of object data 68 bool pmFPAviewWriteObjects (const pmFPAview *view, pmFPAfile *file, pmConfig *config)68 bool pmFPAviewWriteObjects (const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 69 69 { 70 70 … … 125 125 126 126 // read in all chip-level Objects files for this FPA 127 bool pmFPAWriteObjects (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config)127 bool pmFPAWriteObjects (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 128 128 { 129 129 … … 140 140 141 141 // read in all cell-level Objects files for this chip 142 bool pmChipWriteObjects (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config)142 bool pmChipWriteObjects (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 143 143 { 144 144 … … 155 155 156 156 // read in all readout-level Objects files for this cell 157 bool pmCellWriteObjects (pmCell *cell, const pmFPAview *view, pmFPAfile *file, pmConfig *config)157 bool pmCellWriteObjects (pmCell *cell, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 158 158 { 159 159 … … 170 170 171 171 // write out all readout-level Objects files for this cell 172 bool pmReadoutWriteObjects (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, pmConfig *config)172 bool pmReadoutWriteObjects (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 173 173 { 174 174 … … 260 260 // we only need a PHU if chips->n > 1 and file->fileLevel == FPA 261 261 // otherwise, the chip header fills the PHU location 262 // XXX this code could be placed in a 'pmSource_CMF_WritePHU' function and called263 // from pmFPAfileIO.c.262 // XXX this code could be placed in a 'pmSource_CMF_WritePHU' function and called 263 // from pmFPAfileIO.c. 264 264 if ((file->fileLevel == PM_FPA_LEVEL_FPA) && (file->fpa->chips->n > 1) && !file->phu) { 265 265 … … 275 275 pmConfigConformHeader (outhead, file->format); 276 276 277 psMetadata *fileData = psMetadataLookupMetadata(NULL, file->format, "FILE"); // File information278 const char *fpaNameHdr = psMetadataLookupStr(NULL, fileData, "FPA.NAME");279 if (fpaNameHdr && strlen(fpaNameHdr) > 0) {280 const char *fpaName = psMetadataLookupStr(NULL, file->fpa->concepts, "FPA.NAME");281 psMetadataAddStr(outhead, PS_LIST_TAIL, fpaNameHdr, PS_META_REPLACE, "FPA name", fpaName);282 }277 psMetadata *fileData = psMetadataLookupMetadata(NULL, file->format, "FILE"); // File information 278 const char *fpaNameHdr = psMetadataLookupStr(NULL, fileData, "FPA.NAME"); 279 if (fpaNameHdr && strlen(fpaNameHdr) > 0) { 280 const char *fpaName = psMetadataLookupStr(NULL, file->fpa->concepts, "FPA.NAME"); 281 psMetadataAddStr(outhead, PS_LIST_TAIL, fpaNameHdr, PS_META_REPLACE, "FPA name", fpaName); 282 } 283 283 } 284 284 … … 298 298 // lookup the EXTNAME values used for table data and image header segments 299 299 char *rule = NULL; 300 // Menu of EXTNAME rules301 psMetadata *menu = psMetadataLookupMetadata(&status, file->camera, "EXTNAME.RULES"); 302 if (!menu) {303 psError(PS_ERR_UNKNOWN, true, "missing EXTNAME.RULES in camera.config");304 return false;305 }306 // EXTNAME for image header307 rule = psMetadataLookupStr(&status, menu, "CMF.HEAD"); 308 if (!rule) {309 psError(PS_ERR_UNKNOWN, true, "missing entry for CMF.HEAD in EXTNAME.RULES in camera.config");310 return false;311 }300 // Menu of EXTNAME rules 301 psMetadata *menu = psMetadataLookupMetadata(&status, file->camera, "EXTNAME.RULES"); 302 if (!menu) { 303 psError(PS_ERR_UNKNOWN, true, "missing EXTNAME.RULES in camera.config"); 304 return false; 305 } 306 // EXTNAME for image header 307 rule = psMetadataLookupStr(&status, menu, "CMF.HEAD"); 308 if (!rule) { 309 psError(PS_ERR_UNKNOWN, true, "missing entry for CMF.HEAD in EXTNAME.RULES in camera.config"); 310 return false; 311 } 312 312 headname = pmFPAfileNameFromRule (rule, file, view); 313 // EXTNAME for table data314 rule = psMetadataLookupStr(&status, menu, "CMF.DATA"); 315 if (!rule) {316 psError(PS_ERR_UNKNOWN, true, "missing entry for CMF.DATA in EXTNAME.RULES in camera.config");317 return false;318 }313 // EXTNAME for table data 314 rule = psMetadataLookupStr(&status, menu, "CMF.DATA"); 315 if (!rule) { 316 psError(PS_ERR_UNKNOWN, true, "missing entry for CMF.DATA in EXTNAME.RULES in camera.config"); 317 return false; 318 } 319 319 dataname = pmFPAfileNameFromRule (rule, file, view); 320 320 … … 348 348 } 349 349 350 // create a header to hold the output data351 outhead = psMetadataAlloc ();352 353 // determine the output table format 354 psMetadata *recipe = psMetadataLookupMetadata(&status, config->recipes, "PSPHOT");355 if (!status) {356 psError(PS_ERR_UNKNOWN, true, "missing recipe PSPHOT in config data");357 return false;358 }359 exttype = psMemIncrRefCounter (psMetadataLookupStr(&status, recipe, "OUTPUT.FORMAT"));360 if (!exttype) {361 exttype = psStringCopy ("SMPDATA");362 } 363 364 // write the links to the image header350 // create a header to hold the output data 351 outhead = psMetadataAlloc (); 352 353 // determine the output table format 354 psMetadata *recipe = psMetadataLookupMetadata(&status, config->recipes, "PSPHOT"); 355 if (!status) { 356 psError(PS_ERR_UNKNOWN, true, "missing recipe PSPHOT in config data"); 357 return false; 358 } 359 exttype = psMemIncrRefCounter (psMetadataLookupStr(&status, recipe, "OUTPUT.FORMAT")); 360 if (!exttype) { 361 exttype = psStringCopy ("SMPDATA"); 362 } 363 364 // write the links to the image header 365 365 psMetadataAddStr (outhead, PS_LIST_TAIL, "EXTHEAD", PS_META_REPLACE, "name of image extension w/", headname); 366 366 psMetadataAddStr (outhead, PS_LIST_TAIL, "EXTTYPE", PS_META_REPLACE, "extension type", exttype); 367 367 psFree (exttype); 368 368 369 // XXX these are case-sensitive since the EXTYPE is case-sensitive370 status = false;371 if (!strcmp (exttype, "SMPDATA")) {372 status = pmSourcesWrite_SMPDATA (file->fits, sources, file->header, outhead, dataname);373 }374 if (!strcmp (exttype, "PS1_DEV_0")) {375 status = pmSourcesWrite_PS1_DEV_0 (file->fits, sources, file->header, outhead, dataname);376 }369 // XXX these are case-sensitive since the EXTYPE is case-sensitive 370 status = false; 371 if (!strcmp (exttype, "SMPDATA")) { 372 status = pmSourcesWrite_SMPDATA (file->fits, sources, file->header, outhead, dataname); 373 } 374 if (!strcmp (exttype, "PS1_DEV_0")) { 375 status = pmSourcesWrite_PS1_DEV_0 (file->fits, sources, file->header, outhead, dataname); 376 } 377 377 378 378 if (!status) { … … 400 400 401 401 // Given a FITS file pointer, read the table of object data 402 bool pmFPAviewReadObjects (const pmFPAview *view, pmFPAfile *file, pmConfig *config)402 bool pmFPAviewReadObjects (const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 403 403 { 404 404 pmFPA *fpa = file->fpa; … … 439 439 440 440 // read in all chip-level Objects files for this FPA 441 bool pmFPAReadObjects (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config)441 bool pmFPAReadObjects (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 442 442 { 443 443 for (int i = 0; i < fpa->chips->n; i++) { … … 449 449 450 450 // read in all cell-level Objects files for this chip 451 bool pmChipReadObjects (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config)451 bool pmChipReadObjects (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 452 452 { 453 453 chip->data_exists = false; … … 455 455 pmCell *cell = chip->cells->data[i]; 456 456 pmCellReadObjects (cell, view, file, config); 457 if (!cell->data_exists) continue;458 chip->data_exists = true;457 if (!cell->data_exists) continue; 458 chip->data_exists = true; 459 459 } 460 460 return true; … … 462 462 463 463 // read in all readout-level Objects files for this cell 464 bool pmCellReadObjects (pmCell *cell, const pmFPAview *view, pmFPAfile *file, pmConfig *config)464 bool pmCellReadObjects (pmCell *cell, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 465 465 { 466 466 // multiple readout mode is not yet defined for CMP or CMF files … … 475 475 pmReadout *readout = cell->readouts->data[i]; 476 476 pmReadoutReadObjects (readout, view, file, config); 477 if (!readout->data_exists) {478 continue;479 }480 481 // load in the concept information for this cell482 if (!pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER, true, NULL)) {483 //psError(PS_ERR_UNKNOWN, false, "Failed to read concepts for cell");484 //return false;485 psWarning("Difficulty reading concepts for cell; attempting to proceed.");486 }477 if (!readout->data_exists) { 478 continue; 479 } 480 481 // load in the concept information for this cell 482 if (!pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER, true, NULL)) { 483 //psError(PS_ERR_UNKNOWN, false, "Failed to read concepts for cell"); 484 //return false; 485 psWarning("Difficulty reading concepts for cell; attempting to proceed."); 486 } 487 487 cell->data_exists = true; 488 488 } … … 491 491 492 492 // read in all readout-level Objects files for this cell 493 bool pmReadoutReadObjects (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, pmConfig *config)493 bool pmReadoutReadObjects (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 494 494 { 495 495 … … 500 500 switch (file->type) { 501 501 case PM_FPA_FILE_OBJ: 502 psError(PS_ERR_UNKNOWN, true, "OBJ is not supported as an input object format");503 return false;502 psError(PS_ERR_UNKNOWN, true, "OBJ is not supported as an input object format"); 503 return false; 504 504 505 505 case PM_FPA_FILE_SX: 506 psError(PS_ERR_UNKNOWN, true, "SX is not supported as an input object format");507 return false;506 psError(PS_ERR_UNKNOWN, true, "SX is not supported as an input object format"); 507 return false; 508 508 509 509 case PM_FPA_FILE_CMP: … … 530 530 psString realname = pmConfigConvertFilename (file->filename, config, create); 531 531 532 // read the PHU from this file 532 // read the PHU from this file 533 533 file->fits = psFitsOpen (realname, "r"); 534 534 if (hdu->header != NULL) { … … 549 549 // lookup the EXTNAME values used for table data and image header segments 550 550 char *rule = NULL; 551 // Menu of EXTNAME rules551 // Menu of EXTNAME rules 552 552 psMetadata *menu = psMetadataLookupMetadata(&status, file->camera, "EXTNAME.RULES"); 553 if (!menu) {554 psError(PS_ERR_UNKNOWN, true, "missing EXTNAME.RULES in camera.config");555 return false;556 }557 // EXTNAME for image header558 rule = psMetadataLookupStr(&status, menu, "CMF.HEAD");559 if (!rule) {560 psError(PS_ERR_UNKNOWN, true, "missing entry for CMF.HEAD in EXTNAME.RULES in camera.config");561 return false;562 }553 if (!menu) { 554 psError(PS_ERR_UNKNOWN, true, "missing EXTNAME.RULES in camera.config"); 555 return false; 556 } 557 // EXTNAME for image header 558 rule = psMetadataLookupStr(&status, menu, "CMF.HEAD"); 559 if (!rule) { 560 psError(PS_ERR_UNKNOWN, true, "missing entry for CMF.HEAD in EXTNAME.RULES in camera.config"); 561 return false; 562 } 563 563 char *headname = pmFPAfileNameFromRule (rule, file, view); 564 // EXTNAME for table data564 // EXTNAME for table data 565 565 rule = psMetadataLookupStr(&status, menu, "CMF.DATA"); 566 if (!rule) {567 psError(PS_ERR_UNKNOWN, true, "missing entry for CMF.DATA in EXTNAME.RULES in camera.config");568 return false;569 }566 if (!rule) { 567 psError(PS_ERR_UNKNOWN, true, "missing entry for CMF.DATA in EXTNAME.RULES in camera.config"); 568 return false; 569 } 570 570 char *dataname = pmFPAfileNameFromRule (rule, file, view); 571 571 572 // advance to the IMAGE HEADER extension572 // advance to the IMAGE HEADER extension 573 573 if (hdu->header == NULL) { 574 // if the IMAGE header does not exist, we have no data for this view574 // if the IMAGE header does not exist, we have no data for this view 575 575 if (!psFitsMoveExtName (file->fits, headname)) { 576 readout->data_exists = false;577 psFree (headname);578 psFree (dataname);579 return true;580 }576 readout->data_exists = false; 577 psFree (headname); 578 psFree (dataname); 579 return true; 580 } 581 581 hdu->header = psFitsReadHeader (NULL, file->fits); 582 582 } … … 587 587 if (extdata) { 588 588 // if EXTDATA is defined in the header, use that value for 'dataname' 589 psFree (dataname);590 dataname = psMemIncrRefCounter (extdata);591 } 592 593 // advance to the table data extension594 // since we have read the IMAGE header, the TABLE header should exist589 psFree (dataname); 590 dataname = psMemIncrRefCounter (extdata); 591 } 592 593 // advance to the table data extension 594 // since we have read the IMAGE header, the TABLE header should exist 595 595 if (!psFitsMoveExtName (file->fits, dataname)) { 596 596 psAbort("cannot find data extension %s in %s", dataname, file->filename); 597 597 } 598 598 599 psMetadata *tableHeader = psFitsReadHeader(NULL, file->fits); // The FITS header600 if (!tableHeader) psAbort("cannot read table header");599 psMetadata *tableHeader = psFitsReadHeader(NULL, file->fits); // The FITS header 600 if (!tableHeader) psAbort("cannot read table header"); 601 601 602 602 char *exttype = psMetadataLookupStr (NULL, tableHeader, "EXTTYPE"); 603 if (!exttype) psAbort("cannot read table type");604 605 // XXX these are case-sensitive since the EXTYPE is case-sensitive606 if (!strcmp (exttype, "SMPDATA")) {607 sources = pmSourcesRead_SMPDATA (file->fits, hdu->header);608 }609 if (!strcmp (exttype, "PS1_DEV_0")) {610 sources = pmSourcesRead_PS1_DEV_0 (file->fits, hdu->header);611 }603 if (!exttype) psAbort("cannot read table type"); 604 605 // XXX these are case-sensitive since the EXTYPE is case-sensitive 606 if (!strcmp (exttype, "SMPDATA")) { 607 sources = pmSourcesRead_SMPDATA (file->fits, hdu->header); 608 } 609 if (!strcmp (exttype, "PS1_DEV_0")) { 610 sources = pmSourcesRead_PS1_DEV_0 (file->fits, hdu->header); 611 } 612 612 613 613 psTrace("psModules.objects", 6, "read CMF table from %s : %s : %s", file->filename, headname, dataname); 614 psFree (headname);614 psFree (headname); 615 615 psFree (dataname); 616 psFree (tableHeader);616 psFree (tableHeader); 617 617 break; 618 618 -
trunk/psModules/src/objects/pmSourceIO.h
r12481 r12832 4 4 * @author EAM, IfA; GLG, MHPCC 5 5 * 6 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $7 * @date $Date: 2007-0 3-18 22:03:21$6 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-04-14 03:22:48 $ 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 9 9 * … … 37 37 bool pmPeaksWriteText (psArray *peaks, char *filename); 38 38 39 bool pmFPAviewReadObjects (const pmFPAview *view, pmFPAfile *file, pmConfig *config);40 bool pmFPAReadObjects (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config);41 bool pmChipReadObjects (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config);42 bool pmCellReadObjects (pmCell *cell, const pmFPAview *view, pmFPAfile *file, pmConfig *config);43 bool pmReadoutReadObjects (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, pmConfig *config);39 bool pmFPAviewReadObjects (const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 40 bool pmFPAReadObjects (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 41 bool pmChipReadObjects (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 42 bool pmCellReadObjects (pmCell *cell, const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 43 bool pmReadoutReadObjects (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 44 44 45 bool pmFPAviewWriteObjects (const pmFPAview *view, pmFPAfile *file, pmConfig *config);46 bool pmFPAWriteObjects (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config);47 bool pmChipWriteObjects (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config);48 bool pmCellWriteObjects (pmCell *cell, const pmFPAview *view, pmFPAfile *file, pmConfig *config);49 bool pmReadoutWriteObjects (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, pmConfig *config);45 bool pmFPAviewWriteObjects (const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 46 bool pmFPAWriteObjects (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 47 bool pmChipWriteObjects (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 48 bool pmCellWriteObjects (pmCell *cell, const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 49 bool pmReadoutWriteObjects (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 50 50 51 51 /// @} -
trunk/psModules/src/objects/pmSourcePlotMoments.c
r12696 r12832 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $8 * @date $Date: 2007-0 3-30 21:12:56$7 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-04-14 03:22:48 $ 9 9 * 10 10 * Copyright 2006 IfA, University of Hawaii … … 42 42 43 43 // plot the sx, sy moments plane (faint and bright sources) 44 bool pmSourcePlotMoments (const pmFPAview *view, pmFPAfile *file, pmConfig *config, pmSourcePlotLayout *layout)44 bool pmSourcePlotMoments (const pmFPAview *view, pmFPAfile *file, const pmConfig *config, pmSourcePlotLayout *layout) 45 45 { 46 46 … … 159 159 # else 160 160 161 bool pmSourcePlotMoments (const pmFPAview *view, pmFPAfile *file, pmConfig *config, pmSourcePlotLayout *layout)161 bool pmSourcePlotMoments (const pmFPAview *view, pmFPAfile *file, const pmConfig *config, pmSourcePlotLayout *layout) 162 162 { 163 163 psLogMsg ("psphot", 3, "skipping moments plot"); -
trunk/psModules/src/objects/pmSourcePlotPSFModel.c
r12696 r12832 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $8 * @date $Date: 2007-0 3-30 21:12:56$7 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-04-14 03:22:48 $ 9 9 * 10 10 * Copyright 2006 IfA, University of Hawaii … … 44 44 // plot the PSF measured sx, sy, sxy as vector field 45 45 // pull the sources from the config / file? 46 bool pmSourcePlotPSFModel (const pmFPAview *view, pmFPAfile *file, pmConfig *config, pmSourcePlotLayout *layout)46 bool pmSourcePlotPSFModel (const pmFPAview *view, pmFPAfile *file, const pmConfig *config, pmSourcePlotLayout *layout) 47 47 { 48 48 … … 225 225 # else 226 226 227 bool pmSourcePlotPSFModel (const pmFPAview *view, pmFPAfile *file, pmConfig *config, pmSourcePlotLayout *layout)227 bool pmSourcePlotPSFModel (const pmFPAview *view, pmFPAfile *file, const pmConfig *config, pmSourcePlotLayout *layout) 228 228 { 229 229 psLogMsg ("psphot", 3, "skipping psf model plot"); -
trunk/psModules/src/objects/pmSourcePlots.c
r12696 r12832 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $8 * @date $Date: 2007-0 3-30 21:12:56$7 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-04-14 03:22:48 $ 9 9 * 10 10 * Copyright 2006 IfA, University of Hawaii … … 32 32 // this function is called for the specific plotting program at the fileLevel 33 33 // fileLevel must be >= chip 34 bool pmFPAviewWriteSourcePlot(const pmFPAview *view, pmFPAfile *file, pmConfig *config)34 bool pmFPAviewWriteSourcePlot(const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 35 35 { 36 36 PS_ASSERT_PTR_NON_NULL(view, false); … … 54 54 55 55 // read in all chip-level SourcePlot files for this FPA 56 bool pmFPAWriteSourcePlot (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config, pmSourcePlotLayout *layout)56 bool pmFPAWriteSourcePlot (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config, pmSourcePlotLayout *layout) 57 57 { 58 58 PS_ASSERT_PTR_NON_NULL(fpa, false); … … 94 94 95 95 // read in all cell-level SourcePlot files for this chip 96 bool pmChipWriteSourcePlot (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config, pmSourcePlotLayout *layout)96 bool pmChipWriteSourcePlot (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config, pmSourcePlotLayout *layout) 97 97 { 98 98 PS_ASSERT_PTR_NON_NULL(view, false); … … 149 149 * - what are the dimensions of this element? 150 150 * - create a new page for this element? 151 151 152 152 * the answers to these questions come from slightly different locations 153 153 * for the different types of plots: 154 155 * 1) focal-plane layout based plots: 154 155 * 1) focal-plane layout based plots: 156 156 * - dimensions depend on fileLevel 157 158 * 2) multi-row plots: 157 158 * 2) multi-row plots: 159 159 * - dimensions depend on total number of rows 160 161 * 2) multi-page plots: 160 161 * 2) multi-page plots: 162 162 * - dimensions depend on total number of rows 163 163 */ -
trunk/psModules/src/objects/pmSourcePlots.h
r11253 r12832 4 4 * @author EAM, IfA 5 5 * 6 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $7 * @date $Date: 2007-0 1-24 02:54:15$6 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-04-14 03:22:48 $ 8 8 * Copyright 2006 Institute for Astronomy, University of Hawaii 9 9 */ … … 31 31 pmSourcePlotLayout *pmSourcePlotLayoutAlloc(); 32 32 33 bool pmFPAviewWriteSourcePlot(const pmFPAview *view, pmFPAfile *file, pmConfig *config);34 bool pmFPAWriteSourcePlot (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config, pmSourcePlotLayout *layout);35 bool pmChipWriteSourcePlot (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config, pmSourcePlotLayout *layout);36 bool pmSourcePlotPSFModel (const pmFPAview *view, pmFPAfile *file, pmConfig *config, pmSourcePlotLayout *layout);37 bool pmSourcePlotMoments (const pmFPAview *view, pmFPAfile *file, pmConfig *config, pmSourcePlotLayout *layout);33 bool pmFPAviewWriteSourcePlot(const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 34 bool pmFPAWriteSourcePlot (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config, pmSourcePlotLayout *layout); 35 bool pmChipWriteSourcePlot (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config, pmSourcePlotLayout *layout); 36 bool pmSourcePlotPSFModel (const pmFPAview *view, pmFPAfile *file, const pmConfig *config, pmSourcePlotLayout *layout); 37 bool pmSourcePlotMoments (const pmFPAview *view, pmFPAfile *file, const pmConfig *config, pmSourcePlotLayout *layout); 38 38 39 39 /// @}
Note:
See TracChangeset
for help on using the changeset viewer.
