Changeset 7725 for trunk/psModules/src/objects/pmSourceIO.c
- Timestamp:
- Jun 28, 2006, 9:21:00 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmSourceIO.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSourceIO.c
r7382 r7725 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-06- 07 03:27:52$5 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-06-28 19:21:00 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 218 218 219 219 case PM_FPA_FILE_CMF: 220 // write a PHU? 221 // write a header? 222 // write the data 220 // write a PHU? (only if input image is MEF) 221 // write a header? (only if this is the first readout for cell) 222 // note that the file->header is set to track the last hdu->header written 223 // write the data? (always?) 223 224 224 225 // get the current header 225 226 hdu = pmFPAviewThisHDU (view, file->fpa); 226 227 227 // if file does not yet have a PHU, write itto disk228 // if file does not yet have a PHU, attempt to write one to disk 228 229 if (file->phu == NULL) { 229 230 // get the corresponding phu 230 231 phu = pmFPAviewThisPHU (view, file->fpa); 231 232 232 // CMF always has extensions 233 outhead = psMetadataCopy (NULL, phu->header); 234 psMetadataAdd (outhead, PS_LIST_TAIL, "EXTEND", PS_DATA_BOOL | PS_META_REPLACE, "this file has extensions", true); 235 psFitsWriteBlank (file->fits, outhead); 236 file->phu = phu->header; 237 psTrace ("pmFPAfile", 5, "wrote phu %s (type: %d)\n", file->filename, file->type); 238 psFree (outhead); 239 } 240 241 // this this header block is new, write it to disk, 233 // if there is no PHU, this is a single header+image (extension-less) file 234 // if there is a PHU, write it out as a 'blank' 235 if (phu) { 236 outhead = psMetadataCopy (NULL, phu->header); 237 psMetadataAddBool (outhead, PS_LIST_TAIL, "EXTEND", PS_META_REPLACE, "this file has extensions", true); 238 psFitsWriteBlank (file->fits, outhead); 239 file->phu = phu->header; 240 psTrace ("pmFPAfile", 5, "wrote phu %s (type: %d)\n", file->filename, file->type); 241 psFree (outhead); 242 } 243 } 244 245 // this header block is new, write it to disk 242 246 if (hdu->header != file->header) { 243 247 // determine name for header extension … … 245 249 outhead = psMetadataCopy (NULL, hdu->header); 246 250 psMetadataAddStr (outhead, PS_LIST_TAIL, "EXTNAME", PS_META_REPLACE, "extension name", headname); 251 if (file->phu == NULL) { 252 // this hdu->header acts as the PHU: set EXTEND to be true 253 psMetadataAddBool (outhead, PS_LIST_TAIL, "EXTEND", PS_META_REPLACE, "this file has extensions", true); 254 } 255 256 // XXX : see note below about DVO/addstar expectations 257 updates = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.HEADER"); 258 psMetadataCopy (outhead, updates); 259 247 260 psFitsWriteBlank (file->fits, outhead); 248 261 psTrace ("pmFPAfile", 5, "wrote ext head %s (type: %d)\n", file->filename, file->type); … … 254 267 // write this table to disk 255 268 dataname = pmFPAfileNameFromRule (file->extrule, file, view); 269 270 // XXX : currently, this is being added to the TABLE header 271 // this may be the correct location for a MEF file, but it is 272 // inconsistent with DVO/addstar expectations. DVO/addstar 273 // currently only expects a single header/table pair, and the 274 // metadata are in the blank (image) header, not the table header 275 // it may be necessary to put the results from the first readout 276 // in the blank image header to cover this case. 256 277 updates = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.HEADER"); 257 278 pmSourcesWriteCMF (file->fits, sources, updates, dataname);
Note:
See TracChangeset
for help on using the changeset viewer.
