IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4770 for trunk/psModules/src


Ignore:
Timestamp:
Aug 15, 2005, 3:10:36 PM (21 years ago)
Author:
gusciora
Message:

There are a lot of changes here required by the new SDRS. Most changes
involve the new definitions of the psAstrometry types. Not all tests work
correctly.

Location:
trunk/psModules/src
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/pmAstrometry.c

    r4754 r4770  
    88 *  @author GLG, MHPCC
    99 *
    10  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-08-11 00:03:51 $
     10 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2005-08-16 01:10:34 $
    1212 *
    1313 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2323#include "pmAstrometry.h"
    2424
    25 psDB wow;
    26 
    2725/*****************************************************************************
    28 checkValidImageCoords(): this is a private function which simply
    29 determines if the supplied x,y coordinates are in the range for the supplied
    30 psImage.
     26checkValidImageCoords(): this is a private function which simply determines if
     27the supplied x,y coordinates are in the range for the supplied psImage.
     28 
     29XXX: What about col0 and row0
     30XXX: This should return a psBool.
    3131 *****************************************************************************/
    32 /*
    3332static psS32 checkValidImageCoords(double x,
    3433                                   double y,
     
    3635{
    3736    PS_ASSERT_IMAGE_NON_NULL(tmpImage, 0);
    38  
     37
    3938    if ((x < 0.0) || (x > (double)tmpImage->numCols) ||
    4039            (y < 0.0) || (y > (double)tmpImage->numRows)) {
    4140        return (0);
    4241    }
    43  
     42
    4443    return (1);
    4544}
    46 */
    47 /*
    48 static void FPAFree(psFPA* fpa)
     45
     46/******************************************************************************
     47XXX: Is this the correct way to free metadata?
     48XXX: Is this the correct way to free database structs?
     49 *****************************************************************************/
     50
     51static void FPAFree(pmFPA *fpa)
    4952{
    5053    if (fpa != NULL) {
    51         psFree(fpa->chips);
    52         psFree(fpa->grommit);
    53         psFree(fpa->exposure);
    54         psFree(fpa->metadata);
    5554        psFree(fpa->fromTangentPlane);
    5655        psFree(fpa->toTangentPlane);
    57         psFree(fpa->pattern);
    58         psFree(fpa->colorPlus);
    59         psFree(fpa->colorMinus);
    6056        psFree(fpa->projection);
    61     }
    62 }
    63 */
    64 
    65 /*
    66 static void chipFree(psChip* chip)
     57        psFree(fpa->concepts);
     58        psFree(fpa->analysis);
     59        psFree(fpa->camera);
     60        psFree(fpa->chips);
     61        psFree(fpa->header);
     62        psFree(fpa->db);
     63    }
     64}
     65
     66static void chipFree(pmChip* chip)
    6767{
    6868    if (chip != NULL) {
    69         psFree(chip->cells);
    70         psFree(chip->metadata);
    7169        psFree(chip->toFPA);
    7270        psFree(chip->fromFPA);
    73     }
    74 }
    75 */
    76 
    77 /*
    78 static void cellFree(psCell* cell)
     71        psFree(chip->concepts);
     72        psFree(chip->analysis);
     73        psFree(chip->cells);
     74        psFree(chip->parent);
     75        psFree(chip->extname);
     76        psFree(chip->pixels);
     77        psFree(chip->header);
     78    }
     79}
     80
     81static void cellFree(pmCell *cell)
    7982{
    8083    if (cell != NULL) {
     84        psFree(cell->toChip);
     85        psFree(cell->toFPA);
     86        psFree(cell->toSky);
     87        psFree(cell->concepts);
     88        psFree(cell->analysis);
    8189        psFree(cell->readouts);
    82         psFree(cell->metadata);
    83         psFree(cell->toChip);
    84         psFree(cell->fromChip);
    85         psFree(cell->toFPA);
    86         psFree(cell->toTP);
    87         psFree(cell->toSky);
    88     }
    89 }
    90 */
    91 
    92 static void readoutFree(psReadout* readout)
     90        psFree(cell->parent);
     91        psFree(cell->extname);
     92        psFree(cell->pixels);
     93        psFree(cell->header);
     94    }
     95}
     96
     97static void readoutFree(pmReadout *readout)
    9398{
    9499    if (readout != NULL) {
    95100        psFree(readout->image);
    96101        psFree(readout->mask);
    97         psFree(readout->objects);
    98         psFree(readout->metadata);
    99     }
    100 }
    101 
    102 /*
    103 static void observatoryFree(psObservatory* obs)
    104 {
    105     if (obs != NULL) {
    106         psFree(obs->name);
    107     }
    108 }
    109 */
    110 /*
    111 static void exposureFree(psExposure* exp)
    112 {
    113     if (exp != NULL) {
    114         psFree(exp->time);
    115         psFree(exp->observatory);
    116         psFree(exp->cameraName);
    117         psFree(exp->telescopeName);
    118     }
    119 }
    120 */
    121 /*
    122 static void fixedPatternFree(psFixedPattern* fp)
    123 {
    124     if (fp != NULL) {
    125         for (psS32 i = 0; i < fp->p_ps_xRows; i++) {
    126             psFree(fp->x[i]);
    127         }
    128  
    129         for (psS32 j = 0; j < fp->p_ps_yRows; j++) {
    130             psFree(fp->y[j]);
    131         }
    132  
    133         psFree(fp->x);
    134         psFree(fp->y);
    135     }
    136 }
    137 */
     102        psFree(readout->analysis);
     103        psFree(readout->concepts);
     104        psFree(readout->parent);
     105    }
     106}
     107
     108
     109pmReadout *pmReadoutAlloc(pmCell *cell)
     110{
     111    pmReadout *tmpReadout = (pmReadout *) psAlloc(sizeof(pmReadout));
     112
     113    tmpReadout->col0 = -1;
     114    tmpReadout->row0 = -1;
     115    tmpReadout->colBins = -1;
     116    tmpReadout->rowBins = -1;
     117    tmpReadout->image = NULL;
     118    tmpReadout->mask = NULL;
     119    tmpReadout->analysis = psMetadataAlloc();
     120    tmpReadout->concepts = psMetadataAlloc();
     121    tmpReadout->parent = cell;
     122
     123    if (cell != NULL) {
     124        cell->readouts = psArrayAdd(cell->readouts, 1, (psPtr) tmpReadout);
     125    }
     126    psMemSetDeallocator(tmpReadout, (psFreeFunc) readoutFree);
     127    return(tmpReadout);
     128}
     129
     130pmCell *pmCellAlloc(pmChip *chip)
     131{
     132    pmCell *tmpCell = (pmCell *) psAlloc(sizeof(pmCell));
     133
     134    tmpCell->col0 = -1;
     135    tmpCell->row0 = -1;
     136    tmpCell->toChip = NULL;
     137    tmpCell->toFPA = NULL;
     138    tmpCell->toSky = NULL;
     139    tmpCell->analysis = psMetadataAlloc();
     140    tmpCell->concepts = psMetadataAlloc();
     141    tmpCell->readouts = psArrayAlloc(0);
     142    tmpCell->parent = chip;
     143    if (chip != NULL) {
     144        chip->cells = psArrayAdd(chip->cells, 1, (psPtr) tmpCell);
     145    }
     146    tmpCell->valid = false;
     147    tmpCell->extname = NULL;
     148    tmpCell->pixels = NULL;
     149    tmpCell->header = NULL;
     150
     151    psMemSetDeallocator(tmpCell, (psFreeFunc) cellFree);
     152    return(tmpCell);
     153}
     154
     155pmChip *pmChipAlloc(pmFPA *fpa)
     156{
     157    pmChip *tmpChip = (pmChip *) psAlloc(sizeof(pmChip));
     158
     159    tmpChip->col0 = -1;
     160    tmpChip->row0 = -1;
     161    tmpChip->toFPA = NULL;
     162    tmpChip->fromFPA = NULL;
     163    tmpChip->concepts = psMetadataAlloc();
     164    tmpChip->analysis = psMetadataAlloc();
     165    tmpChip->cells = psArrayAlloc(0);
     166    tmpChip->parent = fpa;
     167    if (fpa != NULL) {
     168        fpa->chips = psArrayAdd(fpa->chips, 1, (psPtr) tmpChip);
     169    }
     170    tmpChip->valid = false;
     171    tmpChip->extname = NULL;
     172    tmpChip->pixels = NULL;
     173    tmpChip->header = NULL;
     174
     175    psMemSetDeallocator(tmpChip, (psFreeFunc) chipFree);
     176    return(tmpChip);
     177}
     178
     179pmFPA *pmFPAAlloc(
     180    const psMetadata *camera,
     181    psDB *db)
     182{
     183    pmFPA *tmpFPA = (pmFPA *) psAlloc(sizeof(pmFPA));
     184
     185    tmpFPA->fromTangentPlane = NULL;
     186    tmpFPA->toTangentPlane = NULL;
     187    tmpFPA->projection = NULL;
     188    tmpFPA->concepts = psMetadataAlloc();
     189    tmpFPA->analysis = psMetadataAlloc();
     190    tmpFPA->camera = camera;
     191    tmpFPA->chips = psArrayAlloc(0);
     192    tmpFPA->header = NULL;
     193    tmpFPA->db = db;
     194
     195    psMemSetDeallocator(tmpFPA, (psFreeFunc) FPAFree);
     196    return(tmpFPA);
     197}
     198
     199bool cellCheckParents(pmCell *cell)
     200{
     201    if (cell == NULL) {
     202        return(true);
     203    }
     204    psBool flag = true;
     205
     206    for (psS32 i = 0 ; i < cell->readouts->n ; i++) {
     207        pmReadout *tmpReadout = (pmReadout *) cell->readouts->data[i];
     208        PS_ASSERT_PTR_NON_NULL(tmpReadout, false);
     209        if (tmpReadout->parent != cell) {
     210            tmpReadout->parent = cell;
     211            flag = false;
     212        }
     213    }
     214    return(flag);
     215}
     216
     217bool chipCheckParents(pmChip *chip)
     218{
     219    if (chip == NULL) {
     220        return(true);
     221    }
     222    psBool flag = true;
     223
     224    for (psS32 i = 0 ; i < chip->cells->n ; i++) {
     225        pmCell *tmpCell = (pmCell *) chip->cells->data[i];
     226        PS_ASSERT_PTR_NON_NULL(tmpCell, false);
     227        if (tmpCell->parent != chip) {
     228            tmpCell->parent = chip;
     229            flag = false;
     230        }
     231
     232        flag &= cellCheckParents(tmpCell);
     233    }
     234    return(flag);
     235}
     236
     237bool pmFPACheckParents(pmFPA *fpa)
     238{
     239    if (fpa == NULL) {
     240        return(true);
     241    }
     242    psBool flag = true;
     243
     244    for (psS32 i = 0 ; i < fpa->chips->n ; i++) {
     245        pmChip *tmpChip = (pmChip *) fpa->chips->data[i];
     246        PS_ASSERT_PTR_NON_NULL(tmpChip, false);
     247        if (tmpChip->parent != fpa) {
     248            tmpChip->parent = fpa;
     249            flag = false;
     250        }
     251
     252        flag &= chipCheckParents(tmpChip);
     253    }
     254    return(flag);
     255}
     256
     257
     258
     259// HEY
    138260/*****************************************************************************/
    139261/* FUNCTION IMPLEMENTATION - PUBLIC                                          */
    140262/*****************************************************************************/
    141263
    142 /*
    143  * XXX: Verify that you interpreted the SDR correctly.
    144  *
    145  * XXX: This assumes that x,y must be of type F64
    146  */
    147 /*
    148 psFixedPattern* psFixedPatternAlloc(double x0,
    149                                    double y0,
    150                                    double xScale,
    151                                    double yScale,
    152                                    const psImage *x,
    153                                    const psImage *y)
    154 {
    155    psFixedPattern *tmp;
    156    psS32 i;
    157    psS32 j;
    158  
    159    PS_ASSERT_IMAGE_NON_NULL(x, NULL);
    160    PS_ASSERT_IMAGE_NON_NULL(y, NULL);
    161    PS_ASSERT_IMAGE_TYPE(x, PS_TYPE_F64, NULL);
    162    PS_ASSERT_IMAGE_TYPE(y, PS_TYPE_F64, NULL);
    163  
    164    tmp = (psFixedPattern *) psAlloc(sizeof(psFixedPattern));
    165    // XXX: Is this correct?
    166    tmp->nX = (x->numCols * x->numRows);
    167    tmp->nY = (y->numCols * y->numRows);
    168    tmp->x0 = x0;
    169    tmp->y0 = y0;
    170    tmp->xScale = xScale;
    171    tmp->yScale = yScale;
    172    tmp->p_ps_xRows = x->numRows;
    173    tmp->p_ps_xCols = x->numCols;
    174    tmp->p_ps_yRows = y->numRows;
    175    tmp->p_ps_yCols = y->numCols;
    176    tmp->x = (double **) psAlloc(x->numRows * sizeof(double *));
    177    for (i=0;i<x->numRows;i++) {
    178        (tmp->x)[i] = (double *) psAlloc(x->numCols * sizeof(double));
    179    }
    180    for (i=0;i<x->numRows;i++) {
    181        for (j=0;j<x->numCols;j++) {
    182            (tmp->x)[i][j] = x->data.F64[i][j];
    183        }
    184    }
    185  
    186    tmp->y = (double **) psAlloc(y->numRows * sizeof(double *));
    187    for (i=0;i<y->numRows;i++) {
    188        (tmp->y)[i] = (double *) psAlloc(y->numCols * sizeof(double));
    189    }
    190    for (i=0;i<y->numRows;i++) {
    191        for (j=0;j<y->numCols;j++) {
    192            (tmp->y)[i][j] = y->data.F64[i][j];
    193        }
    194    }
    195  
    196    psMemSetDeallocator(tmp,(psFreeFunc)fixedPatternFree);
    197  
    198    return(tmp);
    199 }
    200 */
    201 /*
    202 psExposure* psExposureAlloc(double ra,
    203                             double dec,
    204                             double hourAngle,
    205                             double zenithDistance,
    206                             double azimuth,
    207                             const psTime* time,
    208                             float rotAngle,
    209                             float temperature,
    210                             float pressure,
    211                             float humidity,
    212                             float exposureTime,
    213                             float wavelength,
    214                             const psObservatory* observatory)
    215 {
    216     PS_ASSERT_PTR_NON_NULL(observatory, NULL);
    217  
    218     psExposure* exp = psAlloc(sizeof(psExposure));
    219     *(double *)&exp->ra = ra;
    220     *(double *)&exp->dec = dec;
    221     *(double *)&exp->hourAngle = hourAngle;
    222     *(double *)&exp->zenithDistance = zenithDistance;
    223     *(double *)&exp->azimuth = azimuth;
    224     *(float *)&exp->rotAngle = rotAngle;
    225     *(float *)&exp->temperature = temperature;
    226     *(float *)&exp->pressure = pressure;
    227     *(float *)&exp->humidity = humidity;
    228     *(float *)&exp->exposureTime = exposureTime;
    229     *(float *)&exp->wavelength = wavelength;
    230  
    231     exp->time = psMemIncrRefCounter((psPtr)time);
    232     exp->observatory = psMemIncrRefCounter((psPtr)observatory);
    233  
    234     // XXX: how is this value derived?
    235     *(double *)&exp->lst = psTimeToLMST((psTime*)time,observatory->longitude);
    236     *(float *)&exp->positionAngle = 0.0f; // XXX: need input, see Bug #207
    237     *(float *)&exp->parallacticAngle = 0.0f; // XXX: need input, see Bug #207
    238     *(float *)&exp->airmass = 0.0f; // XXX: needs calculation!  = slaAirmas(zenithDistance);
    239     *(float *)&exp->parallacticFactor = 0.0f;
    240     exp->cameraName = NULL;
    241     exp->telescopeName = NULL;
    242  
    243     psMemSetDeallocator(exp,(psFreeFunc)exposureFree);
    244  
    245     return exp;
    246 }
    247 */
    248 /*
    249 psObservatory* psObservatoryAlloc(const char* name,
    250                                   double latitude,
    251                                   double longitude,
    252                                   double height,
    253                                   double tlr)
    254 {
    255     psObservatory* obs = psAlloc(sizeof(psObservatory));
    256  
    257     if (name == NULL) {
    258         obs->name = NULL;
    259     } else {
    260         obs->name = psAlloc(strlen(name)+1);
    261         strcpy((char*)obs->name, name);
    262     }
    263  
    264     *(double *)&obs->latitude = latitude;
    265     *(double *)&obs->longitude = longitude;
    266     *(double *)&obs->height = height;
    267     *(double *)&obs->tlr = tlr;
    268  
    269     psMemSetDeallocator(obs,(psFreeFunc)observatoryFree);
    270  
    271     return obs;
    272 }
    273 */
    274 /*
    275 psFPA* psFPAAlloc(psS32 nChips,
    276                   const psExposure* exp)
    277 {
    278     PS_ASSERT_INT_NONNEGATIVE(nChips, NULL);
    279  
    280     psFPA* newFPA = psAlloc(sizeof(psFPA));
    281  
    282     // create array of NULL chips of the size nChips
    283     newFPA->chips = psArrayAlloc(nChips);
    284     psPtr* chips = newFPA->chips->data;
    285     for (psS32 i=0;i<nChips;i++) {
    286         chips[i] = NULL;
    287     }
    288     newFPA->chips->n = 0; // per requirement
    289  
    290     newFPA->metadata = NULL;
    291     newFPA->fromTangentPlane = NULL;
    292     newFPA->toTangentPlane = NULL;
    293     newFPA->pattern = NULL;
    294  
    295     if (exp != NULL) {
    296         newFPA->exposure = psMemIncrRefCounter((psExposure*)exp);
    297         newFPA->grommit = psGrommitAlloc(exp);
    298     } else {
    299         newFPA->exposure = NULL;
    300         newFPA->grommit = NULL;
    301     }
    302  
    303     newFPA->colorPlus = NULL;
    304     newFPA->colorMinus = NULL;
    305     newFPA->projection = NULL;
    306  
    307     newFPA->rmsX = 0.0f;
    308     newFPA->rmsY = 0.0f;
    309     newFPA->chi2 = 0.0f;
    310  
    311     psMemSetDeallocator(newFPA,(psFreeFunc)FPAFree);
    312  
    313     return newFPA;
    314 }
    315 */
    316 /*
    317  * psChip constructor
    318  */
    319 /*
    320 psChip* psChipAlloc(psS32 nCells,
    321                     psFPA *parentFPA)
    322 {
    323     PS_ASSERT_INT_NONNEGATIVE(nCells, NULL);
    324  
    325     psChip* chip = psAlloc(sizeof(psChip));
    326  
    327     // create array of NULL psCells
    328     int n = (nCells > 0) ? nCells : 1;
    329     chip->cells = psArrayAlloc(n);
    330     psPtr* cells = chip->cells->data;
    331     for (psS32 i=0;i<n;i++) {
    332         cells[i] = NULL;
    333     }
    334     chip->cells->n = 0; // per requirement
    335  
    336     *(int*)&chip->row0 = 0;
    337     *(int*)&chip->col0 = 0;
    338  
    339     chip->metadata = NULL;
    340  
    341     chip->toFPA = NULL;
    342     chip->fromFPA = NULL;
    343  
    344     chip->parent = parentFPA;
    345  
    346     psMemSetDeallocator(chip,(psFreeFunc)chipFree);
    347  
    348     return chip;
    349  
    350 }
    351 */
    352 /*
    353  * psCell constructor
    354  */
    355 /*
    356 psCell* psCellAlloc(psS32 nReadouts,
    357                     psChip* parentChip)
    358 {
    359     PS_ASSERT_INT_NONNEGATIVE(nReadouts, NULL);
    360  
    361     psCell* cell = psAlloc(sizeof(psCell));
    362  
    363     // create array of NULL psReadouts
    364     int n = (nReadouts > 0) ? nReadouts : 1;
    365     cell->readouts = psArrayAlloc(n);
    366     psPtr* readouts = cell->readouts->data;
    367     for (psS32 i=0;i<n;i++) {
    368         readouts[i] = NULL;
    369     }
    370     cell->readouts->n = 0; // per requirement
    371  
    372     *(int*)&cell->row0 = 0;
    373     *(int*)&cell->col0 = 0;
    374  
    375     cell->metadata = NULL;
    376  
    377     cell->toChip = NULL;
    378     cell->fromChip = NULL;
    379     cell->toFPA = NULL;
    380     cell->toTP = NULL;
    381     cell->toSky = NULL;
    382  
    383     cell->parent = parentChip;
    384  
    385     psMemSetDeallocator(cell,(psFreeFunc)cellFree);
    386  
    387     return cell;
    388  
    389  
    390 }
    391 */
    392 
    393 psReadout *pmReadoutAlloc(pmCell *cell)
    394 {
    395     psReadout* readout = psAlloc(sizeof(psReadout));
    396 
    397     *(psU32*)&readout->colBins = 1;
    398     *(psU32*)&readout->rowBins = 1;
    399     *(psU32*)&readout->rowParity = 0;
    400     *(psU32*)&readout->colParity = 0;
    401     *(psS32*)&readout->col0 = 0;
    402     *(psS32*)&readout->row0 = 0;
    403 
    404     readout->image = NULL;
    405     readout->mask = NULL;
    406     readout->objects = NULL;
    407     readout->metadata = NULL;
    408 
    409     psMemSetDeallocator(readout,(psFreeFunc)readoutFree);
    410 
    411     return readout;
    412 }
    413 
    414 /*
    415 psGrommit* psGrommitAlloc(const psExposure* exp)
    416 {
    417     PS_ASSERT_PTR_NON_NULL(exp, NULL);
    418  
    419     psSphere* polarMotion = p_psTimeGetPoleCoords(exp->time);
    420  
    421     psGrommit* grommit = (psGrommit* ) psAlloc(sizeof(psGrommit));
    422  
    423     *(double*)&grommit->latitude = exp->observatory->latitude;
    424     *(double*)&grommit->longitude = exp->observatory->longitude;
    425     *(double*)&grommit->height = exp->observatory->height;
    426     *(double*)&grommit->abberationMag = 0.0; // XXX: need to figure out what to set here.
    427     *(double*)&grommit->temperature = exp->temperature;
    428     *(double*)&grommit->pressure = exp->pressure;
    429     *(double*)&grommit->humidity = exp->humidity;
    430     *(double*)&grommit->wavelength = exp->wavelength;
    431     *(double*)&grommit->lapseRate = exp->observatory->tlr;
    432     *(double*)&grommit->refractA = polarMotion->r; // XXX: need to figure out what to set here too.
    433     *(double*)&grommit->refractB = polarMotion->d; // XXX: need to figure out what to set here too.
    434     *(double*)&grommit->siderealTime = psTimeToMJD(exp->time); // XXX: this is probably not correct
    435  
    436     psFree(polarMotion);
    437  
    438     return (grommit);
    439 }
    440 */
    441 /*
    442 psCell* psCellInFPA(const psPlane* fpaCoord,
    443                     const psFPA* FPA)
     264pmCell* pmCellInFPA(const psPlane* fpaCoord,
     265                    const pmFPA* FPA)
    444266{
    445267    PS_ASSERT_PTR_NON_NULL(fpaCoord, NULL);
    446268    PS_ASSERT_PTR_NON_NULL(FPA, NULL);
    447  
    448     psChip* tmpChip = NULL;
     269
     270    pmChip* tmpChip = NULL;
    449271    psPlane chipCoord;
    450     psCell* outCell = NULL;
    451  
     272    pmCell* outCell = NULL;
     273
    452274    // Determine which chip contains the fpaCoords.
    453     tmpChip = psChipInFPA(fpaCoord, FPA);
     275    tmpChip = pmChipInFPA(fpaCoord, FPA);
    454276    if (tmpChip == NULL) {
    455277        return(NULL);
    456278    }
    457  
     279
    458280    // Convert to those chip coordinates.
    459281    psCoordFPAToChip(&chipCoord, fpaCoord, tmpChip);
    460  
     282
    461283    // Determine which cell contains those chip coordinates.
    462     outCell = psCellInChip(&chipCoord, tmpChip);
    463  
     284    outCell = pmCellInChip(&chipCoord, tmpChip);
     285
    464286    return (outCell);
    465287}
    466 */
    467 /*
    468 psChip* psChipInFPA(const psPlane* fpaCoord,
    469                     const psFPA* FPA)
     288
     289pmChip* pmChipInFPA(const psPlane* fpaCoord,
     290                    const pmFPA* FPA)
    470291{
    471292    PS_ASSERT_PTR_NON_NULL(fpaCoord, NULL);
    472293    PS_ASSERT_PTR_NON_NULL(FPA, NULL);
    473294    PS_ASSERT_PTR_NON_NULL(FPA->chips, NULL);
    474  
     295
    475296    psArray* chips = FPA->chips;
    476297    psS32 nChips = chips->n;
    477298    psPlane chipCoord;
    478     psCell *tmpCell = NULL;
    479  
     299    pmCell *tmpCell = NULL;
     300
    480301    // Loop through every chip in this FPA.  Convert the original FPA
    481302    // coordinates to chip coordinates for that chip.  Then, determine if any
    482303    // cells in that chip contain those chip coordinates.
    483  
     304
    484305    for (psS32 i = 0; i < nChips; i++) {
    485         psChip* tmpChip = chips->data[i];
     306        pmChip* tmpChip = chips->data[i];
    486307        PS_ASSERT_PTR_NON_NULL(tmpChip, NULL);
    487308        PS_ASSERT_PTR_NON_NULL(tmpChip->fromFPA, NULL);
    488  
     309
    489310        psPlaneTransformApply(&chipCoord, tmpChip->fromFPA, fpaCoord);
    490  
    491         tmpCell = psCellInChip(&chipCoord, tmpChip);
     311
     312        tmpCell = pmCellInChip(&chipCoord, tmpChip);
    492313        if (tmpCell != NULL) {
    493314            return(tmpChip);
    494315        }
    495316    }
    496  
     317
    497318    // XXX: Print warning here?
    498319    return (NULL);
    499320}
    500 */
    501 /*
    502 psCell* psCellInChip(const psPlane* chipCoord,
    503                      const psChip* chip)
     321
     322
     323pmCell* pmCellInChip(const psPlane* chipCoord,
     324                     const pmChip* chip)
    504325{
    505326    PS_ASSERT_PTR_NON_NULL(chipCoord, NULL);
    506327    PS_ASSERT_PTR_NON_NULL(chip, NULL);
    507  
     328
    508329    psPlane cellCoord;
    509330    psArray* cells;
    510  
     331
    511332    cells = chip->cells;
    512333    if (cells == NULL) {
    513334        return NULL;
    514335    }
    515  
     336
    516337    // We loop over each cell in the chip.  We transform the chipCoord into
    517338    // a cellCoord for that cell and determine if that cellCoord is valid.
    518339    // If so, then we return that cell.
    519  
     340
    520341    for (psS32 i = 0; i < cells->n; i++) {
    521         psCell* tmpCell = (psCell* ) cells->data[i];
     342        pmCell* tmpCell = (pmCell* ) cells->data[i];
    522343        PS_ASSERT_PTR_NON_NULL(tmpCell, NULL);
    523         PS_ASSERT_PTR_NON_NULL(tmpCell->fromChip, NULL);
     344
     345        psPlaneTransform *chipToCell = NULL;
     346        if (1 != p_psIsProjectionLinear(tmpCell->toChip)) {
     347            // XXX: Generate warning message.
     348            // XXX: Can we use the following function to derive a transform?
     349            // chipToCell = psPlaneTransformInvert(NULL, tmpCell->toChip, NULL, -1);
     350        } else {
     351            chipToCell = p_psPlaneTransformLinearInvert(tmpCell->toChip);
     352        }
     353
     354        PS_ASSERT_PTR_NON_NULL(chipToCell, NULL);
    524355        psArray* readouts = tmpCell->readouts;
    525  
     356
    526357        if (readouts != NULL) {
    527358            for (psS32 j = 0; j < readouts->n; j++) {
    528                 psReadout* tmpReadout = readouts->data[j];
     359                pmReadout* tmpReadout = readouts->data[j];
    529360                PS_ASSERT_READOUT_NON_NULL(tmpReadout, NULL);
    530  
     361
    531362                psPlaneTransformApply(&cellCoord,
    532                                       tmpCell->fromChip,
     363                                      chipToCell,
    533364                                      chipCoord);
    534  
     365
    535366                if (checkValidImageCoords(cellCoord.x,
    536367                                          cellCoord.y,
     
    540371            }
    541372        }
    542     }
    543  
     373        psFree(chipToCell);
     374    }
     375
    544376    return (NULL);
    545377}
    546 */
    547 /*
     378
     379
    548380psPlane* psCoordCellToChip(psPlane* outCoord,
    549381                           const psPlane* inCoord,
    550                            const psCell* cell)
     382                           const pmCell* cell)
    551383{
    552384    PS_ASSERT_PTR_NON_NULL(inCoord, NULL);
    553385    PS_ASSERT_PTR_NON_NULL(cell, NULL);
    554  
     386
    555387    return (psPlaneTransformApply(outCoord, cell->toChip, inCoord));
    556388}
    557 */
    558 /*
     389
     390
    559391psPlane* psCoordChipToFPA(psPlane* outCoord,
    560392                          const psPlane* inCoord,
    561                           const psChip* chip)
     393                          const pmChip* chip)
    562394{
    563395    PS_ASSERT_PTR_NON_NULL(inCoord, NULL);
    564396    PS_ASSERT_PTR_NON_NULL(chip, NULL);
    565  
     397
    566398    return (psPlaneTransformApply(outCoord, chip->toFPA, inCoord));
    567399}
    568 */
    569 /*
     400
     401
     402
    570403psPlane* psCoordFPAToTP(psPlane* outCoord,
    571404                        const psPlane* inCoord,
    572405                        double color,
    573406                        double magnitude,
    574                         const psFPA* fpa)
     407                        const pmFPA* fpa)
    575408{
    576409    PS_ASSERT_PTR_NON_NULL(inCoord, NULL);
    577410    PS_ASSERT_PTR_NON_NULL(fpa, NULL);
    578  
     411
    579412    return(psPlaneDistortApply(outCoord, fpa->toTangentPlane, inCoord,
    580413                               color, magnitude));
    581414}
    582 */
     415
    583416/*****************************************************************************
    584417XXX: What about units for the (x,y) coords?
    585418 *****************************************************************************/
    586 /*
    587419psSphere* psCoordTPToSky(psSphere* outSphere,
    588420                         const psPlane* tpCoord,
    589                          const psGrommit* grommit)
     421                         const psProjection *projection
     422                        )
    590423{
    591424    PS_ASSERT_PTR_NON_NULL(tpCoord, NULL);
    592     PS_ASSERT_PTR_NON_NULL(grommit, NULL);
    593  
     425
    594426    if (outSphere == NULL) {
    595427        outSphere = (psSphere* ) psAlloc(sizeof(psSphere));
    596428    }
    597  
     429
    598430    // XXX: this was done by a SLALIB call -- needs to be reimplemented
    599431    psWarning("Warning!  psCoordTPToSky functionality is no longer implemented");
    600432    // slaAopqk(tpCoord->x, tpCoord->y, (double*)grommit,
    601433    //         &AOB, &ZOB, &HOB, &outSphere->r, &outSphere->d);
    602  
     434
    603435    return (outSphere);
    604436}
    605 */
    606 /*
     437
     438
     439
    607440psPlane* psCoordCellToFPA(psPlane* fpaCoord,
    608441                          const psPlane* cellCoord,
    609                           const psCell* cell)
     442                          const pmCell* cell)
    610443{
    611444    PS_ASSERT_PTR_NON_NULL(cellCoord, NULL);
    612445    PS_ASSERT_PTR_NON_NULL(cell, NULL);
    613  
     446
    614447    return (psPlaneTransformApply(fpaCoord, cell->toFPA, cellCoord));
    615448}
    616 */
    617 /*
     449
     450
     451
    618452psSphere* psCoordCellToSky(psSphere* skyCoord,
    619453                           const psPlane* cellCoord,
    620454                           double color,
    621455                           double magnitude,
    622                            const psCell* cell)
     456                           const pmCell* cell)
    623457{
    624458    PS_ASSERT_PTR_NON_NULL(cellCoord, NULL);
     
    628462    PS_ASSERT_PTR_NON_NULL(cell->parent->parent, NULL);
    629463    PS_ASSERT_PTR_NON_NULL(cell->parent->parent->toTangentPlane, NULL);
    630     PS_ASSERT_PTR_NON_NULL(cell->parent->parent->exposure, NULL);
    631  
     464    //    PS_ASSERT_PTR_NON_NULL(cell->parent->parent->exposure, NULL);
     465
    632466    psPlane* fpaCoord = NULL;
    633467    psPlane* tpCoord = NULL;
    634     psFPA* parFPA = (cell->parent)->parent;
    635     psGrommit* tmpGrommit = NULL;
    636  
     468    pmFPA* parFPA = (cell->parent)->parent;
     469    //    psGrommit* tmpGrommit = NULL;
     470
    637471    // Convert the input cell coordinates to FPA coordinates.
    638472    fpaCoord = psPlaneTransformApply(fpaCoord, cell->toFPA, cellCoord);
    639  
     473
    640474    // Convert the FPA coordinates to tangent plane Coordinates.
    641475    tpCoord = psPlaneDistortApply(tpCoord, parFPA->toTangentPlane,
    642476                                  fpaCoord, color, magnitude);
    643  
     477
    644478    // Generate a grommit for this FPA.
    645     tmpGrommit = psGrommitAlloc(parFPA->exposure);
    646  
     479    //    tmpGrommit = psGrommitAlloc(parFPA->exposure);
     480
    647481    // Convert the tangent plane Coordinates to sky coordinates.
    648     skyCoord = psCoordTPToSky(skyCoord, tpCoord, tmpGrommit);
    649  
     482    //    skyCoord = psCoordTPToSky(skyCoord, tpCoord, tmpGrommit);
     483
    650484    psFree(fpaCoord);
    651485    psFree(tpCoord);
    652     psFree(tmpGrommit);
    653  
     486    //    psFree(tmpGrommit);
     487
    654488    return(skyCoord);
    655489}
    656  
    657 */
    658 /*
     490
     491
    659492psSphere* psCoordCellToSkyQuick(psSphere* outSphere,
    660493                                const psPlane* cellCoord,
    661                                 const psCell* cell)
     494                                const pmCell* cell)
    662495{
    663496    PS_ASSERT_PTR_NON_NULL(cellCoord, NULL);
     
    667500    PS_ASSERT_PTR_NON_NULL(cell->parent->parent, NULL);
    668501    PS_ASSERT_PTR_NON_NULL(cell->parent->parent->projection, NULL);
    669     if (cell->toSky) {
    670         // XXX: Should we use toTP or toSky?
    671         psLogMsg(__func__, PS_LOG_WARN,
    672                  "WARNING: psCoordCellToSkyQuick(): The cell->toSky transform is ignored.  The cell->toTP transform is being used.");
    673     }
    674  
    675     psPlane *tpCoord = NULL;
    676     psChip *chip = cell->parent;
    677     psFPA *FPA = chip->parent;
    678     psProjectionType oldProjectionType;
    679  
    680     if (outSphere == NULL) {
    681         outSphere = (psSphere* ) psAlloc(sizeof(psSphere));
    682     }
    683  
    684     // Determine the tangent plane coordinates.
    685     tpCoord = psPlaneTransformApply(NULL, cell->toTP, cellCoord);
    686  
    687     // Save the old projection type and set the new projection type to TAN.
    688     oldProjectionType = FPA->projection->type;
    689     FPA->projection->type = PS_PROJ_TAN;
    690  
    691     // Deproject the tangent plane coordinates a sphere.
    692     outSphere = psDeproject(tpCoord, FPA->projection);
    693  
    694     // Restore old projection type.  Free memory.
    695     FPA->projection->type = oldProjectionType;
    696     psFree(tpCoord);
    697  
    698     return (outSphere);
    699 }
    700 */
     502
     503    psLogMsg(__func__, PS_LOG_WARN,
     504             "WARNING: psCoordCellToSkyQuick(): This function is not fully specified in the SDRS.  Returning NULL.\n");
     505    return(NULL);
     506
     507    /*
     508        if (cell->toSky) {
     509            // XXX: Should we use toTP or toSky?
     510            psLogMsg(__func__, PS_LOG_WARN,
     511                     "WARNING: psCoordCellToSkyQuick(): The cell->toSky transform is ignored.  The cell->toTP transform is being used.");
     512        }
     513     
     514        psPlane *tpCoord = NULL;
     515        pmChip *chip = cell->parent;
     516        pmFPA *FPA = chip->parent;
     517        psProjectionType oldProjectionType;
     518     
     519        if (outSphere == NULL) {
     520            outSphere = (psSphere* ) psAlloc(sizeof(psSphere));
     521        }
     522     
     523        // Determine the tangent plane coordinates.
     524        tpCoord = psPlaneTransformApply(NULL, cell->toTP, cellCoord);
     525     
     526        // Save the old projection type and set the new projection type to TAN.
     527        oldProjectionType = FPA->projection->type;
     528        FPA->projection->type = PS_PROJ_TAN;
     529     
     530        // Deproject the tangent plane coordinates a sphere.
     531        outSphere = psDeproject(tpCoord, FPA->projection);
     532     
     533        // Restore old projection type.  Free memory.
     534        FPA->projection->type = oldProjectionType;
     535        psFree(tpCoord);
     536     
     537        return (outSphere);
     538    */
     539}
     540
    701541
    702542/*****************************************************************************
    703543XXX: What about units for the (x,y) coords?
    704544 *****************************************************************************/
    705 /*
    706545psPlane* psCoordSkyToTP(psPlane* tpCoord,
    707546                        const psSphere* in,
    708                         const psGrommit* grommit)
     547                        const psProjection *projection)
    709548{
    710549    PS_ASSERT_PTR_NON_NULL(in, NULL);
    711     PS_ASSERT_PTR_NON_NULL(grommit, NULL);
    712  
     550    //    PS_ASSERT_PTR_NON_NULL(grommit, NULL);
     551
    713552    // char* type = "RA";
    714  
     553
    715554    if (tpCoord == NULL) {
    716555        tpCoord = (psPlane* ) psAlloc(sizeof(psPlane));
    717556    }
    718  
     557
    719558    // XXX: this was done by a SLALIB call -- needs to be reimplemented
    720559    psWarning("Warning!  psCoordSkyToTP functionality is no longer implemented");
    721560    // slaOapqk(type, in->r, in->d, (double*)grommit, &tpCoord->x, &tpCoord->y);
    722  
     561
    723562    return(tpCoord);
    724563}
    725 */
    726 /*
     564
     565
    727566psPlane* psCoordTPToFPA(psPlane* fpaCoord,
    728567                        const psPlane* tpCoord,
    729568                        double color,
    730569                        double magnitude,
    731                         const psFPA* fpa)
     570                        const pmFPA* fpa)
    732571{
    733572    PS_ASSERT_PTR_NON_NULL(tpCoord, NULL);
    734573    PS_ASSERT_PTR_NON_NULL(fpa, NULL);
    735574    PS_ASSERT_PTR_NON_NULL(fpa->fromTangentPlane, NULL);
    736  
     575
    737576    return (psPlaneDistortApply(fpaCoord, fpa->fromTangentPlane,
    738577                                tpCoord, color, magnitude));
    739578}
    740 */
    741 /*
     579
     580
    742581psPlane* psCoordFPAToChip(psPlane* chipCoord,
    743582                          const psPlane* fpaCoord,
    744                           const psChip* chip)
     583                          const pmChip* chip)
    745584{
    746585    PS_ASSERT_PTR_NON_NULL(fpaCoord, NULL);
    747586    PS_ASSERT_PTR_NON_NULL(chip, NULL);
    748587    PS_ASSERT_PTR_NON_NULL(chip->fromFPA, NULL);
    749  
     588
    750589    chipCoord = psPlaneTransformApply(chipCoord, chip->fromFPA, fpaCoord);
    751590    return(chipCoord);
    752591}
    753 */
    754 /*
     592
     593
    755594psPlane* psCoordChipToCell(psPlane* cellCoord,
    756595                           const psPlane* chipCoord,
    757                            const psCell* cell)
     596                           const pmCell* cell)
    758597{
    759598    PS_ASSERT_PTR_NON_NULL(chipCoord, NULL);
    760599    PS_ASSERT_PTR_NON_NULL(cell, NULL);
    761     PS_ASSERT_PTR_NON_NULL(cell->fromChip, NULL);
    762  
    763     cellCoord = psPlaneTransformApply(cellCoord, cell->fromChip, chipCoord);
     600    PS_ASSERT_PTR_NON_NULL(cell->parent, NULL);
     601
     602    pmCell *tmpCell = pmCellInChip(chipCoord, cell->parent);
     603    PS_ASSERT_PTR_NON_NULL(tmpCell->toChip, NULL);
     604    psPlaneTransform *tmpChipToCell = p_psPlaneTransformLinearInvert(tmpCell->toChip);
     605    PS_ASSERT_PTR_NON_NULL(tmpChipToCell, NULL);
     606    cellCoord = psPlaneTransformApply(cellCoord, tmpChipToCell, chipCoord);
     607    psFree(tmpChipToCell);
    764608    return(cellCoord);
    765609}
    766 */
    767 /*
     610
     611
    768612psPlane* psCoordSkyToCell(psPlane* cellCoord,
    769613                          const psSphere* skyCoord,
    770                           double color,
    771                           double magnitude,
    772                           const psCell* cell)
     614                          float color,
     615                          float magnitude,
     616                          const pmCell* cell)
    773617{
    774618    PS_ASSERT_PTR_NON_NULL(skyCoord, NULL);
     
    776620    PS_ASSERT_PTR_NON_NULL(cell->parent, NULL);
    777621    PS_ASSERT_PTR_NON_NULL(cell->parent->parent, NULL);
    778     PS_ASSERT_PTR_NON_NULL(cell->parent->parent->grommit, NULL);
    779  
    780     psChip *parChip = cell->parent;
    781     psFPA *parFPA = parChip->parent;
    782     psGrommit* grommit = parFPA->grommit;
    783  
     622    //    PS_ASSERT_PTR_NON_NULL(cell->parent->parent->grommit, NULL);
     623
     624    pmChip *parChip = cell->parent;
     625    pmFPA *parFPA = parChip->parent;
     626
    784627    // Convert the skyCoords to tangent plane coords.
    785     psPlane *tpCoord = psCoordSkyToTP(tpCoord, skyCoord, grommit);
    786  
     628    psPlane *tpCoord = psCoordSkyToTP(NULL, skyCoord, parFPA->projection);
     629
    787630    // Convert the tangent plane coords to FPA coords.
    788     psPlane *fpaCoord = psCoordTPToFPA(fpaCoord, tpCoord, color,
    789                                        magnitude, parFPA);
    790  
     631    psPlane *fpaCoord = psCoordTPToFPA(NULL, tpCoord, color, magnitude, parFPA);
     632
    791633    // Convert the FPA coords to chip coords.
    792     psPlane *chipCoord = psCoordFPAToChip(chipCoord, fpaCoord, parChip);
    793  
     634    psPlane *chipCoord = psCoordFPAToChip(NULL, fpaCoord, parChip);
     635
    794636    // Convert the chip coords to cell coords.
    795637    cellCoord = psCoordChipToCell(cellCoord, chipCoord, cell);
    796  
     638
    797639    psFree(tpCoord);
    798640    psFree(fpaCoord);
    799641    psFree(chipCoord);
    800  
     642
    801643    return (cellCoord);
    802644}
    803 */
    804 /*
     645
     646
    805647psPlane* psCoordSkyToCellQuick(psPlane* cellCoord,
    806648                               const psSphere* skyCoord,
    807                                const psCell* cell)
     649                               const pmCell* cell)
    808650{
    809651    PS_ASSERT_PTR_NON_NULL(skyCoord, NULL);
     
    812654    PS_ASSERT_PTR_NON_NULL(cell->parent->parent, NULL);
    813655    PS_ASSERT_PTR_NON_NULL(cell->parent->parent->projection, NULL);
    814     PS_ASSERT_PTR_NON_NULL(cell->toTP, NULL);
    815     if (cell->toSky) {
    816         // XXX: Should we use toTP or toSky?
    817         psLogMsg(__func__, PS_LOG_WARN,
    818                  "WARNING: psCoordSkyToCellQuick(): The cell->toSky transform is ignored.  The cell->toTP transform is being used.");
    819     }
    820  
    821     psPlane *tpCoord = NULL;
    822     psChip *whichChip = cell->parent;
    823     psFPA *whichFPA = whichChip->parent;
    824     psProjectionType oldProjectionType;
    825     psPlaneTransform *TPtoCell = NULL;
    826  
    827     // Save the old projection type and set the new projection type to TAN.
    828     oldProjectionType = whichFPA->projection->type;
    829     whichFPA->projection->type = PS_PROJ_TAN;
    830  
    831     if (cellCoord == NULL) {
    832         cellCoord = (psPlane* ) psAlloc(sizeof(psPlane));
    833     }
    834  
    835     tpCoord = psProject(skyCoord, whichFPA->projection);
    836  
    837     // generate an error if cell->toTP is not linear.
    838     if (0 == p_psIsProjectionLinear(cell->toTP)) {
    839         psError(PS_ERR_BAD_PARAMETER_TYPE, true,
    840                 PS_ERRORTEXT_psAstrometry_NONLINEAR_TRANSFORM,
    841                 "cell to tangent plane");
    842     }
    843  
    844     TPtoCell = p_psPlaneTransformLinearInvert(cell->toTP);
    845     cellCoord = psPlaneTransformApply(cellCoord, TPtoCell, tpCoord);
    846  
    847     // Restore old projection type.  Free memory.
    848     whichFPA->projection->type = oldProjectionType;
    849     psFree(tpCoord);
    850     return (cellCoord);
    851 }
    852 */
    853 
    854 
     656
     657
     658    psLogMsg(__func__, PS_LOG_WARN,
     659             "WARNING: psCoordSkyToCellQuick(): This function is not fully specified in the SDRS.  Returning NULL.\n");
     660    return(NULL);
     661    /*
     662     
     663        if (cell->toSky) {
     664            // XXX: Should we use toTP or toSky?
     665            psLogMsg(__func__, PS_LOG_WARN,
     666                     "WARNING: psCoordSkyToCellQuick: The cell->toSky transform is ignored.  The cell->toTP transform is being used.");
     667        }
     668     
     669        psPlane *tpCoord = NULL;
     670        pmChip *whichChip = cell->parent;
     671        pmFPA  *whichFPA = whichChip->parent;
     672        psProjectionType oldProjectionType;
     673        psPlaneTransform *TPtoCell = NULL;
     674     
     675        // Save the old projection type and set the new projection type to TAN.
     676        oldProjectionType = whichFPA->projection->type;
     677        whichFPA->projection->type = PS_PROJ_TAN;
     678     
     679        if (cellCoord == NULL) {
     680            cellCoord = (psPlane* ) psAlloc(sizeof(psPlane));
     681        }
     682     
     683        tpCoord = psProject(skyCoord, whichFPA->projection);
     684     
     685        // generate an error if cell->toTP is not linear.
     686        if (0 == p_psIsProjectionLinear(cell->toTP)) {
     687            psError(PS_ERR_BAD_PARAMETER_TYPE, true,
     688                    PS_ERRORTEXT_psAstrometry_NONLINEAR_TRANSFORM,
     689                    "cell to tangent plane");
     690        }
     691     
     692        TPtoCell = p_psPlaneTransformLinearInvert(cell->toTP);
     693        cellCoord = psPlaneTransformApply(cellCoord, TPtoCell, tpCoord);
     694     
     695        // Restore old projection type.  Free memory.
     696        whichFPA->projection->type = oldProjectionType;
     697        psFree(tpCoord);
     698        return (cellCoord);
     699    */
     700}
     701
     702
     703
  • trunk/psModules/src/pmAstrometry.h

    r4754 r4770  
    88*  @author GLG, MHPCC
    99*
    10 *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2005-08-11 00:03:51 $
     10*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2005-08-16 01:10:34 $
    1212*
    1313*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    143143    // Information
    144144    psImage *image;                     ///< Imaging area of readout
     145    // XXX: The following mask was removed from the pmReadout struct in recent SDRS
     146    // versions.  However, I'm keeping it here since al ot of modules still require
     147    // it.
     148    psImage *mask;                      ///< Mask of input image
    145149    psMetadata *analysis;               ///< Readout-level analysis metadata
    146150    psMetadata *concepts;               ///< Cache for PS Concepts
    147151    pmCell *parent;                     ///< Parent cell
    148152}
    149 psReadout;
    150 
    151 /** Allocates a psReadout
     153pmReadout;
     154
     155
     156/** Allocates a pmReadout
    152157 *
    153158 *  The constructor shall make an empty pmReadout. If the parent cell is not
     
    156161 *  other pointers in the structure shall be initialized to NULL.
    157162 *
    158  *  @return psReadout*    newly allocated psReadout with all internal pointers set to NULL
    159  */
    160 psReadout *pmReadoutAlloc(
     163 *  @return pmReadout*    newly allocated pmReadout with all internal pointers set to NULL
     164 */
     165pmReadout *pmReadoutAlloc(
    161166    pmCell *cell                        ///< Parent cell
    162167);
    163168
    164 /** Allocates a psCell
     169/** Allocates a pmCell
    165170 *
    166171 *  The constructor shall make an empty pmCell. If the parent chip is not NULL,
    167  *  the parent link is made and the cell shall be placed in the parentThe
    168  *  constructor shall make an empty psCell.s array of cells. The readouts
    169  *  array shall be allocated with a zero size, and the metadata containers
    170  *  constructed. All other pointers in the structure shall be initialized to
    171  *  NULL.
    172  *
    173  *  @return psCell*    newly allocated psCell
     172 *  the parent link is made and the cell shall be placed in the parents array of
     173 *  cells. The readouts array shall be allocated with a zero size, and the
     174 *  metadata containers constructed. All other pointers in the structure shall be
     175 *  initialized to NULL.
     176 *
     177 *  @return pmCell*    newly allocated pmCell
    174178 */
    175179pmCell *pmCellAlloc(
     
    198202 */
    199203pmFPA *pmFPAAlloc(
    200     const psMetadata *camera           ///< Camera configuration
    201     //    psDB *db                            ///< Database handle
    202 );
    203 
     204    const psMetadata *camera,           ///< Camera configuration
     205    psDB *db                            ///< Database handle
     206);
     207
     208
     209/** Verify parent links.
     210 *
     211 *  This function checks the validity of the parent links in the FPA hierarchy.
     212 *  If a parent link is not set (or not set correctly), it is corrected, and the
     213 *  function shall return false. If all the parent pointers were correct, the
     214 *  function shall return true.
     215 *
     216 */
     217bool pmFPACheckParents(
     218    pmFPA *fpa
     219);
     220
     221
     222
     223/** FUNC DESC
     224 *
     225 *
     226 *
     227 *
     228 */
    204229
    205230
     
    211236
    212237
    213 
    214 
    215 
    216 
    217 
    218 /** Wallace's Grommit
    219  *
    220  *  SLALib requires several elements to perform the transformations between
    221  *  the tangent plane and the sky.  Pre-computing these quantities for each
    222  *  exposure means that subsequent transformations are faster.  For historical
    223  *  reasons, this structure is known colloquially as "Wallace's Grommit".
    224  *
    225  */
    226 
    227 /*
    228 typedef struct
    229 {
    230    const double latitude;           ///< geodetic latitude (radians)
    231    const double longitude;          ///< longitude + ... (radians)
    232    const double height;             ///< height (HM)
    233    const double abberationMag;      ///< magnitude of diurnal aberration vector
    234    const double temperature;        ///< ambient temperature (TDK)
    235    const double pressure;           ///< pressure (PMB)
    236    const double humidity;           ///< relative humidity (RH)
    237    const double wavelength;         ///< wavelength (WL)
    238    const double lapseRate;          ///< lapse rate (TLR)
    239    const double refractA, refractB; ///< refraction constants A and B (radians)
    240    const double siderealTime;       ///< local apparent sidereal time (radians)
    241 }
    242 psGrommit;
    243 */
    244 
    245 
    246 /** Fixed Pattern Corrections
    247  *
    248  *  The fixed pattern is a correction to the general astrometric solution
    249  *  formed by summing the residuals from many observations. The intent is to
    250  *  correct for higher-order distortions in the camera system on a coarse
    251  *  grid (larger than individual pixels, but smaller than a single cell).
    252  *  Hence, in addition to the offsets, we need to specify the size and scale
    253  *  of the grid in x and y as well as the origin of the grid.
    254  */
    255 /*
    256 typedef struct
    257 {
    258     psS32 nX;                            ///< Number of elements in x direction
    259     psS32 nY;                            ///< Number of elements in y direction
    260     double x0;                         ///< X Position of 0,0 corner on focal plane
    261     double y0;                         ///< Y Position of 0,0 corner on focal plane
    262     double xScale;                     ///< Scale of the grid in x direction
    263     double yScale;                     ///< Scale of the grid in x direction
    264     /// XXX: I added the following memvers to facilitate the psFreeing of the x,y data structures.
    265     psS32 p_ps_xRows;                    ///< Number of rows in the x member
    266     psS32 p_ps_xCols;                    ///< Number of cols in the x member
    267     psS32 p_ps_yRows;                    ///< Number of rows in the y member
    268     psS32 p_ps_yCols;                    ///< Number of cols in the y member
    269     double **x;                        ///< The grid of offsets in x
    270     double **y;                        ///< The grid of offsets in y
    271 }
    272 psFixedPattern;
    273 */
    274 
    275 
    276 /** Observatory Information
    277  *
    278  *  A container for the observatory data that doesn't change per exposure.
    279  *
    280  */
    281 /*typedef struct
    282 {
    283     const char* name;                  ///< Name of observatory
    284     const double latitude;             ///< Latitude of observatory, east positive (degrees?)
    285     const double longitude;            ///< Longitude of observatory (degrees?)
    286     const double height;               ///< Height of observatory in meters
    287     const double tlr;                  ///< Tropospheric Lapse Rate
    288 }
    289 psObservatory;
    290 */
    291 
    292 /** Exposure Information
    293  *
    294  *  Several quantities from the telescope in order to make a first guess at
    295  *  the astrometric solution.  From these quantities, further quantities can
    296  *  be derivedand stored for later use.
    297  *
    298  */
    299 /*typedef struct psExposure
    300 {
    301     const double ra;                   ///< Telescope boresight, right ascention
    302     const double dec;                  ///< Telescope boresight, declination
    303     const double hourAngle;            ///< Hour angle
    304     const double zenithDistance;       ///< Zenith distance
    305     const double azimuth;              ///< Azimuth
    306     const psTime* time;                ///< Time of observation
    307     const float rotAngle;              ///< Rotator position angle in degrees? XXX: see bug#209
    308     const float temperature;           ///< Air temperature in Kelvin
    309     const float pressure;              ///< Air pressure in mB
    310     const float humidity;              ///< Relative humidity, for refraction
    311     const float exposureTime;          ///< Exposure time
    312     const float wavelength;            ///< Wavelength in microns
    313     const psObservatory* observatory;  ///< Observatory data
    314  
    315     // Derived quantities
    316     const double lst;                  ///< Local Sidereal Time
    317     const float positionAngle;         ///< Position angle
    318     const float parallacticAngle;      ///< Parallactic angle
    319     const float airmass;               ///< Airmass, calculated from zenith distance
    320     const float parallacticFactor;     ///< Parallactic factor
    321     const char* cameraName;            ///< name of camera which provided exposure
    322     const char* telescopeName;         ///< name of telescope which provided exposure
    323 }
    324 psExposure;
    325 */
    326 
    327 /** Allocator for psFixedPattern struct
    328  *
    329  *  Allocates a new psFixedPattern struct with the attributes coorsponding
    330  *  to the parameters set to the said input values.
    331  *
    332  *  @return psFixedPattern*     New psFixedPattern struct.
    333  */
    334 /*psFixedPattern* psFixedPatternAlloc(
    335     double x0,           ///< X Position of 0,0 corner on focal plane
    336     double y0,           ///< Y Position of 0,0 corner on focal plane
    337     double xScale,       ///< Scale of the grid in x direction
    338     double yScale,       ///< Scale of the grid in x direction
    339     const psImage *x,    ///< The grid of offsets in x
    340     const psImage *y     ///< The grid of offsets in y
    341 );
    342 */
    343 
    344 /** Allocator for psExposure
    345  *
    346  *  We need several quantities from the telescope in order to make a first
    347  *  guess at the astrometric solution. From these quantities, further
    348  *  quantities can be derived and stored for later use.
    349  *
    350  *  @return     psExposure*    New psExposure struct
    351  */
    352 /*psExposure* psExposureAlloc(
    353     double ra,                         ///< Telescope boresight, right ascention
    354     double dec,                        ///< Telescope boresight, declination
    355     double hourAngle,                  ///< Hour angle
    356     double zenithDistance,             ///< Zenith distance
    357     double azimuth,                    ///< Azimuth
    358     const psTime* time,                ///< time of observation
    359     float rotAngle,                    ///< Rotator position angle
    360     float temperature,                 ///< Temperature
    361     float pressure,                    ///< Pressure
    362     float humidity,                    ///< Relative humidity
    363     float exposureTime,                ///< Exposure time
    364     float wavelength,                  ///< wavelength
    365     const psObservatory* observatory   ///< Observatory data
    366 );
    367 */
    368 
    369 /** Allocator for psObservatory
    370  *
    371  *  This function shall construct a new psObservatory with attributes
    372  *  cooresponding to the function parameters.
    373  *
    374  *  @return psObservatory*    new psObservatory struct
    375  */
    376 /*psObservatory* psObservatoryAlloc(
    377     const char* name,                  ///< Name of observatory
    378     double latitude,                   ///< Latitude of observatory, east positive
    379     double longitude,                  ///< Longitude of observatory
    380     double height,                     ///< Height of observatory
    381     double tlr                         ///< Tropospheric Lapse Rate
    382 );
    383 */
    384 
    385 /** Allocates a Wallace's Grommit structure.
    386  *
    387  *  The psGrommit is calculated from telescope information for the particular
    388  *  exposure.
    389  *
    390  *  @return psGrommit* New grommit structure.
    391  */
    392 /*psGrommit* psGrommitAlloc(
    393     const psExposure* exp              ///< the cooresponding exposure structure.
    394 );
    395 */
    396 
    397238/** Find cooresponding cell for given FPA coordinate
    398239 *
    399  *  @return psCell*    the cell cooresponding to the coord in FPA
    400  */
    401 /*psCell* psCellInFPA(
     240 *  @return pmCell*    the cell cooresponding to the coord in FPA
     241 */
     242pmCell* pmCellInFPA(
    402243    const psPlane* coord,              ///< the coordinate in FPA plane
    403     const psFPA* FPA                   ///< the FPA to search for the cell
    404 );
    405 */
     244    const pmFPA* FPA                   ///< the FPA to search for the cell
     245);
     246
    406247
    407248/** Find cooresponding chip for given FPA coordinate
    408249 *
    409  *  @return psChip*    the chip cooresponding to coord
    410  */
    411 /*psChip* psChipInFPA(
     250 *  @return pmChip*    the chip cooresponding to coord
     251 */
     252pmChip* pmChipInFPA(
    412253    const psPlane* coord,              ///< the coordinate in FPA plane
    413     const psFPA* FPA                   ///< the FPA to search for the cell
    414 );
    415 */
     254    const pmFPA* FPA                   ///< the FPA to search for the cell
     255);
     256
    416257
    417258/** Find cooresponding cell for given Chip coordinate
    418259 *
    419  *  @return psCell*    the cell cooresponding to coord
    420  */
    421 /*psCell* psCellInChip(
     260 *  @return pmCell*    the cell cooresponding to coord
     261 */
     262pmCell* pmCellInChip(
    422263    const psPlane* coord,              ///< the coordinate in Chip plane
    423     const psChip* chip                 ///< the chip to search for the cell
    424 );
    425 */
     264    const pmChip* chip                 ///< the chip to search for the cell
     265);
     266
    426267
    427268/** Translate a cell coordinate into a chip coordinate
     
    429270 *  @return psPlane*    the resulting chip coordinate
    430271 */
    431 /*psPlane* psCoordCellToChip(
     272psPlane* psCoordCellToChip(
    432273    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    433274    const psPlane* in,                 ///< the coordinate within Cell
    434     const psCell* cell                 ///< the Cell in interest
    435 );
    436 */
     275    const pmCell* cell                 ///< the Cell in interest
     276);
     277
    437278
    438279/** Translate a chip coordinate into a FPA coordinate
     
    440281 *  @return psPlane*    the resulting FPA coordinate
    441282 */
    442 /*psPlane* psCoordChipToFPA(
     283psPlane* psCoordChipToFPA(
    443284    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    444285    const psPlane* in,                 ///< the coordinate within Chip
    445     const psChip* chip                 ///< the chip in interest
    446 );
    447 */
     286    const pmChip* chip                 ///< the chip in interest
     287);
     288
    448289
    449290/** Translate a FPA coordinate into a Tangent Plane coordinate
     
    451292 *  @return psPlane*    the resulting Tangent Plane coordinate
    452293 */
    453 /*psPlane* psCoordFPAToTP(
     294psPlane* psCoordFPAToTP(
    454295    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    455296    const psPlane* in,                 ///< the coordinate within FPA
    456297    double color,                      ///< Color of source
    457298    double magnitude,                  ///< Magnitude of source
    458     const psFPA* fpa                   ///< the FPA in interest
    459 );
    460 */
     299    const pmFPA* fpa                   ///< the FPA in interest
     300);
     301
    461302
    462303/** Translate a Tangent Plane coordinate into a Sky coordinate
     
    464305 *  @return psSphere*    the resulting Sky coordinate
    465306 */
    466 /*psSphere* psCoordTPToSky(
     307psSphere* psCoordTPToSky(
    467308    psSphere* out,                     ///< a sphere struct to recycle. If NULL, a new struct is created
    468     const psPlane* in,                 ///< the coordinate within Tangent Plane
    469     const psGrommit* grommit           ///< the grommit of the tangent plane
    470 );
    471 */
     309    const psPlane* in,                ///< the coordinate within Tangent Plane
     310    const psProjection *projection
     311);
    472312
    473313/** Translate a cell coordinate into a FPA coordinate
     
    475315 *  @return psPlane*    the resulting FPA coordinate
    476316 */
    477 /*psPlane* psCoordCellToFPA(
     317psPlane* psCoordCellToFPA(
    478318    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    479319    const psPlane* in,                 ///< the coordinate within cell
    480     const psCell* cell                 ///< the cell in interest
    481 );
    482 */
     320    const pmCell* cell                 ///< the cell in interest
     321);
     322
    483323
    484324/** Translate a cell coordinate into a Sky coordinate
     
    486326 *  @return psSphere*    the resulting Sky coordinate
    487327 */
    488 /*psSphere* psCoordCellToSky(
     328psSphere* psCoordCellToSky(
    489329    psSphere* out,                     ///< a sphere struct to recycle. If NULL, a new struct is created
    490330    const psPlane* in,                 ///< the coordinate within cell
    491331    double color,                      ///< Color of source
    492332    double magnitude,                  ///< Magnitude of source
    493     const psCell* cell                 ///< the cell in interest
    494 );
    495 */
     333    const pmCell* cell                 ///< the cell in interest
     334);
     335
    496336
    497337/** Translate a cell coordinate into a Sky coordinate using a 'quick and
     
    500340 *  @return psSphere*    the resulting Sky coordinate
    501341 */
    502 /*psSphere* psCoordCellToSkyQuick(
     342psSphere* psCoordCellToSkyQuick(
    503343    psSphere* out,                     ///< a sphere struct to recycle. If NULL, a new struct is created
    504344    const psPlane* in,                 ///< the coordinate within cell
    505     const psCell* cell                 ///< the cell in interest
    506 );
    507 */
     345    const pmCell* cell                 ///< the cell in interest
     346);
     347
    508348
    509349/** Translate a Sky coordinate into a Tangent Plane coordinate
     
    511351 *  @return psPlane*    the resulting Tangent Plane coordinate
    512352 */
    513 /*psPlane* psCoordSkyToTP(
     353psPlane* psCoordSkyToTP(
    514354    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    515355    const psSphere* in,                ///< the sky coordinate
    516     const psGrommit* grommit           ///< the grommit
    517 );
    518 */
     356    const psProjection *projection
     357);
    519358
    520359/** Translate a Tangent Plane coordinate into a FPA coordinate
     
    522361 *  @return psPlane*    the resulting FPA coordinate
    523362 */
    524 /*psPlane* psCoordTPToFPA(
     363psPlane* psCoordTPToFPA(
    525364    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    526365    const psPlane* in,                 ///< the coordinate within tangent plane
    527366    double color,                      ///< Color of source
    528367    double magnitude,                  ///< Magnitude of source
    529     const psFPA* fpa                   ///< the FPA of interest
    530 );
    531 */
     368    const pmFPA* fpa                   ///< the FPA of interest
     369);
     370
    532371
    533372/** Translate a FPA coordinate into a chip coordinate
     
    535374 *  @return psPlane*    the resulting chip coordinate
    536375 */
    537 /*psPlane* psCoordFPAToChip(
     376psPlane* psCoordFPAToChip(
    538377    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    539378    const psPlane* in,                 ///< the FPA coordinate
    540     const psChip* chip                 ///< the chip of interest
    541 );
    542 */
     379    const pmChip* chip                 ///< the chip of interest
     380);
     381
    543382
    544383/** Translate a chip coordinate into a cell coordinate
     
    546385 *  @return psPlane*    the resulting cell coordinate
    547386 */
    548 /*psPlane* psCoordChipToCell(
     387psPlane* psCoordChipToCell(
    549388    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    550389    const psPlane* in,                 ///< the Chip coordinate
    551     const psCell* cell                 ///< the cell of interest
    552 );
    553 */
     390    const pmCell* cell                 ///< the cell of interest
     391);
     392
    554393
    555394/** Translate a sky coordinate into a cell coordinate
     
    557396 *  @return psPlane*    the resulting cell coordinate
    558397 */
    559 /*psPlane* psCoordSkyToCell(
     398psPlane* psCoordSkyToCell(
    560399    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    561400    const psSphere* in,                ///< the Sky coordinate
    562     double color,                      ///< Color of source
    563     double magnitude,                  ///< Magnitude of source
    564     const psCell* cell                 ///< the cell of interest
    565 );
    566 */
     401    float color,                       ///< Color of source
     402    float magnitude,                   ///< Magnitude of source
     403    const pmCell* cell                 ///< the cell of interest
     404);
     405
    567406
    568407/** Translate a sky coordinate into a cell coordinate using a 'quick and
     
    571410 *  @return psPlane*    the resulting cell coordinate
    572411 */
    573 /*psPlane* psCoordSkyToCellQuick(
     412psPlane* psCoordSkyToCellQuick(
    574413    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    575414    const psSphere* in,                ///< the Sky coordinate
    576     const psCell* cell                 ///< the cell of interest
    577 );
    578 */
     415    const pmCell* cell                 ///< the cell of interest
     416);
     417
    579418
    580419#endif // #ifndef PS_ASTROMETRY_H
  • trunk/psModules/src/pmFlatField.c

    r2299 r4770  
    1818 *  @author Ross Harman, MHPCC
    1919 *
    20  *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
    21  *  @date $Date: 2004-11-06 02:42:03 $
     20 *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
     21 *  @date $Date: 2005-08-16 01:10:34 $
    2222 *
    2323 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3838
    3939
    40 bool pmFlatField(psReadout *in, const psReadout *flat)
     40bool pmFlatField(pmReadout *in, pmReadout *mask, const pmReadout *flat)
    4141{
     42    // XXX: Not sure if this is correct.  Must consult with IfA.
     43    PS_ASSERT_PTR_NON_NULL(mask, false);
    4244    int i = 0;
    4345    int j = 0;
     
    7173                 PS_ERRORTEXT_pmFlatField_NULL_FLAT_IMAGE);
    7274        return false;
    73     } else if(in->mask == NULL) {
    74         in->mask = psImageAlloc(inImage->numCols, inImage->numRows, PS_TYPE_MASK);
    75         memset(in->mask->data.V[0], 0, inImage->numCols*inImage->numRows*PSELEMTYPE_SIZEOF(PS_TYPE_MASK));
    7675    }
    77     inMask = in->mask;
     76    inMask = mask->image;
    7877
    7978    // Check input image and its mask are not larger than flat image
     79
    8080    if(inImage->numRows>flatImage->numRows || inImage->numCols>flatImage->numCols) {
    8181        psError( PS_ERR_BAD_PARAMETER_SIZE, true,
  • trunk/psModules/src/pmFlatField.h

    r4754 r4770  
    1818 *  @author Ross Harman, MHPCC
    1919 *
    20  *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    21  *  @date $Date: 2005-08-11 00:03:51 $
     20 *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     21 *  @date $Date: 2005-08-16 01:10:34 $
    2222 *
    2323 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3636 */
    3737bool pmFlatField(
    38     psReadout *in,          ///< Redout with input image and mask
    39     const psReadout *flat   ///< Readout with flat image
     38    pmReadout *in,          ///< Readout with input image
     39    pmReadout *mask,        ///< Input image mask
     40    const pmReadout *flat   ///< Readout with flat image
    4041);
    4142
  • trunk/psModules/src/pmMaskBadPixels.c

    r2275 r4770  
    1919 *  @author Ross Harman, MHPCC
    2020 *
    21  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    22  *  @date $Date: 2004-11-04 02:02:10 $
     21 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     22 *  @date $Date: 2005-08-16 01:10:34 $
    2323 *
    2424 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3636#include "pmMaskBadPixelsErrors.h"
    3737
    38 bool pmMaskBadPixels(psReadout *in, const psImage *mask, unsigned int maskVal, float sat,
     38bool pmMaskBadPixels(pmReadout *in, const psImage *mask, unsigned int maskVal, float sat,
    3939                     unsigned int growVal, int grow)
    4040{
  • trunk/psModules/src/pmMaskBadPixels.h

    r4754 r4770  
    1919 *  @author Ross Harman, MHPCC
    2020 *
    21  *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    22  *  @date $Date: 2005-08-11 00:03:51 $
     21 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     22 *  @date $Date: 2005-08-16 01:10:34 $
    2323 *
    2424 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5252 */
    5353bool pmMaskBadPixels(
    54     psReadout *in,          ///< Readout containing input image data.
     54    pmReadout *in,          ///< Readout containing input image data.
    5555    const psImage *mask,    ///< Mask data to be added to readout mask data.
    5656    unsigned int maskVal,   ///< Mask value to determine what to add to input mask.
  • trunk/psModules/src/pmNonLinear.c

    r4030 r4770  
    55 *  @author GLG, MHPCC
    66 *
    7  *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2005-05-25 20:28:32 $
     7 *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2005-08-16 01:10:34 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2424
    2525/******************************************************************************
    26 pmNonLinearityLookup(): This routine will take an psReadout image as input
     26pmNonLinearityLookup(): This routine will take an pmReadout image as input
    2727and a 1-D polynomial.  For each pixel in the input image, the polynomial will
    2828be evaluated at that pixels value, and the image pixel will then be set to
     
    3030 *****************************************************************************/
    3131
    32 psReadout *pmNonLinearityPolynomial(psReadout *inputReadout,
     32pmReadout *pmNonLinearityPolynomial(pmReadout *inputReadout,
    3333                                    const psPolynomial1D *input1DPoly)
    3434{
     
    5151
    5252/******************************************************************************
    53 pmNonLinearityLookup(): This routine will take an psReadout image as input
     53pmNonLinearityLookup(): This routine will take an pmReadout image as input
    5454and two input vectors, which constitute a lookup table.  For each pixel in
    5555the input image, that pixels value will be determined in the input vector
     
    5757be set to the value from outFlux.
    5858 *****************************************************************************/
    59 psReadout *pmNonLinearityLookup(psReadout *inputReadout,
     59pmReadout *pmNonLinearityLookup(pmReadout *inputReadout,
    6060                                const psVector *inFlux,
    6161                                const psVector *outFlux)
  • trunk/psModules/src/pmNonLinear.h

    r4754 r4770  
    55 *  @author GLG, MHPCC
    66 *
    7  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2005-08-11 00:03:51 $
     7 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2005-08-16 01:10:34 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1818#include "pmAstrometry.h"
    1919
    20 psReadout *pmNonLinearityPolynomial(psReadout *in,
     20pmReadout *pmNonLinearityPolynomial(pmReadout *in,
    2121                                    const psPolynomial1D *coeff);
    2222
    23 psReadout *pmNonLinearityLookup(psReadout *in,
     23pmReadout *pmNonLinearityLookup(pmReadout *in,
    2424                                const psVector *inFlux,
    2525                                const psVector *outFlux);
  • trunk/psModules/src/pmObjects.c

    r4579 r4770  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-07-19 01:44:48 $
     8 *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-08-16 01:10:34 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2020
    2121/******************************************************************************
    22 pmPeakAlloc(): Allocate the psPeak data structure and set appropriate members.
    23 *****************************************************************************/
    24 psPeak *pmPeakAlloc(psS32 x,
     22pmPeakAlloc(): Allocate the pmPeak data structure and set appropriate members.
     23*****************************************************************************/
     24pmPeak *pmPeakAlloc(psS32 x,
    2525                    psS32 y,
    2626                    psF32 counts,
    27                     psPeakType class)
    28 {
    29     psPeak *tmp = (psPeak *) psAlloc(sizeof(psPeak));
     27                    pmPeakType class)
     28{
     29    pmPeak *tmp = (pmPeak *) psAlloc(sizeof(pmPeak));
    3030    tmp->x = x;
    3131    tmp->y = y;
     
    3737
    3838/******************************************************************************
    39 pmMomentsAlloc(): Allocate the psMoments structure and initialize the members
     39pmMomentsAlloc(): Allocate the pmMoments structure and initialize the members
    4040to zero.
    4141*****************************************************************************/
    42 psMoments *pmMomentsAlloc()
    43 {
    44     psMoments *tmp = (psMoments *) psAlloc(sizeof(psMoments));
     42pmMoments *pmMomentsAlloc()
     43{
     44    pmMoments *tmp = (pmMoments *) psAlloc(sizeof(pmMoments));
    4545    tmp->x = 0.0;
    4646    tmp->y = 0.0;
     
    5656}
    5757
    58 static void modelFree(psModel *tmp)
     58static void modelFree(pmModel *tmp)
    5959{
    6060    psFree(tmp->params);
     
    6363
    6464/******************************************************************************
    65 pmModelAlloc(): Allocate the psModel structure, along with its parameters,
     65pmModelAlloc(): Allocate the pmModel structure, along with its parameters,
    6666and initialize the type member.  Initialize the params to 0.0.
    6767XXX EAM: changing params and dparams to psVector
    6868*****************************************************************************/
    69 psModel *pmModelAlloc(psModelType type)
    70 {
    71     psModel *tmp = (psModel *) psAlloc(sizeof(psModel));
     69pmModel *pmModelAlloc(pmModelType type)
     70{
     71    pmModel *tmp = (pmModel *) psAlloc(sizeof(pmModel));
    7272
    7373    tmp->type = type;
     
    9999        break;
    100100    default:
    101         psError(PS_ERR_UNKNOWN, true, "Undefined psModelType");
     101        psError(PS_ERR_UNKNOWN, true, "Undefined pmModelType");
    102102        return(NULL);
    103103    }
     
    116116We might need to increase the reference counter and decrease it here.
    117117*****************************************************************************/
    118 static void sourceFree(psSource *tmp)
     118static void sourceFree(pmSource *tmp)
    119119{
    120120    psFree(tmp->peak);
     
    122122    //    psFree(tmp->mask);
    123123    psFree(tmp->moments);
    124     psFree(tmp->models);
    125 }
    126 
    127 /******************************************************************************
    128 pmSourceAlloc(): Allocate the psSource structure and initialize its members
     124    psFree(tmp->modelPSF);
     125    psFree(tmp->modelFLT);
     126}
     127
     128/******************************************************************************
     129pmSourceAlloc(): Allocate the pmSource structure and initialize its members
    129130to NULL.
    130131*****************************************************************************/
    131 psSource *pmSourceAlloc()
    132 {
    133     psSource *tmp = (psSource *) psAlloc(sizeof(psSource));
     132pmSource *pmSourceAlloc()
     133{
     134    pmSource *tmp = (pmSource *) psAlloc(sizeof(pmSource));
    134135    tmp->peak = NULL;
    135136    tmp->pixels = NULL;
    136137    tmp->mask = NULL;
    137138    tmp->moments = NULL;
    138     tmp->models = NULL;
     139    tmp->modelPSF = NULL;
     140    tmp->modelFLT = NULL;
    139141    tmp->type = 0;
    140142    psMemSetDeallocator(tmp, (psFreeFunc) sourceFree);
     
    272274                              psS32 col,
    273275                              psF32 counts,
    274                               psPeakType type)
    275 {
    276     psPeak *tmpPeak = pmPeakAlloc(col, row, counts, type);
     276                              pmPeakType type)
     277{
     278    pmPeak *tmpPeak = pmPeakAlloc(col, row, counts, type);
    277279
    278280    if (list == NULL) {
     
    379381        // Step through all local peaks in this row.
    380382        for (psU32 i = 0 ; i < row1->n ; i++ ) {
    381             psPeakType myType = PM_PEAK_UNDEF;
     383            pmPeakType myType = PM_PEAK_UNDEF;
    382384            col = row1->data.U32[i];
    383385
     
    527529    //    printf("pmCullPeaks(): list size is %d\n", peaks->size);
    528530    while (tmpListElem != NULL) {
    529         psPeak *tmpPeak = (psPeak *) tmpListElem->data;
     531        pmPeak *tmpPeak = (pmPeak *) tmpListElem->data;
    530532        if ((tmpPeak->counts > maxValue) ||
    531533                ((valid != NULL) &&
     
    553555
    554556    for (int i = 0; i < peaks->n; i++) {
    555         psPeak *tmpPeak = (psPeak *) peaks->data[i];
     557        pmPeak *tmpPeak = (pmPeak *) peaks->data[i];
    556558        if (tmpPeak->counts > maxValue)
    557559            continue;
     
    566568
    567569/******************************************************************************
    568 psSource *pmSourceLocalSky(image, peak, innerRadius, outerRadius): this
    569 routine creates a new psSource data structure and sets the following members:
    570     ->psPeak
    571     ->psMoments->sky
     570pmSource *pmSourceLocalSky(image, peak, innerRadius, outerRadius): this
     571routine creates a new pmSource data structure and sets the following members:
     572    ->pmPeak
     573    ->pmMoments->sky
    572574 
    573575The sky value is set from the pixels in the square annulus surrounding the
     
    590592     or they use the image row/column offsets.
    591593 
    592 XXX: Should we simply set psSource->peak = peak?  If so, should we increase
     594XXX: Should we simply set pmSource->peak = peak?  If so, should we increase
    593595the reference counter?  Or, should we copy the data structure?
    594596 
     
    602604     members.
    603605*****************************************************************************/
    604 psSource *pmSourceLocalSky(const psImage *image,
    605                            const psPeak *peak,
     606pmSource *pmSourceLocalSky(const psImage *image,
     607                           const pmPeak *peak,
    606608                           psStatsOptions statsOptions,
    607609                           psF32 innerRadius,
     
    723725    // Create the output mySource, and set appropriate members.
    724726    //
    725     psSource *mySource = pmSourceAlloc();
    726     mySource->peak = (psPeak *) peak;
     727    pmSource *mySource = pmSourceAlloc();
     728    mySource->peak = (pmPeak *) peak;
    727729    mySource->moments = pmMomentsAlloc();
    728730    psF64 tmpF64;
     
    746748XXX: macro this for performance.
    747749*****************************************************************************/
    748 static bool checkRadius(psPeak *peak,
     750static bool checkRadius(pmPeak *peak,
    749751                        psF32 radius,
    750752                        psS32 x,
     
    781783/******************************************************************************
    782784pmSourceMoments(source, radius): this function takes a subImage defined in the
    783 psSource data structure, along with the peak location, and determines the
     785pmSource data structure, along with the peak location, and determines the
    784786various moments associated with that peak.
    785787 
    786788Requires the following to have been created:
    787     psSource
    788     psSource->peak
    789     psSource->pixels
     789    pmSource
     790    pmSource->peak
     791    pmSource->pixels
    790792 
    791793XXX: The peak calculations are done in image coords, not subImage coords.
     
    793795XXX: mask values?
    794796*****************************************************************************/
    795 psSource *pmSourceMoments(psSource *source,
     797pmSource *pmSourceMoments(pmSource *source,
    796798                          psF32 radius)
    797799{
     
    925927int pmComparePeakAscend (const void **a, const void **b)
    926928{
    927     psPeak *A = *(psPeak **)a;
    928     psPeak *B = *(psPeak **)b;
     929    pmPeak *A = *(pmPeak **)a;
     930    pmPeak *B = *(pmPeak **)b;
    929931
    930932    psF32 diff;
     
    940942int pmComparePeakDescend (const void **a, const void **b)
    941943{
    942     psPeak *A = *(psPeak **)a;
    943     psPeak *B = *(psPeak **)b;
     944    pmPeak *A = *(pmPeak **)a;
     945    pmPeak *B = *(pmPeak **)b;
    944946
    945947    psF32 diff;
     
    992994        for (psS32 i = 0 ; i < sources->n ; i++)
    993995        {
    994             psSource *tmpSrc = (psSource *) sources->data[i];
     996            pmSource *tmpSrc = (pmSource *) sources->data[i];
    995997            PS_ASSERT_PTR_NON_NULL(tmpSrc, false); // just skip this one?
    996998            PS_ASSERT_PTR_NON_NULL(tmpSrc->moments, false); // just skip this one?
     
    10271029    // measure statistics on Sx, Sy if Sx, Sy within range of clump
    10281030    {
    1029         psPeak *clump;
     1031        pmPeak *clump;
    10301032        psF32 minSx, maxSx;
    10311033        psF32 minSy, maxSy;
     
    10541056        for (psS32 i = 0 ; i < sources->n ; i++)
    10551057        {
    1056             psSource *tmpSrc = (psSource *) sources->data[i];
     1058            pmSource *tmpSrc = (pmSource *) sources->data[i];
    10571059
    10581060            if (tmpSrc->moments->Sx < minSx)
     
    11031105    for (psS32 i = 0 ; i < sources->n ; i++) {
    11041106
    1105         psSource *tmpSrc = (psSource *) sources->data[i];
     1107        pmSource *tmpSrc = (pmSource *) sources->data[i];
    11061108
    11071109        tmpSrc->peak->class = 0;
     
    11971199     the pmSourceSetLocal() function.
    11981200*****************************************************************************/
    1199 bool pmSourceSetPixelsCircle(psSource *source,
     1201bool pmSourceSetPixelsCircle(pmSource *source,
    12001202                             const psImage *image,
    12011203                             psF32 radius)
     
    12931295/******************************************************************************
    12941296pmSourceModelGuess(source, image, model): This function allocates a new
    1295 psModel structure and stores it in the psSource data structure specified in
     1297pmModel structure and stores it in the pmSource data structure specified in
    12961298the argument list.  The model type is specified in the argument list.  The
    1297 params array in that psModel structure are allocated, and then set to the
     1299params array in that pmModel structure are allocated, and then set to the
    12981300appropriate values.  This function returns true if everything was successful.
    12991301 
     
    13061308image, not subImage coords.  Therefore, the calls to the model evaluation
    13071309functions will be in image, not subImage coords.  Remember this.
    1308 *****************************************************************************/
    1309 bool pmSourceModelGuess(psSource *source,
     1310 
     1311XXX: The source->models member used to be allocated here.  Now I assume
     1312->modelPSF should be allocated
     1313*****************************************************************************/
     1314bool pmSourceModelGuess(pmSource *source,
    13101315                        const psImage *image,
    1311                         psModelType model)
     1316                        pmModelType model)
    13121317{
    13131318    PS_ASSERT_PTR_NON_NULL(source, false);
     
    13161321    PS_ASSERT_IMAGE_NON_NULL(image, false);
    13171322    PS_ASSERT_IMAGE_TYPE(image, PS_TYPE_F32, false);
    1318     if (source->models != NULL) {
    1319         psLogMsg(__func__, PS_LOG_WARN, "WARNING: source->models was non-NULL; calling psFree(source->models).\n");
    1320         psFree(source->models);
     1323    if (source->modelPSF != NULL) {
     1324        psLogMsg(__func__, PS_LOG_WARN, "WARNING: source->modelPSF was non-NULL; calling psFree(source->modelPSF).\n");
     1325        psFree(source->modelPSF);
    13211326    }
    13221327    if (!((model == PS_MODEL_GAUSS) ||
     
    13301335    }
    13311336
    1332     source->models = pmModelAlloc(model);
    1333 
    1334     psVector *params = source->models->params;
     1337    source->modelPSF = pmModelAlloc(model);
     1338
     1339    psVector *params = source->modelPSF->params;
    13351340
    13361341    switch (model) {
     
    13641369        params->data.F32[6] = source->moments->Sxy;
    13651370        // XXX: What are these?
    1366         // source->models->params[7] = B2;
    1367         // source->models->params[8] = B3;
     1371        // source->modelPSF->params[7] = B2;
     1372        // source->modelPSF->params[8] = B3;
    13681373        return(true);
    13691374
     
    14201425/******************************************************************************
    14211426evalModel(source, level, row): a private function which evaluates the
    1422 source->model function at the specified coords.  The coords are subImage, not
     1427source->modelPSF function at the specified coords.  The coords are subImage, not
    14231428image coords.
    14241429 
     
    14301435the coords is in subImage or image space.
    14311436 
    1432 XXX: This should probably be a public psModules function.
     1437XXX: This should probably be a public pmModules function.
    14331438 
    14341439XXX: Use static vectors for x.
     
    14391444testing.  Try to reproduce that and debug.
    14401445*****************************************************************************/
    1441 static psF32 evalModel(psSource *src,
     1446static psF32 evalModel(pmSource *src,
    14421447                       psU32 row,
    14431448                       psU32 col)
    14441449{
    14451450    PS_ASSERT_PTR_NON_NULL(src, false);
    1446     PS_ASSERT_PTR_NON_NULL(src->models, false);
    1447     PS_ASSERT_PTR_NON_NULL(src->models->params, false);
    1448 
    1449     // XXX: The following step will not be necessary if the models->params
     1451    PS_ASSERT_PTR_NON_NULL(src->modelPSF, false);
     1452    PS_ASSERT_PTR_NON_NULL(src->modelPSF->params, false);
     1453
     1454    // XXX: The following step will not be necessary if the modelPSF->params
    14501455    // member is a psVector.  Suggest to IfA.
    14511456
    1452     // XXX EAM: done: models->params is now a vector
    1453     psVector *params = src->models->params;
     1457    // XXX EAM: done: modelPSF->params is now a vector
     1458    psVector *params = src->modelPSF->params;
    14541459
    14551460    //
     
    14611466    psF32 tmpF;
    14621467
    1463     switch (src->models->type) {
     1468    switch (src->modelPSF->type) {
    14641469    case PS_MODEL_GAUSS:
    14651470        tmpF = pmMinLM_Gauss2D(NULL, params, x);
     
    14811486        break;
    14821487    default:
    1483         psError(PS_ERR_UNKNOWN, true, "Undefined psModelType");
     1488        psError(PS_ERR_UNKNOWN, true, "Undefined pmModelType");
    14841489        return(NAN);
    14851490    }
     
    15001505XXX: The result is returned in image coords.
    15011506*****************************************************************************/
    1502 static psF32 findValue(psSource *source,
     1507static psF32 findValue(pmSource *source,
    15031508                       psF32 level,
    15041509                       psU32 row,
     
    15751580XXX: The top, bottom of the contour is not correctly determined.
    15761581*****************************************************************************/
    1577 psArray *pmSourceContour(psSource *source,
     1582psArray *pmSourceContour(pmSource *source,
    15781583                         const psImage *image,
    15791584                         psF32 level,
     
    15851590    PS_ASSERT_PTR_NON_NULL(source->peak, false);
    15861591    PS_ASSERT_PTR_NON_NULL(source->pixels, false);
    1587     PS_ASSERT_PTR_NON_NULL(source->models, false);
     1592    PS_ASSERT_PTR_NON_NULL(source->modelPSF, false);
    15881593
    15891594    //
     
    16921697XXX: Probably should remove the "image" argument.
    16931698*****************************************************************************/
    1694 bool pmSourceFitModel(psSource *source,
     1699bool pmSourceFitModel(pmSource *source,
    16951700                      const psImage *image)
    16961701{
     
    16991704    PS_ASSERT_PTR_NON_NULL(source->peak, false);
    17001705    PS_ASSERT_PTR_NON_NULL(source->pixels, false);
    1701     PS_ASSERT_PTR_NON_NULL(source->models, false);
     1706    PS_ASSERT_PTR_NON_NULL(source->modelPSF, false);
    17021707    PS_ASSERT_IMAGE_NON_NULL(image, false);
    17031708    PS_ASSERT_IMAGE_TYPE(image, PS_TYPE_F32, false);
     
    17421747                            PM_SOURCE_FIT_MODEL_TOLERANCE);
    17431748
    1744     psVector *params = source->models->params;
    1745 
    1746     switch (source->models->type) {
     1749    psVector *params = source->modelPSF->params;
     1750
     1751    switch (source->modelPSF->type) {
    17471752    case PS_MODEL_GAUSS:
    17481753        rc = psMinimizeLMChi2(myMin, NULL, params, NULL, x, y, yErr, pmMinLM_Gauss2D);
     
    17641769        break;
    17651770    default:
    1766         psError(PS_ERR_UNKNOWN, true, "Undefined psModelType");
     1771        psError(PS_ERR_UNKNOWN, true, "Undefined pmModelType");
    17671772        rc = false;
    17681773    }
    17691774    // XXX EAM: we need to do something (give an error?) if rc is false
    17701775    // XXX EAM: save the resulting chisq, nDOF, nIter
    1771     source->models->chisq = myMin->value;
    1772     source->models->nDOF  = y->n - params->n;
    1773     source->models->nIter = myMin->iter;
     1776    source->modelPSF->chisq = myMin->value;
     1777    source->modelPSF->nDOF  = y->n - params->n;
     1778    source->modelPSF->nIter = myMin->iter;
    17741779
    17751780    psFree(x);
     
    17801785
    17811786static bool sourceAddOrSubModel(psImage *image,
    1782                                 psSource *src,
     1787                                pmSource *src,
    17831788                                bool center,
    17841789                                psS32 flag)
     
    17881793    PS_ASSERT_PTR_NON_NULL(src->peak, false);
    17891794    PS_ASSERT_PTR_NON_NULL(src->pixels, false);
    1790     PS_ASSERT_PTR_NON_NULL(src->models, false);
     1795    PS_ASSERT_PTR_NON_NULL(src->modelPSF, false);
    17911796    PS_ASSERT_IMAGE_NON_NULL(image, false);
    17921797    PS_ASSERT_IMAGE_TYPE(image, PS_TYPE_F32, false);
    17931798
    17941799    psVector *x = psVectorAlloc(2, PS_TYPE_F32);
    1795     psVector *params = src->models->params;
     1800    psVector *params = src->modelPSF->params;
    17961801
    17971802    for (psS32 i = 0; i < src->pixels->numRows; i++) {
     
    18081813            x->data.F32[0] = (float) imageCol;
    18091814            x->data.F32[1] = (float) imageRow;
    1810             switch (src->models->type) {
     1815            switch (src->modelPSF->type) {
    18111816            case PS_MODEL_GAUSS:
    18121817                pixelValue = pmMinLM_Gauss2D(NULL, params, x);
     
    18281833                break;
    18291834            default:
    1830                 psError(PS_ERR_UNKNOWN, true, "Undefined psModelType");
     1835                psError(PS_ERR_UNKNOWN, true, "Undefined pmModelType");
    18311836                psFree(x);
    18321837                return(false);
     
    18511856 *****************************************************************************/
    18521857bool pmSourceAddModel(psImage *image,
    1853                       psSource *src,
     1858                      pmSource *src,
    18541859                      bool center)
    18551860{
     
    18601865 *****************************************************************************/
    18611866bool pmSourceSubModel(psImage *image,
    1862                       psSource *src,
     1867                      pmSource *src,
    18631868                      bool center)
    18641869{
  • trunk/psModules/src/pmObjects.h

    r4579 r4770  
    55 *  @author GLG, MHPCC
    66 *
    7  *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2005-07-19 01:44:48 $
     7 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2005-08-16 01:10:34 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2323#include "pslib.h"
    2424
     25/** pmPeakType
     26 *
     27 *  A peak pixel may have several features which may be determined when the
     28 *  peak is found or measured. These are specified by the pmPeakType enum.
     29 *  PM_PEAK_LONE represents a single pixel which is higher than its 8 immediate
     30 *  neighbors.  The PM_PEAK_EDGE represents a peak pixel which touching the image
     31 *  edge. The PM_PEAK_FLAT represents a peak pixel which has more than a specific
     32 *  number of neighbors at the same value, within some tolarence:
     33 *
     34 */
    2535typedef enum {
    26     PM_PEAK_LONE,           ///< Isolated peak.
    27     PM_PEAK_EDGE,           ///< Peak on edge.
    28     PM_PEAK_FLAT,           ///< Peak has equal-value neighbors.
    29     PM_PEAK_UNDEF           ///< Undefined.
    30 } psPeakType;
    31 
     36    PM_PEAK_LONE,                       ///< Isolated peak.
     37    PM_PEAK_EDGE,                       ///< Peak on edge.
     38    PM_PEAK_FLAT,                       ///< Peak has equal-value neighbors.
     39    PM_PEAK_UNDEF                       ///< Undefined.
     40} pmPeakType;
     41
     42/** pmPeak data structure
     43 * 
     44 * 
     45 * 
     46 */
    3247typedef struct
    3348{
    34     psS32 x;                ///< X-coordinate of peak pixel.
    35     psS32 y;                ///< Y-coordinate of peak pixel.
    36     psF32 counts;           ///< Value of peak pixel (above sky?).
    37     psPeakType class;       ///< Description of peak.
     49    int x;                              ///< X-coordinate of peak pixel.
     50    int y;                              ///< Y-coordinate of peak pixel.
     51    float counts;                       ///< Value of peak pixel (above sky?).
     52    pmPeakType class;                   ///< Description of peak.
    3853}
    39 psPeak;
    40 
     54pmPeak;
     55
     56/** pmMoments data structure
     57 * 
     58 * 
     59 * 
     60 */
    4161typedef struct
    4262{
    43     psF32 x;                ///< X-coord of centroid.
    44     psF32 y;                ///< Y-coord of centroid.
    45     psF32 Sx;               ///< x-second moment.
    46     psF32 Sy;               ///< y-second moment.
    47     psF32 Sxy;              ///< xy cross moment.
    48     psF32 Sum;              ///< Pixel sum above sky (background).
    49     psF32 Peak;             ///< Peak counts above sky.
    50     psF32 Sky;              ///< Sky level (background).
    51     psS32 nPixels;          ///< Number of pixels used.
     63    float x;                            ///< X-coord of centroid.
     64    float y;                            ///< Y-coord of centroid.
     65    float Sx;                           ///< x-second moment.
     66    float Sy;                           ///< y-second moment.
     67    float Sxy;                          ///< xy cross moment.
     68    float Sum;                          ///< Pixel sum above sky (background).
     69    float Peak;                         ///< Peak counts above sky.
     70    float Sky;                          ///< Sky level (background).
     71    int nPixels;                        ///< Number of pixels used.
    5272}
    53 psMoments;
    54 
     73pmMoments;
     74
     75/** pmModelType enumeration
     76 * 
     77 * 
     78 * 
     79 */
    5580typedef enum {
    56     PS_MODEL_GAUSS,   ///< Regular 2-D Gaussian
    57     PS_MODEL_PGAUSS,  ///< Psuedo 2-D Gaussian
    58     PS_MODEL_TWIST_GAUSS, ///< 2-D Twisted Gaussian
    59     PS_MODEL_WAUSS,  ///< 2-D Waussian
    60     PS_MODEL_SERSIC,  ///< Sersic
    61     PS_MODEL_SERSIC_CORE, ///< Sersic Core
    62     PS_MODEL_UNDEFINED  ///< Undefined
    63 } psModelType;
    64 
    65 // XXX: It will be better if params, and dparams, were psVectors.
     81    PS_MODEL_GAUSS,                     ///< Regular 2-D Gaussian
     82    PS_MODEL_PGAUSS,                    ///< Psuedo 2-D Gaussian
     83    PS_MODEL_TWIST_GAUSS,               ///< 2-D Twisted Gaussian
     84    PS_MODEL_WAUSS,                     ///< 2-D Waussian
     85    PS_MODEL_SERSIC,                    ///< Sersic
     86    PS_MODEL_SERSIC_CORE,               ///< Sersic Core
     87    PS_MODEL_UNDEFINED                  ///< Undefined
     88} pmModelType;
     89
     90/** pmModel data structure
     91 * 
     92 * 
     93 * 
     94 */
     95// XXX: The SDRS has the "type" member of type psS32.
    6696typedef struct
    6797{
    68     psModelType type;       ///< Model to be used.
    69     psVector *params;       ///< Paramater values.
    70     psVector *dparams;      ///< Parameter errors.
    71     psF32 chisq;            ///< Fit chi-squared.
    72     psS32 nDOF;             ///< number of degrees of freedom
    73     psS32 nIter;            ///< number of iterations to reach min
     98    pmModelType type;                   ///< Model to be used.
     99    psVector *params;                   ///< Paramater values.
     100    psVector *dparams;                  ///< Parameter errors.
     101    float chisq;                        ///< Fit chi-squared.
     102    int nDOF;                           ///< number of degrees of freedom
     103    int nIter;                          ///< number of iterations to reach min
    74104}
    75 psModel;
    76 
     105pmModel;
     106
     107/** pmSourceType enumeration
     108 * 
     109 * 
     110 * 
     111 */
    77112typedef enum {
    78113    PS_SOURCE_PSFSTAR,
     
    84119    PS_SOURCE_BRIGHTSTAR,
    85120    PS_SOURCE_OTHER
    86 } psSourceType;
    87 
     121} pmSourceType;
     122
     123/** pmSource data structure
     124 * 
     125 *  This source has the capacity for several types of measurements. The
     126 *  simplest measurement of a source is the location and flux of the peak pixel
     127 *  associated with the source:
     128 * 
     129 */
    88130typedef struct
    89131{
    90     psPeak *peak;           ///< Description of peak pixel.
    91     psImage *pixels;        ///< Rectangular region including object pixels.
    92     psImage *mask;          ///< Mask which marks pixels associated with objects.
    93     psMoments *moments;     ///< Basic moments measure for the object.
    94     psModel *models;        ///< Model parameters and type.
    95     psSourceType type;      ///< Best identification of object.
     132    pmPeak *peak;                       ///< Description of peak pixel.
     133    psImage *pixels;                    ///< Rectangular region including object pixels.
     134    psImage *mask;                      ///< Mask which marks pixels associated with objects.
     135    pmMoments *moments;                 ///< Basic moments measure for the object.
     136    pmModel *modelPSF;                  ///< PSF model parameters and type
     137    pmModel *modelFLT;                  ///< FLT model parameters and type
     138    pmSourceType type;                  ///< Best identification of object.
    96139}
    97 psSource;
    98 
    99 psPeak *pmPeakAlloc(psS32 x,  ///< Row-coordinate in image space
    100                     psS32 y,  ///< Col-coordinate in image space
    101                     psF32 counts, ///< The value of the peak pixel
    102                     psPeakType class ///< The type of peak pixel
    103                    );
    104 
    105 psMoments *pmMomentsAlloc();
    106 psModel *pmModelAlloc(psModelType type);
    107 psSource *pmSourceAlloc();
     140pmSource;
     141
     142/** pmPeak data structure
     143 * 
     144 * 
     145 * 
     146 */
     147typedef struct
     148{
     149    psS32 type;                         ///< PSF Model in use
     150    psArray *params;                    ///< Model parameters (psPolynomial2D)
     151    psF32 chisq;                        ///< PSF goodness statistic
     152    psS32 nPSFstars;                    ///< number of stars used to measure PSF
     153}
     154pmPSF;
     155
     156
     157
     158pmPeak *pmPeakAlloc(
     159    int x,                              ///< Row-coordinate in image space
     160    int y,                              ///< Col-coordinate in image space
     161    float counts,                       ///< The value of the peak pixel
     162    pmPeakType class                    ///< The type of peak pixel
     163);
     164
     165pmMoments *pmMomentsAlloc();
     166pmModel *pmModelAlloc(pmModelType type);
     167pmSource *pmSourceAlloc();
    108168
    109169/******************************************************************************
     
    112172the location (x value) of all peaks.
    113173 *****************************************************************************/
    114 psVector *pmFindVectorPeaks(const psVector *vector, ///< The input vector (psF32)
    115                             psF32 threshold  ///< Threshold above which to find a peak
    116                            );
     174psVector *pmFindVectorPeaks(
     175    const psVector *vector,             ///< The input vector (float)
     176    float threshold                     ///< Threshold above which to find a peak
     177);
    117178
    118179/******************************************************************************
     
    121182value) of all peaks.
    122183 *****************************************************************************/
    123 psArray *pmFindImagePeaks(const psImage *image, ///< The input image where peaks will be found (psF32)
    124                           psF32 threshold ///< Threshold above which to find a peak
    125                          );
     184psArray *pmFindImagePeaks(
     185    const psImage *image,               ///< The input image where peaks will be found (float)
     186    float threshold                     ///< Threshold above which to find a peak
     187);
    126188
    127189/******************************************************************************
     
    129191a peak value above the given maximum, or fall outside the valid region.
    130192 *****************************************************************************/
    131 psList *pmCullPeaks(psList *peaks,  ///< The psList of peaks to be culled
    132                     psF32 maxValue,  ///< Cull peaks above this value
    133                     const psRegion *valid ///< Cull peaks otside this psRegion
    134                    );
    135 
    136 /******************************************************************************
    137 psSource *pmSourceLocalSky(image, peak, innerRadius, outerRadius):
     193psList *pmCullPeaks(
     194    psList *peaks,                      ///< The psList of peaks to be culled
     195    float maxValue,                     ///< Cull peaks above this value
     196    const psRegion *valid               ///< Cull peaks otside this psRegion
     197);
     198
     199/******************************************************************************
     200pmSource *pmSourceLocalSky(image, peak, innerRadius, outerRadius):
    138201 
    139202 *****************************************************************************/
    140 psSource *pmSourceLocalSky(const psImage *image, ///< The input image (psF32)
    141                            const psPeak *peak,  ///< The peak for which the psSource struct is created.
    142                            psStatsOptions statsOptions, ///< The statistic used in calculating the background sky
    143                            psF32 innerRadius,  ///< The inner radius of the suqare annulus for calculating sky
    144                            psF32 outerRadius  ///< The outer radius of the suqare annulus for calculating sky
    145                           );
    146 
    147 /******************************************************************************
    148  *****************************************************************************/
    149 psSource *pmSourceMoments(psSource *source, ///< The input psSource for which moments will be computed
    150                           psF32 radius  ///< Use a circle of pixels around the peak
    151                          );
     203pmSource *pmSourceLocalSky(
     204    const psImage *image,               ///< The input image (float)
     205    const pmPeak *peak,                 ///< The peak for which the psSource struct is created.
     206    psStatsOptions statsOptions,        ///< The statistic used in calculating the background sky
     207    float innerRadius,                  ///< The inner radius of the suqare annulus for calculating sky
     208    float outerRadius                   ///< The outer radius of the suqare annulus for calculating sky
     209);
     210
     211/******************************************************************************
     212 *****************************************************************************/
     213pmSource *pmSourceMoments(
     214    pmSource *source,                   ///< The input pmSource for which moments will be computed
     215    float radius                        ///< Use a circle of pixels around the peak
     216);
    152217
    153218/******************************************************************************
     
    155220source classification.
    156221 *****************************************************************************/
    157 bool pmSourceRoughClass(psArray *source, ///< The input psSource
    158                         psMetadata *metadata ///< Contains classification parameters
    159                        );
     222bool pmSourceRoughClass(
     223    psArray *source,                    ///< The input pmSource
     224    psMetadata *metadata                ///< Contains classification parameters
     225);
    160226/******************************************************************************
    161227pmSourceSetPixelCircle(source, image, radius)
    162228 *****************************************************************************/
    163 bool pmSourceSetPixelsCircle(psSource *source,  ///< The input psSource
    164                              const psImage *image, ///< The input image (psF32)
    165                              psF32 radius  ///< The radius of the circle
    166                             );
    167 
    168 /******************************************************************************
    169  *****************************************************************************/
    170 bool pmSourceModelGuess(psSource *source, ///< The input psSource
    171                         const psImage *image, ///< The input image (psF32)
    172                         psModelType model ///< The type of model to be created.
    173                        );
     229bool pmSourceSetPixelsCircle(
     230    pmSource *source,                   ///< The input pmSource
     231    const psImage *image,               ///< The input image (float)
     232    float radius                        ///< The radius of the circle
     233);
     234
     235/******************************************************************************
     236 *****************************************************************************/
     237bool pmSourceModelGuess(
     238    pmSource *source,                   ///< The input pmSource
     239    const psImage *image,               ///< The input image (float)
     240    pmModelType model                   ///< The type of model to be created.
     241);
    174242
    175243/******************************************************************************
     
    179247} pmContourType;
    180248
    181 psArray *pmSourceContour(psSource *source, ///< The input psSource
    182                          const psImage *image, ///< The input image (psF32) (this arg should be removed)
    183                          psF32 level,  ///< The level of the contour
    184                          pmContourType mode ///< Currently this must be PS_CONTOUR_CRUDE
    185                         );
    186 
    187 /******************************************************************************
    188  *****************************************************************************/
    189 bool pmSourceFitModel(psSource *source,  ///< The input psSource
    190                       const psImage *image ///< The input image (psF32)
    191                      );
    192 
    193 /******************************************************************************
    194  *****************************************************************************/
    195 bool pmSourceAddModel(psImage *image,  ///< The opuut image (psF32)
    196                       psSource *source,  ///< The input psSource
    197                       bool center  ///< A boolean flag that determines whether pixels are centered
    198                      );
    199 
    200 /******************************************************************************
    201  *****************************************************************************/
    202 bool pmSourceSubModel(psImage *image,  ///< The output image (psF32)
    203                       psSource *source,  ///< The input psSource
    204                       bool center  ///< A boolean flag that determines whether pixels are centered
    205                      );
     249psArray *pmSourceContour(
     250    pmSource *source,                   ///< The input pmSource
     251    const psImage *image,               ///< The input image (float) (this arg should be removed)
     252    float level,                        ///< The level of the contour
     253    pmContourType mode                  ///< Currently this must be PS_CONTOUR_CRUDE
     254);
     255
     256/******************************************************************************
     257 *****************************************************************************/
     258bool pmSourceFitModel(
     259    pmSource *source,                   ///< The input pmSource
     260    const psImage *image                ///< The input image (float)
     261);
     262
     263/******************************************************************************
     264 *****************************************************************************/
     265bool pmSourceAddModel(
     266    psImage *image,                     ///< The opuut image (float)
     267    pmSource *source,                   ///< The input pmSource
     268    bool center                         ///< A boolean flag that determines whether pixels are centered
     269);
     270
     271/******************************************************************************
     272 *****************************************************************************/
     273bool pmSourceSubModel(
     274    psImage *image,                     ///< The output image (float)
     275    pmSource *source,                   ///< The input pmSource
     276    bool center                         ///< A boolean flag that determines whether pixels are centered
     277);
    206278
    207279/******************************************************************************
    208280XXX: Why only *x argument?
    209 XXX EAM: psMinimizeLMChi2Func returns psF64, not psF32
     281XXX EAM: psMinimizeLMChi2Func returns psF64, not float
    210282 *****************************************************************************/
    211283float pmMinLM_Gauss2D(
    212     psVector *deriv,                   ///< A possibly-NULL structure for the output derivatives
    213     const psVector *params,            ///< A psVector which holds the parameters of this function
    214     const psVector *x                  ///< A psVector which holds the row/col coordinate
     284    psVector *deriv,                    ///< A possibly-NULL structure for the output derivatives
     285    const psVector *params,             ///< A psVector which holds the parameters of this function
     286    const psVector *x                   ///< A psVector which holds the row/col coordinate
    215287);
    216288
     
    218290 *****************************************************************************/
    219291float pmMinLM_PsuedoGauss2D(
    220     psVector *deriv, ///< A possibly-NULL structure for the output derivatives
    221     const psVector *params, ///< A psVector which holds the parameters of this function
    222     const psVector *x  ///< A psVector which holds the row/col coordinate
     292    psVector *deriv,                    ///< A possibly-NULL structure for the output derivatives
     293    const psVector *params,             ///< A psVector which holds the parameters of this function
     294    const psVector *x                   ///< A psVector which holds the row/col coordinate
    223295);
    224296
     
    226298 *****************************************************************************/
    227299float pmMinLM_Wauss2D(
    228     psVector *deriv,  ///< A possibly-NULL structure for the output derivatives
    229     const psVector *params,  ///< A psVector which holds the parameters of this function
    230     const psVector *x  ///< A psVector which holds the row/col coordinate
     300    psVector *deriv,                    ///< A possibly-NULL structure for the output derivatives
     301    const psVector *params,             ///< A psVector which holds the parameters of this function
     302    const psVector *x                   ///< A psVector which holds the row/col coordinate
    231303);
    232304
     
    234306 *****************************************************************************/
    235307float pmMinLM_TwistGauss2D(
    236     psVector *deriv, ///< A possibly-NULL structure for the output derivatives
    237     const psVector *params, ///< A psVector which holds the parameters of this function
    238     const psVector *x  ///< A psVector which holds the row/col coordinate
     308    psVector *deriv,                    ///< A possibly-NULL structure for the output derivatives
     309    const psVector *params,             ///< A psVector which holds the parameters of this function
     310    const psVector *x                   ///< A psVector which holds the row/col coordinate
    239311);
    240312
     
    242314 *****************************************************************************/
    243315float pmMinLM_Sersic(
    244     psVector *deriv,  ///< A possibly-NULL structure for the output derivatives
    245     const psVector *params,  ///< A psVector which holds the parameters of this function
    246     const psVector *x  ///< A psVector which holds the row/col coordinate
     316    psVector *deriv,                    ///< A possibly-NULL structure for the output derivatives
     317    const psVector *params,             ///< A psVector which holds the parameters of this function
     318    const psVector *x                   ///< A psVector which holds the row/col coordinate
    247319);
    248320
     
    250322 *****************************************************************************/
    251323float pmMinLM_SersicCore(
    252     psVector *deriv, ///< A possibly-NULL structure for the output derivatives
    253     const psVector *params, ///< A psVector which holds the parameters of this function
    254     const psVector *x  ///< A psVector which holds the row/col coordinate
     324    psVector *deriv,                    ///< A possibly-NULL structure for the output derivatives
     325    const psVector *params,             ///< A psVector which holds the parameters of this function
     326    const psVector *x                   ///< A psVector which holds the row/col coordinate
    255327);
    256328
     
    258330 *****************************************************************************/
    259331float pmMinLM_PsuedoSersic(
    260     psVector *deriv, ///< A possibly-NULL structure for the output derivatives
    261     const psVector *params, ///< A psVector which holds the parameters of this function
    262     const psVector *x  ///< A psVector which holds the row/col coordinate
    263 );
    264 
     332    psVector *deriv,                    ///< A possibly-NULL structure for the output derivatives
     333    const psVector *params,             ///< A psVector which holds the parameters of this function
     334    const psVector *x                   ///< A psVector which holds the row/col coordinate
     335);
     336
     337
     338/**
     339 *
     340 *  The object model functions are defined to allow for the flexible addition
     341 *  of new object models. Every object model, with parameters represented by
     342 *  pmModel, has an associated set of functions which provide necessary support
     343 *  operations. A set of abstract functions allow the programmer to select the
     344 *  approriate function or property for a specific named object model.
     345 *
     346 */
     347
     348/**
     349 *
     350 *  This function is the model chi-square minimization function for this model.
     351 *
     352 */
     353typedef psMinimizeLMChi2Func pmModelFunc;
     354
     355
     356/**
     357 *
     358 * This function returns the integrated flux for the given model parameters.
     359 */
     360typedef psF64 (*pmModelFlux)(const psVector *params);
     361
     362
     363/**
     364 *
     365 *  This function provides the model guess parameters based on the details of
     366 *   the given source.
     367 *
     368 */
     369typedef bool (*pmModelGuessFunc)(pmModel *model, pmSource *source);
     370
     371
     372/**
     373 *
     374 *  This function constructs the PSF model for the given source based on the
     375 *  supplied psf and the FLT model for the object.
     376 *
     377 */
     378typedef bool (*pmModelFromPSFFunc)(pmModel *modelPSF, pmModel *modelFLT, pmPSF *psf);
     379
     380
     381/**
     382 *
     383 *  This function returns the radius at which the given model and parameters
     384 *  achieves the given flux.
     385 *
     386 */
     387typedef psF64 (*pmModelRadius)(const psVector *params, double flux);
     388
     389
     390/**
     391 *
     392 *  Each of the function types above has a corresponding function which returns
     393 *  the function given the model type:
     394 *
     395 */
     396pmModelFunc pmModelFunc_GetFunction (pmModelType type);
     397pmModelFlux pmModelFlux_GetFunction (pmModelType type);
     398pmModelGuessFunc pmModelGuessFunc_GetFunction (pmModelType type);
     399pmModelFromPSFFunc pmModelFromPSFFunc_GetFunction (pmModelType type);
     400pmModelRadius pmModelRadius_GetFunction (pmModelType type);
    265401
    266402#endif
  • trunk/psModules/src/pmReadoutCombine.c

    r4425 r4770  
    55 *  @author GLG, MHPCC
    66 *
    7  *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2005-06-29 01:39:10 $
     7 *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2005-08-16 01:10:34 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    7272    psS32 minInputRows = PS_MAX_S32;
    7373    psListElem *tmpInput = NULL;
    74     psReadout *tmpReadout = NULL;
     74    pmReadout *tmpReadout = NULL;
    7575    psS32 numInputs = 0;
    7676    psS32 tmpI;
     
    9898    tmpInput = (psListElem *) inputs->head;
    9999    while (NULL != tmpInput) {
    100         tmpReadout = (psReadout *) tmpInput->data;
     100        tmpReadout = (pmReadout *) tmpInput->data;
    101101        PS_ASSERT_READOUT_NON_NULL(tmpReadout, output);
    102102        PS_ASSERT_READOUT_NON_EMPTY(tmpReadout, output);
     
    182182    psVector *outColLower = psVectorAlloc(numInputs, PS_TYPE_U32);
    183183    psVector *outColUpper = psVectorAlloc(numInputs, PS_TYPE_U32);
    184     psReadout **tmpReadouts = (psReadout **) psAlloc(numInputs * sizeof(psReadout *));
     184    pmReadout **tmpReadouts = (pmReadout **) psAlloc(numInputs * sizeof(pmReadout *));
    185185
    186186    // For each input readout, we create a pointer to that readout in
     
    191191    tmpInput = (psListElem *) inputs->head;
    192192    while (NULL != tmpInput) {
    193         tmpReadouts[i] = (psReadout *) tmpInput->data;
     193        tmpReadouts[i] = (pmReadout *) tmpInput->data;
    194194        outRowLower->data.U32[i] = tmpReadouts[i]->row0 + tmpReadouts[i]->image->row0;
    195195        outColLower->data.U32[i] = tmpReadouts[i]->col0 + tmpReadouts[i]->image->col0;
  • trunk/psModules/src/pmSubtractBias.c

    r4579 r4770  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-07-19 01:44:48 $
     8 *  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-08-16 01:10:34 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2727place from the input image.
    2828 *****************************************************************************/
    29 static psReadout *SubtractFrame(psReadout *in,
    30                                 const psReadout *bias)
     29static pmReadout *SubtractFrame(pmReadout *in,
     30                                const pmReadout *bias)
    3131{
    3232    psS32 i;
     
    245245XXX: The SDRS does not specify type support.  F32 is implemented here.
    246246 *****************************************************************************/
    247 psReadout *pmSubtractBias(psReadout *in,
     247pmReadout *pmSubtractBias(pmReadout *in,
    248248                          void *fitSpec,
    249249                          const psList *overscans,
     
    252252                          psS32 nBinOrig,
    253253                          pmFit fit,
    254                           const psReadout *bias)
     254                          const pmReadout *bias)
    255255{
    256256    psTrace(".psModule.pmSubtracBias.pmSubtractBias", 4,
  • trunk/psModules/src/pmSubtractBias.h

    r4754 r4770  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-08-11 00:03:51 $
     8 *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-08-16 01:10:34 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3838} pmFit;
    3939
    40 psReadout *pmSubtractBias(psReadout *in,                ///< The input psReadout image
     40pmReadout *pmSubtractBias(pmReadout *in,                ///< The input pmReadout image
    4141                          void *fitSpec,                ///< A polynomial or spline, defining the fit type.
    4242                          const psList *overscans,      ///< A psList of overscan images
     
    4545                          int nBin,                     ///< The amount of binning to be done image pixels.
    4646                          pmFit fit,                    ///< PM_FIT_SPLINE, PM_FIT_POLYNOMIAL, or PM_FIT_NONE
    47                           const psReadout *bias);       ///< A possibly NULL bias psReadout which is to be subtracted
     47                          const pmReadout *bias);       ///< A possibly NULL bias pmReadout which is to be subtracted
    4848
    4949#endif
  • trunk/psModules/src/pmSubtractSky.c

    r4425 r4770  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-06-29 01:39:10 $
     8 *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-08-16 01:10:34 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    453453
    454454/******************************************************************************
    455 psReadout pmSubtractSky():
     455pmReadout pmSubtractSky():
    456456 
    457457XXX: use static vectors for myStats, and the binned image
     
    461461XXX: Sync the psTrace message facilities.
    462462 *****************************************************************************/
    463 psReadout *pmSubtractSky(psReadout *in,
     463pmReadout *pmSubtractSky(pmReadout *in,
    464464                         void *fitSpec,
    465465                         psFit fit,
  • trunk/psModules/src/pmSubtractSky.h

    r4754 r4770  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-08-11 00:03:51 $
     8 *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-08-16 01:10:34 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3232} psFit;
    3333
    34 psReadout *pmSubtractSky(psReadout *in,
     34pmReadout *pmSubtractSky(pmReadout *in,
    3535                         void *fitSpec,
    3636                         psFit fit,
Note: See TracChangeset for help on using the changeset viewer.