IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 15, 2007, 10:45:27 AM (19 years ago)
Author:
magnier
Message:

fixing support for PS1_DEV_0

File:
1 edited

Legend:

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

    r12402 r12447  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2007-03-11 18:56:38 $
     5 *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2007-03-15 20:45:27 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    334334          return false;
    335335        }
    336         exttype = psMetadataLookupMetadata(&status, recipe, "OUTPUT.FORMAT");
    337         if (!status) {
    338           psError(PS_ERR_UNKNOWN, true, "missing OUTPUT.FORMAT in PSPHOT recipe");
    339           return false;
    340         }
     336        exttype = psMemIncrRefCounter (psMetadataLookupStr(&status, recipe, "OUTPUT.FORMAT"));
     337        if (!exttype) {
     338            exttype = psStringCopy ("SMPDATA");
     339        }
    341340
    342341        psMetadataAddStr (outhead, PS_LIST_TAIL, "EXTHEAD", PS_META_REPLACE, "name of image extension w/", headname);
     
    345344
    346345        // XXX these are case-sensitive since the EXTYPE is case-sensitive
    347 
    348346        status = false;
    349347        if (!strcmp (exttype, "SMPDATA")) {
     
    517515        }
    518516
    519         XXX need to test for EXTNAME vs SMPDATA, PS1_DEV_0, etc
    520 
    521517        // we need to find the corresponding table EXTNAME.
    522518        // first check the header
     
    532528            psAbort("cannot find data extension %s in %s", dataname, file->filename);
    533529        }
    534         sources = pmSourcesReadCMF (file->fits, hdu->header);
     530
     531        psMetadata *tableHeader = psFitsReadHeader(NULL, file->fits); // The FITS header
     532        if (!tableHeader) psAbort("cannot read table header");
     533
     534        char *exttype = psMetadataLookupStr (NULL, tableHeader, "EXTTYPE");
     535        if (!exttype) psAbort("cannot read table type");
     536
     537        // XXX these are case-sensitive since the EXTYPE is case-sensitive
     538        if (!strcmp (exttype, "SMPDATA")) {
     539            sources = pmSourcesRead_SMPDATA (file->fits, hdu->header);
     540        }
     541        if (!strcmp (exttype, "PS1_DEV_0")) {
     542            sources = pmSourcesRead_PS1_DEV_0 (file->fits, hdu->header);
     543        }
     544
    535545        psFree (dataname);
    536546        break;
Note: See TracChangeset for help on using the changeset viewer.