IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24998


Ignore:
Timestamp:
Aug 4, 2009, 2:45:20 PM (17 years ago)
Author:
bills
Message:

if all sources are censored write an empty table

File:
1 edited

Legend:

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

    r24853 r24998  
    839839    }
    840840
    841     printf("Censored %d sources\n", numCensored);
    842841
    843842    // get rid of unused elements (don't know if this is necessary)
     
    845844
    846845    addDestreakKeyword(in->header);
    847     if (! psFitsWriteTable(out->fits, in->header, outTable, extname)) {
    848         psError(PS_ERR_IO, false, "failed to write table to %s", out->resolved_name);
    849         streaksExit("", PS_EXIT_DATA_ERROR);
     846    if (psArrayLength(outTable) > 0) {
     847        printf("Censored %d sources\n", numCensored);
     848        if (! psFitsWriteTable(out->fits, in->header, outTable, extname)) {
     849            psError(PS_ERR_IO, false, "failed to write table to %s", out->resolved_name);
     850            streaksExit("", PS_EXIT_DATA_ERROR);
     851        }
     852    } else {
     853        printf("Censored ALL %d sources\n", numCensored);
     854        if (! psFitsWriteTableEmpty(out->fits, in->header, inTable->data[0], extname)) {
     855            psError(PS_ERR_IO, false, "failed to write empty table to %s", out->resolved_name);
     856            streaksExit("", PS_EXIT_DATA_ERROR);
     857        }
    850858    }
    851859
Note: See TracChangeset for help on using the changeset viewer.