Changeset 9732 for trunk/psastro/src/psastroConvert.c
- Timestamp:
- Oct 24, 2006, 1:58:13 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psastro/src/psastroConvert.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroConvert.c
r9574 r9732 8 8 pmReadout *readout; 9 9 pmFPAview *view = pmFPAviewAlloc (0); 10 10 11 11 while ((chip = pmFPAviewNextChip (view, fpa, 1)) != NULL) { 12 12 psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 13 13 if (!chip->process || !chip->file_exists) { continue; } 14 14 15 while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) {15 while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) { 16 16 psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 17 17 if (!cell->process || !cell->file_exists) { continue; } 18 18 19 // process each of the readouts20 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; } 22 22 23 psastroConvertReadout (readout, recipe);24 }25 }23 psastroConvertReadout (readout, recipe); 24 } 25 } 26 26 } 27 27 psFree (view); … … 40 40 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.RAWSTARS", PS_DATA_ARRAY, "astrometry objects", rawstars); 41 41 psFree (rawstars); 42 42 43 43 return true; 44 44 } … … 47 47 psArray *pmSourceToAstromObj (psArray *sources) { 48 48 49 psArray *objects = psArrayAlloc (sources->n);50 49 psArray *objects = psArrayAllocEmpty (sources->n); 50 51 51 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]; 56 53 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; 59 56 60 psF32 *PAR = model->params->data.F32; 57 pmModel *model = source->modelPSF; 58 if (model == NULL) continue; 61 59 62 pmAstromObj *obj = pmAstromObjAlloc ();60 psF32 *PAR = model->params->data.F32; 63 61 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 (); 68 63 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; 73 68 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); 76 76 } 77 77 return objects;
Note:
See TracChangeset
for help on using the changeset viewer.
