Changeset 12481
- Timestamp:
- Mar 18, 2007, 12:03:21 PM (19 years ago)
- Location:
- trunk/psModules/src/objects
- Files:
-
- 4 edited
-
pmSourceIO.c (modified) (6 diffs)
-
pmSourceIO.h (modified) (2 diffs)
-
pmSourceIO_PS1_DEV_0.c (modified) (4 diffs)
-
pmSourceIO_SMPDATA.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSourceIO.c
r12464 r12481 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.2 6$ $Name: not supported by cvs2svn $6 * @date $Date: 2007-03-1 6 01:48:55$5 * @version $Revision: 1.27 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-03-18 22:03:08 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 22 22 #include "pmFPAview.h" 23 23 #include "pmFPAfile.h" 24 #include "pmConcepts.h" 24 25 25 26 #include "pmPeaks.h" … … 333 334 } 334 335 335 // create a header to hold the output data 336 outhead = psMetadataAlloc (); 337 338 // save psphot and psastro metadata in the image and table headers 339 // XXX this is a bit silly: we are duplicating these because I'm not sure which 340 // I need to keep for multi-readout images... 341 updates = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.HEADER"); 342 if (updates) { 343 psMetadataCopy (outhead, updates); 344 } 345 updates = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.HEADER"); 346 if (updates) { 347 psMetadataCopy (outhead, updates); 348 } 349 336 // create a header to hold the output data 337 outhead = psMetadataAlloc (); 338 339 // determine the output table format 350 340 psMetadata *recipe = psMetadataLookupMetadata(&status, config->recipes, "PSPHOT"); 351 341 if (!status) { … … 358 348 } 359 349 350 // write the links to the image header 360 351 psMetadataAddStr (outhead, PS_LIST_TAIL, "EXTHEAD", PS_META_REPLACE, "name of image extension w/", headname); 361 352 psMetadataAddStr (outhead, PS_LIST_TAIL, "EXTTYPE", PS_META_REPLACE, "extension type", exttype); … … 365 356 status = false; 366 357 if (!strcmp (exttype, "SMPDATA")) { 367 status = pmSourcesWrite_SMPDATA (file->fits, sources, outhead, dataname);358 status = pmSourcesWrite_SMPDATA (file->fits, sources, file->header, outhead, dataname); 368 359 } 369 360 if (!strcmp (exttype, "PS1_DEV_0")) { 370 status = pmSourcesWrite_PS1_DEV_0 (file->fits, sources, outhead, dataname);361 status = pmSourcesWrite_PS1_DEV_0 (file->fits, sources, file->header, outhead, dataname); 371 362 } 372 363 … … 466 457 pmReadout *readout = cell->readouts->data[i]; 467 458 pmReadoutReadObjects (readout, view, file, config); 459 460 // load in the concept information for this cell 461 if (!pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER, true, NULL)) { 462 //psError(PS_ERR_UNKNOWN, false, "Failed to read concepts for cell"); 463 //return false; 464 psWarning("Difficulty reading concepts for cell; attempting to proceed."); 465 } 466 468 467 cell->data_exists = true; 469 468 } -
trunk/psModules/src/objects/pmSourceIO.h
r12446 r12481 4 4 * @author EAM, IfA; GLG, MHPCC 5 5 * 6 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $7 * @date $Date: 2007-03-1 5 20:44:55$6 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-03-18 22:03:21 $ 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 9 9 * … … 23 23 bool pmSourcesWriteCMP (psArray *sources, char *filename, psMetadata *header); 24 24 25 bool pmSourcesWrite_SMPDATA (psFits *fits, psArray *sources, psMetadata * header, char *extname);26 bool pmSourcesWrite_PS1_DEV_0 (psFits *fits, psArray *sources, psMetadata * header, char *extname);25 bool pmSourcesWrite_SMPDATA (psFits *fits, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname); 26 bool pmSourcesWrite_PS1_DEV_0 (psFits *fits, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname); 27 27 28 28 psArray *pmSourcesReadCMP (char *filename, psMetadata *header); -
trunk/psModules/src/objects/pmSourceIO_PS1_DEV_0.c
r12445 r12481 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $6 * @date $Date: 2007-03-1 5 20:44:25$5 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-03-18 22:03:21 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 40 40 // XXX how do I generate the source tables which I need to send to PSPS? 41 41 42 bool pmSourcesWrite_PS1_DEV_0 (psFits *fits, psArray *sources, psMetadata * header, char *extname)42 bool pmSourcesWrite_PS1_DEV_0 (psFits *fits, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname) 43 43 { 44 44 … … 107 107 108 108 if (table->n == 0) { 109 psFitsWriteBlank (fits, header, extname);109 psFitsWriteBlank (fits, tableHeader, extname); 110 110 psFree (table); 111 111 return true; … … 113 113 114 114 psTrace ("pmFPAfile", 5, "writing ext data %s\n", extname); 115 if (!psFitsWriteTable (fits, header, table, extname)) {115 if (!psFitsWriteTable (fits, tableHeader, table, extname)) { 116 116 psError(PS_ERR_IO, false, "writing ext data %s\n", extname); 117 117 psFree(table); -
trunk/psModules/src/objects/pmSourceIO_SMPDATA.c
r12402 r12481 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $6 * @date $Date: 2007-03-1 1 18:56:38$5 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-03-18 22:03:21 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 35 35 // this format consists of a header derived from the image header 36 36 // followed by a zero-size matrix, followed by the table data 37 bool pmSourcesWrite_SMPDATA (psFits *fits, psArray *sources, psMetadata * header, char *extname)37 bool pmSourcesWrite_SMPDATA (psFits *fits, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname) 38 38 { 39 39 … … 48 48 49 49 // find config information for output header 50 float ZERO_POINT = psMetadataLookupF32 (&status, header, "ZERO_PT");50 float ZERO_POINT = psMetadataLookupF32 (&status, imageHeader, "ZERO_PT"); 51 51 52 52 table = psArrayAllocEmpty (sources->n); … … 89 89 90 90 if (table->n == 0) { 91 psFitsWriteBlank (fits, header, extname);91 psFitsWriteBlank (fits, tableHeader, extname); 92 92 psFree (table); 93 93 return true; … … 95 95 96 96 psTrace ("pmFPAfile", 5, "writing ext data %s\n", extname); 97 if (!psFitsWriteTable (fits, header, table, extname)) {97 if (!psFitsWriteTable (fits, tableHeader, table, extname)) { 98 98 psError(PS_ERR_IO, false, "writing ext data %s\n", extname); 99 99 psFree(table);
Note:
See TracChangeset
for help on using the changeset viewer.
