IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29838


Ignore:
Timestamp:
Nov 26, 2010, 10:34:46 AM (15 years ago)
Author:
eugene
Message:

merge updates from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20101103/magic/remove/src/streaksremove.c

    r28514 r29838  
    921921    }
    922922
    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
    924925    {
    925926        if (!psFitsMoveExtNum(in->fits, 1, true)) {
    926             psErrorStackPrint(stderr, "failed to read header from %s", in->resolved_name);
     927            psErrorStackPrint(stderr, "failed to move to extension 1 in from %s", in->resolved_name);
    927928            streaksExit("", PS_EXIT_DATA_ERROR);
    928929        }
     
    9991000    }
    10001001
    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
    10021031
    10031032    if (!psFitsClose(out->fits)) {
Note: See TracChangeset for help on using the changeset viewer.