IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 14, 2009, 4:15:36 PM (17 years ago)
Author:
Paul Price
Message:

Need to move to extension before starting to read it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/magic/remove/src/streaksremove.c

    r25083 r25084  
    824824    // Extension with PSF fits, should be "something.psf"
    825825    {
     826        if (!psFitsMoveExtNum(in->fits, 1, true)) {
     827            psErrorStackPrint(stderr, "failed to read header from %s", in->resolved_name);
     828            streaksExit("", PS_EXIT_DATA_ERROR);
     829        }
     830
    826831        psMetadata *header = psFitsReadHeader(NULL, in->fits);
    827832        if (!header) {
    828             psError(PS_ERR_IO, false, "failed to read header from %s", in->resolved_name);
     833            psErrorStackPrint(stderr, "failed to read header from %s", in->resolved_name);
    829834            streaksExit("", PS_EXIT_DATA_ERROR);
    830835        }
     
    837842        psArray *inTable = psFitsReadTable(in->fits);
    838843        if (!inTable->n) {
    839             psError(PS_ERR_IO, false, "table in %s is empty", in->resolved_name);
     844            psErrorStackPrint(stderr, "table in %s is empty", in->resolved_name);
    840845            streaksExit("", PS_EXIT_DATA_ERROR);
    841846        }
     
    867872            printf("Censored %d sources\n", numCensored);
    868873            if (! psFitsWriteTable(out->fits, header, outTable, extname)) {
    869                 psError(PS_ERR_IO, false, "failed to write table to %s", out->resolved_name);
     874                psErrorStackPrint(stderr, "failed to write table to %s", out->resolved_name);
    870875                streaksExit("", PS_EXIT_DATA_ERROR);
    871876            }
     
    873878            printf("Censored ALL %d sources\n", numCensored);
    874879            if (! psFitsWriteTableEmpty(out->fits, header, inTable->data[0], extname)) {
    875                 psError(PS_ERR_IO, false, "failed to write empty table to %s", out->resolved_name);
     880                psErrorStackPrint(stderr, "failed to write empty table to %s", out->resolved_name);
    876881                streaksExit("", PS_EXIT_DATA_ERROR);
    877882            }
     
    885890
    886891    if (!psFitsClose(out->fits)) {
    887         psError(PS_ERR_IO, false, "failed to close table %s", out->resolved_name);
     892        psErrorStackPrint(stderr, "failed to close table %s", out->resolved_name);
    888893        streaksExit("", PS_EXIT_DATA_ERROR);
    889894    }
Note: See TracChangeset for help on using the changeset viewer.