IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 30, 2006, 12:15:03 PM (20 years ago)
Author:
eugene
Message:

first complete working version (chip only)

File:
1 edited

Legend:

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

    r6958 r7014  
    11# include "psastro.h"
     2// XXX leak free 2006.04.27
    23
     4// XXX pass/apply the WCS information?
     5bool psastroConvert (pmReadout *readout, psMetadata *recipe) {
     6
     7    psArray *sources = psMetadataLookupPtr (NULL, readout->analysis, "PSPHOT.SOURCES");
     8    if (sources == NULL)
     9        return false;
     10
     11    psArray *objects = pmSourceToAstromObj (sources);
     12
     13    psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.OBJECTS", PS_DATA_ARRAY, "astrometry objects", objects);
     14    psFree (objects);
     15 
     16    return true;
     17}
     18
     19// XXX select a magnitude range?
    320psArray *pmSourceToAstromObj (psArray *sources) {
    421
     
    623   
    724    for (int i = 0; i < sources->n; i++) {
    8         psSource *source = sources->data[i];
     25        pmSource *source = sources->data[i];
    926       
    1027        // only accept the PSF sources?
    11         if (source->type != PM_SOURCE_STAR) continue;
     28        if (source->type != PM_SOURCE_TYPE_STAR) continue;
    1229
    1330        pmModel *model = source->modelPSF;
     
    2542        // XXX do we have the information giving the readout and cell offset?
    2643        // for the moment, assume chip == cell == readout
    27         obj->cell = obj->pix;
    28         obj->chip = obj->cell;
    29        
    30         // can we make an initial guess of the astrometry to set FP, TP, and sky coords?
    31        
    32        
     44        *obj->cell = *obj->pix;
     45        *obj->chip = *obj->cell;
     46
     47        psArrayAdd (objects, 100, obj);
     48        psFree (obj);
     49    }
     50    return objects;
    3351}
Note: See TracChangeset for help on using the changeset viewer.