IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12481


Ignore:
Timestamp:
Mar 18, 2007, 12:03:21 PM (19 years ago)
Author:
magnier
Message:

added pmConceptsReadCell to pmSourceReadCell; modified pmSourceWrite_ APIs for CMF formats

Location:
trunk/psModules/src/objects
Files:
4 edited

Legend:

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

    r12464 r12481  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2007-03-16 01:48:55 $
     5 *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2007-03-18 22:03:08 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2222#include "pmFPAview.h"
    2323#include "pmFPAfile.h"
     24#include "pmConcepts.h"
    2425
    2526#include "pmPeaks.h"
     
    333334        }
    334335
    335         // create a header to hold the output data
    336         outhead = psMetadataAlloc ();
    337 
    338         // save psphot and psastro metadata in the image and table headers
    339         // XXX this is a bit silly: we are duplicating these because I'm not sure which
    340         // I need to keep for multi-readout images...
    341         updates = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.HEADER");
    342         if (updates) {
    343             psMetadataCopy (outhead, updates);
    344         }
    345         updates = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.HEADER");
    346         if (updates) {
    347             psMetadataCopy (outhead, updates);
    348         }
    349 
     336        // create a header to hold the output data
     337        outhead = psMetadataAlloc ();
     338
     339        // determine the output table format
    350340        psMetadata *recipe = psMetadataLookupMetadata(&status, config->recipes, "PSPHOT");
    351341        if (!status) {
     
    358348        }
    359349
     350        // write the links to the image header
    360351        psMetadataAddStr (outhead, PS_LIST_TAIL, "EXTHEAD", PS_META_REPLACE, "name of image extension w/", headname);
    361352        psMetadataAddStr (outhead, PS_LIST_TAIL, "EXTTYPE", PS_META_REPLACE, "extension type", exttype);
     
    365356        status = false;
    366357        if (!strcmp (exttype, "SMPDATA")) {
    367             status = pmSourcesWrite_SMPDATA (file->fits, sources, outhead, dataname);
     358            status = pmSourcesWrite_SMPDATA (file->fits, sources, file->header, outhead, dataname);
    368359        }
    369360        if (!strcmp (exttype, "PS1_DEV_0")) {
    370             status = pmSourcesWrite_PS1_DEV_0 (file->fits, sources, outhead, dataname);
     361            status = pmSourcesWrite_PS1_DEV_0 (file->fits, sources, file->header, outhead, dataname);
    371362        }
    372363
     
    466457        pmReadout *readout = cell->readouts->data[i];
    467458        pmReadoutReadObjects (readout, view, file, config);
     459
     460        // load in the concept information for this cell
     461        if (!pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER, true, NULL)) {
     462            //psError(PS_ERR_UNKNOWN, false, "Failed to read concepts for cell");
     463            //return false;
     464            psWarning("Difficulty reading concepts for cell; attempting to proceed.");
     465        }
     466
    468467        cell->data_exists = true;
    469468    }
  • trunk/psModules/src/objects/pmSourceIO.h

    r12446 r12481  
    44 * @author EAM, IfA; GLG, MHPCC
    55 *
    6  * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2007-03-15 20:44:55 $
     6 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2007-03-18 22:03:21 $
    88 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    99 *
     
    2323bool pmSourcesWriteCMP (psArray *sources, char *filename, psMetadata *header);
    2424
    25 bool pmSourcesWrite_SMPDATA (psFits *fits, psArray *sources, psMetadata *header, char *extname);
    26 bool pmSourcesWrite_PS1_DEV_0 (psFits *fits, psArray *sources, psMetadata *header, char *extname);
     25bool pmSourcesWrite_SMPDATA (psFits *fits, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname);
     26bool pmSourcesWrite_PS1_DEV_0 (psFits *fits, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname);
    2727
    2828psArray *pmSourcesReadCMP (char *filename, psMetadata *header);
  • trunk/psModules/src/objects/pmSourceIO_PS1_DEV_0.c

    r12445 r12481  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2007-03-15 20:44:25 $
     5 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2007-03-18 22:03:21 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4040// XXX how do I generate the source tables which I need to send to PSPS?
    4141
    42 bool pmSourcesWrite_PS1_DEV_0 (psFits *fits, psArray *sources, psMetadata *header, char *extname)
     42bool pmSourcesWrite_PS1_DEV_0 (psFits *fits, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname)
    4343{
    4444
     
    107107
    108108    if (table->n == 0) {
    109         psFitsWriteBlank (fits, header, extname);
     109        psFitsWriteBlank (fits, tableHeader, extname);
    110110        psFree (table);
    111111        return true;
     
    113113
    114114    psTrace ("pmFPAfile", 5, "writing ext data %s\n", extname);
    115     if (!psFitsWriteTable (fits, header, table, extname)) {
     115    if (!psFitsWriteTable (fits, tableHeader, table, extname)) {
    116116        psError(PS_ERR_IO, false, "writing ext data %s\n", extname);
    117117        psFree(table);
  • trunk/psModules/src/objects/pmSourceIO_SMPDATA.c

    r12402 r12481  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2007-03-11 18:56:38 $
     5 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2007-03-18 22:03:21 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3535// this format consists of a header derived from the image header
    3636// followed by a zero-size matrix, followed by the table data
    37 bool pmSourcesWrite_SMPDATA (psFits *fits, psArray *sources, psMetadata *header, char *extname)
     37bool pmSourcesWrite_SMPDATA (psFits *fits, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname)
    3838{
    3939
     
    4848
    4949    // find config information for output header
    50     float ZERO_POINT = psMetadataLookupF32 (&status, header, "ZERO_PT");
     50    float ZERO_POINT = psMetadataLookupF32 (&status, imageHeader, "ZERO_PT");
    5151
    5252    table = psArrayAllocEmpty (sources->n);
     
    8989
    9090    if (table->n == 0) {
    91         psFitsWriteBlank (fits, header, extname);
     91        psFitsWriteBlank (fits, tableHeader, extname);
    9292        psFree (table);
    9393        return true;
     
    9595
    9696    psTrace ("pmFPAfile", 5, "writing ext data %s\n", extname);
    97     if (!psFitsWriteTable (fits, header, table, extname)) {
     97    if (!psFitsWriteTable (fits, tableHeader, table, extname)) {
    9898        psError(PS_ERR_IO, false, "writing ext data %s\n", extname);
    9999        psFree(table);
Note: See TracChangeset for help on using the changeset viewer.