Changeset 21368 for trunk/pswarp/src/pswarpLoop.c
- Timestamp:
- Feb 5, 2009, 5:10:36 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/pswarp/src/pswarpLoop.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pswarp/src/pswarpLoop.c
r21323 r21368 6 6 * 7 7 * @author IfA 8 * @version $Revision: 1.3 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2009-02-0 5 20:44:04$8 * @version $Revision: 1.37 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2009-02-06 03:10:36 $ 10 10 * Copyright 2009 Institute for Astronomy, University of Hawaii 11 11 */ … … 13 13 #include "pswarp.h" 14 14 #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 24 static void fileActivation(pmConfig *config, // Configuration 25 char **files, // Files to turn on/off 26 bool state // Activation state 29 27 ) 30 28 { … … 293 291 } 294 292 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 295 304 if (!pmConceptsAverageCells(outCell, cells, NULL, NULL, false)) { 296 305 psError(PS_ERR_UNKNOWN, false, "Unable to average cell concepts."); … … 348 357 ioChecksBefore(config); 349 358 350 // supply the readout and fpa of interest to psphot359 // supply the readout and fpa of interest to psphot 351 360 pmFPAfile *photFile = psMetadataLookupPtr(NULL, config->files, "PSPHOT.INPUT"); 352 361 pmFPACopy(photFile->fpa, outFPA); … … 359 368 // We can adjust the weight directly since this is a deep copy 360 369 pmReadout *photRO = pmFPAviewThisReadout(view, photFile->fpa); 361 float vf = psMetadataLookupF32(NULL, photRO->parent->concepts, "CELL.VARFACTOR"); // /<Variance factor362 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) { 367 376 psError(PS_ERR_UNKNOWN, false, "No sources supplied to measure PSF"); 368 377 return false; 369 378 } 370 379 371 // measure the PSF using these sources380 // measure the PSF using these sources 372 381 if (!psphotReadoutFindPSF(config, view, sources)) { 373 382 psError(PS_ERR_UNKNOWN, false, "Unable to determine PSF for warped image.");
Note:
See TracChangeset
for help on using the changeset viewer.
