IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 19, 2007, 3:58:16 PM (19 years ago)
Author:
magnier
Message:

defining new pmSourceFitSet APIs which can use variable models; adding functions to add sources to cell (not chips)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20070817/psModules/src/objects/pmSourceUtils.c

    r14544 r14546  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.1.2.1 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-08-17 21:01:59 $
     8 *  @version $Revision: 1.1.2.2 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-08-20 01:58:16 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    7676    }
    7777
    78     // XXX I don't yet know how this function should be defined
    79 # if (0)
    80     source->peak = pmPeakAlloc ();
     78    pmCell *cell = readout->parent;
    8179
    82     float x = model->params->data.F32[PM_PAR_XPOS];
    83     float y = model->params->data.F32[PM_PAR_YPOS];
     80    float Io    = model->params->data.F32[PM_PAR_I0];
     81    float xChip = model->params->data.F32[PM_PAR_XPOS];
     82    float yChip = model->params->data.F32[PM_PAR_YPOS];
    8483
    85     // XXX need to define the radius in some rational way
    86     // XXX x,y are defined wrt readout->image parent, but the model
    87     // parameters are defined wrt chip coordinates
    88     pmSourceDefinePixels (source, readout, x, y, radius);
    89 # endif
     84    source->peak = pmPeakAlloc (xChip, yChip, Io, PM_PEAK_LONE);
     85
     86    int x0Cell = psMetadataLookupS32(NULL, cell->concepts, "CELL.X0");
     87    int y0Cell = psMetadataLookupS32(NULL, cell->concepts, "CELL.Y0");
     88    int xParityCell = psMetadataLookupS32(NULL, cell->concepts, "CELL.XPARITY");
     89    int yParityCell = psMetadataLookupS32(NULL, cell->concepts, "CELL.YPARITY");
     90
     91    // XXX whose binning?
     92    int xBin = psMetadataLookupS32(NULL, cell->concepts, "CELL.XBIN"); // Binning in x and y
     93    int yBin = psMetadataLookupS32(NULL, cell->concepts, "CELL.YBIN"); // Binning in x and y
     94
     95    // Position on the cell
     96    float xCell = PM_CHIP_TO_CELL(xChip, x0Cell, xParityCell, xBin);
     97    float yCell = PM_CHIP_TO_CELL(yChip, y0Cell, yParityCell, yBin);
     98
     99    // Position on the readout
     100    // float xReadout = CELL_TO_READOUT(xCell, x0Readout);
     101    // float yReadout = CELL_TO_READOUT(yCell, y0Readout);
     102   
     103    float radius = 5.0; // XXX need to define the radius in some rational way
     104
     105    pmSourceDefinePixels (source, readout, xCell, yCell, radius);
    90106
    91107    return (source);
Note: See TracChangeset for help on using the changeset viewer.