Changeset 21323 for trunk/pswarp/src/pswarpTransformSources.c
- Timestamp:
- Feb 5, 2009, 10:44:04 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/pswarp/src/pswarpTransformSources.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pswarp/src/pswarpTransformSources.c
r20578 r21323 1 /** @file pswarpTransformSources.c 2 * 3 * @brief 4 * 5 * @ingroup pswarp 6 * 7 * @author IfA 8 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2009-02-05 20:44:04 $ 10 * Copyright 2009 Institute for Astronomy, University of Hawaii 11 */ 12 1 13 #include "pswarp.h" 2 14 3 #define SOURCE_ARRAY_BUFFER 100 // Size to grow the array of sources at a time15 #define SOURCE_ARRAY_BUFFER 100 ///< Size to grow the array of sources at a time 4 16 5 // NOTE: in this function, the coordinates are transformed from the OUTPUT to the INPUT 17 /** 18 * NOTE: in this function, the coordinates are transformed from the OUTPUT to the INPUT 19 */ 6 20 bool pswarpTransformSources(pmReadout *output, pmReadout *input, pmConfig *config) 7 21 { … … 33 47 // this does not cost us so much time. 34 48 for (int i = 0; i < inSources->n; i++) { 35 pmSource *source = inSources->data[i]; // Source of interest36 pmModel *model = source->modelPSF; // Model for this source37 float xIn, yIn; // Coordinates of source49 pmSource *source = inSources->data[i]; ///< Source of interest 50 pmModel *model = source->modelPSF; ///< Model for this source 51 float xIn, yIn; ///< Coordinates of source 38 52 xIn = model->params->data.F32[PM_PAR_XPOS] - input->image->col0; 39 53 yIn = model->params->data.F32[PM_PAR_YPOS] - input->image->row0; 40 54 41 int xGrid, yGrid; // Grid coordinates for local map55 int xGrid, yGrid; ///< Grid coordinates for local map 42 56 if (!pswarpMapGridSetGrid(sourceGrid, xIn + 0.5, yIn + 0.5, &xGrid, &yGrid)) { 43 57 psError(PS_ERR_UNKNOWN, false, "Unable to get grid coordinates for source at %f,%f\n", … … 53 67 } 54 68 55 pswarpMap *map = sourceGrid->maps[xGrid][yGrid]; // Locally linear transformation56 double xOut, yOut; // Output coordinates69 pswarpMap *map = sourceGrid->maps[xGrid][yGrid]; ///< Locally linear transformation 70 double xOut, yOut; ///< Output coordinates 57 71 if (!pswarpMapApply(&xOut, &yOut, map, xIn + 0.5, yIn + 0.5)) { 58 72 psError(PS_ERR_UNKNOWN, false, "Unable to transform coordinates for source at %f,%f\n", … … 73 87 // Magnitudes will be off if there's any change in scale, but for our purposes (mainly x,y and 74 88 // relative flux) that's OK. 75 pmSource *new = pmSourceAlloc(); // New source89 pmSource *new = pmSourceAlloc(); ///< New source 76 90 new->peak = pmPeakAlloc(xOut, yOut, source->peak->flux, PM_PEAK_LONE); 77 91 new->peak->flux = source->peak->flux;
Note:
See TracChangeset
for help on using the changeset viewer.
