IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 12, 2008, 11:52:18 AM (18 years ago)
Author:
Paul Price
Message:

If no sources are present when writing, write an empty table. This is
an attempt to keep the image (for which data exists, or we wouldn't be
calling this function) and the source list consistent, even if there
are no sources found on the image.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmSourceIO.c

    r17396 r17635  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.56 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2008-04-08 18:35:38 $
     5 *  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2008-05-12 21:52:18 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    259259    // XXX if sources is NULL, skip the cell or write out empty tables?
    260260    psArray *sources = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.SOURCES");
    261     if (sources == NULL)
    262         return true;
     261    if (!sources) {
     262        sources = psArrayAlloc(0);
     263        psMetadataAddArray(readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_META_REPLACE,
     264                           "Blank array of sources", sources);
     265        psFree(sources);                // Held onto by the metadata, so we can continue to use
     266    }
    263267
    264268    switch (file->type) {
     
    468472        psFree (headname);
    469473        psFree (dataname);
    470         psFree (xsrcname);
    471         psFree (xfitname);
     474        psFree (xsrcname);
     475        psFree (xfitname);
    472476        psFree (outhead);
    473477        break;
Note: See TracChangeset for help on using the changeset viewer.