IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 5, 2009, 5:10:36 PM (17 years ago)
Author:
Paul Price
Message:

Merging pap_branch_20090128. Resolved a small number of conflicts. Compiles, but not tested in detail.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pswarp/src/pswarpLoop.c

    r21323 r21368  
    66 *
    77 *  @author IfA
    8  *  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2009-02-05 20:44:04 $
     8 *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-02-06 03:10:36 $
    1010 *  Copyright 2009 Institute for Astronomy, University of Hawaii
    1111 */
     
    1313#include "pswarp.h"
    1414#include <ppStats.h>
    15 
    16 #define WCS_NONLIN_TOL 0.001            ///< Non-linear tolerance for header WCS
    17 #define PSPHOT_FIND_PSF 1               ///< Use psphot's findPSF function?
    18 #define TESTING 0                       ///< Testing output?
    19 
    20 #include "pswarpFileNames.h" ///< Lists of file rules used at different stages
    21 
    22 /**
    23  * XXX these are generic functions which should be moved to psModules
    24  * Activate a list of files
    25  */
    26 static void fileActivation(pmConfig *config, ///< Configuration
    27                            char **files, ///< Files to turn on/off
    28                            bool state   ///< Activation state
     15#include "pswarpFileNames.h"            // Lists of file rules used at different stages
     16
     17#define WCS_NONLIN_TOL 0.001            // Non-linear tolerance for header WCS
     18#define PSPHOT_FIND_PSF 1               // Use psphot's findPSF function?
     19#define TESTING 0                       // Testing output?
     20
     21
     22// XXX these are generic functions which should be moved to psModules
     23// Activate a list of files
     24static void fileActivation(pmConfig *config, // Configuration
     25                           char **files, // Files to turn on/off
     26                           bool state   // Activation state
    2927    )
    3028{
     
    293291    }
    294292
     293    // Set covariance matrix for output
     294    {
     295        psList *covariances = psMetadataLookupPtr(&mdok, output->analysis,
     296                                                  PSWARP_ANALYSIS_COVARIANCES); // Covariance matrices
     297        psAssert(covariances, "Should be there");
     298        psArray *covars = psListToArray(covariances); // Array of covariance matrices
     299        output->covariance = psImageCovarianceAverage(covars);
     300        psFree(covars);
     301        psMetadataRemoveKey(output->analysis, PSWARP_ANALYSIS_COVARIANCES);
     302    }
     303
    295304    if (!pmConceptsAverageCells(outCell, cells, NULL, NULL, false)) {
    296305        psError(PS_ERR_UNKNOWN, false, "Unable to average cell concepts.");
     
    348357        ioChecksBefore(config);
    349358
    350         // supply the readout and fpa of interest to psphot
     359        // supply the readout and fpa of interest to psphot
    351360        pmFPAfile *photFile = psMetadataLookupPtr(NULL, config->files, "PSPHOT.INPUT");
    352361        pmFPACopy(photFile->fpa, outFPA);
     
    359368        // We can adjust the weight directly since this is a deep copy
    360369        pmReadout *photRO = pmFPAviewThisReadout(view, photFile->fpa);
    361         float vf = psMetadataLookupF32(NULL, photRO->parent->concepts, "CELL.VARFACTOR"); ///< Variance factor
    362         psBinaryOp(photRO->weight, photRO->weight, "*", psScalarAlloc(vf, PS_TYPE_F32));
    363 
    364         // grab the sources of interest from the storage location (pmFPAfile PSPHOT.INPUT.CMF)
    365         psArray *sources = psphotLoadPSFSources (config, view);
    366         if (!sources) {
     370        float vf = psMetadataLookupF32(NULL, photRO->parent->concepts, "CELL.VARFACTOR"); // Variance factor
     371        psBinaryOp(photRO->variance, photRO->variance, "*", psScalarAlloc(vf, PS_TYPE_F32));
     372
     373        // grab the sources of interest from the storage location (pmFPAfile PSPHOT.INPUT.CMF)
     374        psArray *sources = psphotLoadPSFSources (config, view);
     375        if (!sources) {
    367376            psError(PS_ERR_UNKNOWN, false, "No sources supplied to measure PSF");
    368377            return false;
    369378        }
    370379
    371         // measure the PSF using these sources
     380        // measure the PSF using these sources
    372381        if (!psphotReadoutFindPSF(config, view, sources)) {
    373382            psError(PS_ERR_UNKNOWN, false, "Unable to determine PSF for warped image.");
Note: See TracChangeset for help on using the changeset viewer.