IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 11, 2007, 8:56:38 AM (19 years ago)
Author:
magnier
Message:

new output formats

File:
1 edited

Legend:

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

    r12398 r12402  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2007-03-10 07:03:20 $
     5 *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2007-03-11 18:56:38 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    329329        }
    330330
    331         exttype = psStringCopy ("SMPDATA");  // XXX derive this from the recipes
     331        psMetadata *recipe = psMetadataLookupMetadata(&status, config->recipes, "PSPHOT");
     332        if (!status) {
     333          psError(PS_ERR_UNKNOWN, true, "missing recipe PSPHOT in config data");
     334          return false;
     335        }
     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        }
     341
    332342        psMetadataAddStr (outhead, PS_LIST_TAIL, "EXTHEAD", PS_META_REPLACE, "name of image extension w/", headname);
    333343        psMetadataAddStr (outhead, PS_LIST_TAIL, "EXTTYPE", PS_META_REPLACE, "extension type", exttype);
    334344        psFree (exttype);
    335345
    336         if (!pmSourcesWriteCMF (file->fits, sources, outhead, dataname)) {
    337             psError(PS_ERR_IO, false, "writing CMF data to %s\n", file->filename);
     346        // XXX these are case-sensitive since the EXTYPE is case-sensitive
     347
     348        status = false;
     349        if (!strcmp (exttype, "SMPDATA")) {
     350          status = pmSourcesWrite_SMPDATA (file->fits, sources, outhead, dataname);
     351        }
     352        if (!strcmp (exttype, "PS1_DEV_0")) {
     353          status = pmSourcesWrite_PS1_DEV_0 (file->fits, sources, outhead, dataname);
     354        }
     355
     356        if (!status) {
     357            psError(PS_ERR_IO, false, "writing CMF data to %s with format %s\n", file->filename, exttype);
    338358            psFree (headname);
    339359            psFree (dataname);
     
    497517        }
    498518
     519        XXX need to test for EXTNAME vs SMPDATA, PS1_DEV_0, etc
     520
    499521        // we need to find the corresponding table EXTNAME.
    500522        // first check the header
Note: See TracChangeset for help on using the changeset viewer.