IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 24, 2006, 1:58:13 PM (20 years ago)
Author:
Paul Price
Message:

Changed definition of psArrayAlloc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psastro/src/psastroConvert.c

    r9574 r9732  
    88    pmReadout *readout;
    99    pmFPAview *view = pmFPAviewAlloc (0);
    10  
     10
    1111    while ((chip = pmFPAviewNextChip (view, fpa, 1)) != NULL) {
    1212        psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
    1313        if (!chip->process || !chip->file_exists) { continue; }
    1414
    15         while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) {
     15        while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) {
    1616            psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
    1717            if (!cell->process || !cell->file_exists) { continue; }
    1818
    19             // process each of the readouts
    20             while ((readout = pmFPAviewNextReadout (view, fpa, 1)) != NULL) {
    21                 if (! readout->data_exists) { continue; }
     19            // process each of the readouts
     20            while ((readout = pmFPAviewNextReadout (view, fpa, 1)) != NULL) {
     21                if (! readout->data_exists) { continue; }
    2222
    23                 psastroConvertReadout (readout, recipe);
    24             }
    25         }
     23                psastroConvertReadout (readout, recipe);
     24            }
     25        }
    2626    }
    2727    psFree (view);
     
    4040    psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.RAWSTARS", PS_DATA_ARRAY, "astrometry objects", rawstars);
    4141    psFree (rawstars);
    42  
     42
    4343    return true;
    4444}
     
    4747psArray *pmSourceToAstromObj (psArray *sources) {
    4848
    49     psArray *objects = psArrayAlloc (sources->n);
    50    
     49    psArray *objects = psArrayAllocEmpty (sources->n);
     50
    5151    for (int i = 0; i < sources->n; i++) {
    52         pmSource *source = sources->data[i];
    53        
    54         // only accept the PSF sources?
    55         if (source->type != PM_SOURCE_TYPE_STAR) continue;
     52        pmSource *source = sources->data[i];
    5653
    57         pmModel *model = source->modelPSF;
    58         if (model == NULL) continue;
     54        // only accept the PSF sources?
     55        if (source->type != PM_SOURCE_TYPE_STAR) continue;
    5956
    60         psF32 *PAR = model->params->data.F32;
     57        pmModel *model = source->modelPSF;
     58        if (model == NULL) continue;
    6159
    62         pmAstromObj *obj = pmAstromObjAlloc ();
     60        psF32 *PAR = model->params->data.F32;
    6361
    64         // is the source magnitude calibrated in any sense?
    65         obj->pix->x = PAR[2];
    66         obj->pix->y = PAR[3];
    67         obj->Mag = source->psfMag;
     62        pmAstromObj *obj = pmAstromObjAlloc ();
    6863
    69         // XXX do we have the information giving the readout and cell offset?
    70         // for the moment, assume chip == cell == readout
    71         *obj->cell = *obj->pix;
    72         *obj->chip = *obj->cell;
     64        // is the source magnitude calibrated in any sense?
     65        obj->pix->x = PAR[2];
     66        obj->pix->y = PAR[3];
     67        obj->Mag = source->psfMag;
    7368
    74         psArrayAdd (objects, 100, obj);
    75         psFree (obj);
     69        // XXX do we have the information giving the readout and cell offset?
     70        // for the moment, assume chip == cell == readout
     71        *obj->cell = *obj->pix;
     72        *obj->chip = *obj->cell;
     73
     74        psArrayAdd (objects, 100, obj);
     75        psFree (obj);
    7676    }
    7777    return objects;
Note: See TracChangeset for help on using the changeset viewer.