Changeset 29838
- Timestamp:
- Nov 26, 2010, 10:34:46 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20101103/magic/remove/src/streaksremove.c
r28514 r29838 921 921 } 922 922 923 // Extension with PSF fits, should be "something.psf" 923 // Extension with PSF fits, should be "CLASS_ID.psf" 924 // This assumes that the sources extension comes first 924 925 { 925 926 if (!psFitsMoveExtNum(in->fits, 1, true)) { 926 psErrorStackPrint(stderr, "failed to read headerfrom %s", in->resolved_name);927 psErrorStackPrint(stderr, "failed to move to extension 1 in from %s", in->resolved_name); 927 928 streaksExit("", PS_EXIT_DATA_ERROR); 928 929 } … … 999 1000 } 1000 1001 1001 // XXX Will need to update to handle extension with extended sources, etc. 1002 // Copy any other extensions in the file (deteff for example) to the output 1003 // XXX: This assumes that all we have is binary tables. 1004 for (int i = 2; i< in->nHDU; i++) { 1005 if (!psFitsMoveExtNum(in->fits, 1, true)) { 1006 psErrorStackPrint(stderr, "failed to move to extension number %d in %s", i, in->resolved_name); 1007 streaksExit("", PS_EXIT_DATA_ERROR); 1008 } 1009 psMetadata *header = psFitsReadHeader(NULL, in->fits); 1010 if (!header) { 1011 psErrorStackPrint(stderr, "failed to read header from %s", in->resolved_name); 1012 streaksExit("", PS_EXIT_DATA_ERROR); 1013 } 1014 psString extname = psMetadataLookupStr(NULL, header, "EXTNAME"); 1015 if (!extname) { 1016 psError(PS_ERR_IO, false, "failed to find extname in header of %s", in->resolved_name); 1017 streaksExit("", PS_EXIT_DATA_ERROR); 1018 } 1019 1020 psArray *inTable = psFitsReadTable(in->fits); 1021 if (!inTable) { 1022 psErrorStackPrint(stderr, "failed to read table in %s", in->resolved_name); 1023 streaksExit("", PS_EXIT_DATA_ERROR); 1024 } 1025 if (! psFitsWriteTable(out->fits, header, inTable, extname)) { 1026 psErrorStackPrint(stderr, "failed to write table to %s", out->resolved_name); 1027 streaksExit("", PS_EXIT_DATA_ERROR); 1028 } 1029 } 1030 1002 1031 1003 1032 if (!psFitsClose(out->fits)) {
Note:
See TracChangeset
for help on using the changeset viewer.
