IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36157


Ignore:
Timestamp:
Sep 27, 2013, 8:48:07 PM (13 years ago)
Author:
eugene
Message:

updates for CFF input and galaxy fits

Location:
branches/eam_branches/ipp-20130904/psModules/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130904/psModules/src/camera/pmFPAfile.h

    r33913 r36157  
    3434    PM_FPA_FILE_CMP,
    3535    PM_FPA_FILE_CMF,
     36    PM_FPA_FILE_CFF,
    3637    PM_FPA_FILE_WCS,
    3738    PM_FPA_FILE_RAW,
  • branches/eam_branches/ipp-20130904/psModules/src/objects/Makefile.am

    r36085 r36157  
    4040        pmSourceIO_SX.c \
    4141        pmSourceIO_CMP.c \
     42        pmSourceIO_CFF.c \
    4243        pmSourceIO_SMPDATA.c \
    4344        pmSourceIO_PS1_DEV_0.c \
  • branches/eam_branches/ipp-20130904/psModules/src/objects/pmSource.c

    r35768 r36157  
    6666    psFree(tmp->extpars);
    6767    psFree(tmp->diffStats);
     68    psFree(tmp->galaxyFits);
    6869    psFree(tmp->radialAper);
    6970    psTrace("psModules.objects", 10, "---- end ----\n");
     
    164165    source->extpars = NULL;
    165166    source->diffStats = NULL;
     167    source->galaxyFits = NULL;
    166168    source->radialAper = NULL;
    167169    source->parent = NULL;
  • branches/eam_branches/ipp-20130904/psModules/src/objects/pmSource.h

    r34403 r36157  
    117117    pmSourceExtendedPars *extpars;      ///< extended source parameters
    118118    pmSourceDiffStats *diffStats;       ///< extra parameters for difference detections
     119    pmSourceGalaxyFits *galaxyFits;     ///< fits to galaxy models (psphotFullForce only)
    119120    psArray *radialAper;                ///< radial flux in circular apertures
    120121    pmSource *parent;                   ///< reference to the master source from which this is derived
  • branches/eam_branches/ipp-20130904/psModules/src/objects/pmSourceExtendedPars.c

    r34403 r36157  
    286286    return pars;
    287287}
     288
     289// *** pmSourceExtFitPars describes extra metadata related to an extended fit
     290static void pmSourceGalaxyFitsFree (pmSourceGalaxyFits *tmp) {
     291 
     292    psFree (tmp->Io);
     293    psFree (tmp->dIo);
     294    psFree (tmp->chisq);
     295
     296    return;
     297}
     298
     299pmSourceGalaxyFits *pmSourceGalaxyFitsAlloc (void) {
     300
     301    pmSourceGalaxyFits *tmp = (pmSourceGalaxyFits *) psAlloc(sizeof(pmSourceGalaxyFits));
     302    psMemSetDeallocator(tmp, (psFreeFunc) pmSourceGalaxyFitsFree);
     303
     304    tmp->Io = psVectorAllocEmpty (25, PS_TYPE_F32);
     305    tmp->dIo = psVectorAllocEmpty (25, PS_TYPE_F32);
     306    tmp->chisq = psVectorAllocEmpty (25, PS_TYPE_F32);
     307    tmp->nPix = 0;
     308
     309    return tmp;
     310}
  • branches/eam_branches/ipp-20130904/psModules/src/objects/pmSourceExtendedPars.h

    r32347 r36157  
    8282} pmSourceExtFitPars;
    8383
     84typedef struct {
     85  psVector *Io;
     86  psVector *dIo;
     87  psVector *chisq;
     88  int nPix;
     89} pmSourceGalaxyFits;
     90
    8491pmSourceRadialFlux *pmSourceRadialFluxAlloc();
    8592bool psMemCheckSourceRadialFlux(psPtr ptr);
     
    109116pmSourceExtFitPars *pmSourceExtFitParsAlloc (void);
    110117
     118pmSourceGalaxyFits *pmSourceGalaxyFitsAlloc (void);
     119
     120
    111121/// @}
    112122# endif /* PM_SOURCE_H */
  • branches/eam_branches/ipp-20130904/psModules/src/objects/pmSourceIO.c

    r36152 r36157  
    915915    pmHDU *hdu;
    916916
     917    // define the EXTNAME values for the different data segments:
     918    psString headname = NULL;
     919    psString dataname = NULL;
     920    psString deteffname = NULL;
     921    psString xsrcname = NULL;
     922    psString xfitname = NULL;
     923    psString xradname = NULL;
     924
     925    psMetadata *tableHeader = NULL;
     926    char *xtension = NULL;
     927
    917928    switch (file->type) {
    918929      case PM_FPA_FILE_OBJ:
     
    962973        // read in header, if not yet loaded
    963974        hdu = pmFPAviewThisHDU (view, file->fpa);
    964 
    965         // define the EXTNAME values for the different data segments:
    966         psString headname = NULL;
    967         psString dataname = NULL;
    968         psString deteffname = NULL;
    969         psString xsrcname = NULL;
    970         psString xfitname = NULL;
    971         psString xradname = NULL;
    972975
    973976        // determine the output table format. Assume if we need to output extendend source
     
    10331036        }
    10341037
    1035         psMetadata *tableHeader = psFitsReadHeader(NULL, file->fits); // The FITS header
     1038        tableHeader = psFitsReadHeader(NULL, file->fits); // The FITS header
    10361039        if (!tableHeader) psAbort("cannot read table header");
    10371040
    1038         char *xtension = psMetadataLookupStr (NULL, tableHeader, "XTENSION");
     1041        xtension = psMetadataLookupStr (NULL, tableHeader, "XTENSION");
    10391042        if (!xtension) psAbort("cannot read table type");
    10401043        if (strcmp (xtension, "BINTABLE")) {
     
    11411144
    11421145        // define the EXTNAME values for the different data segments:
    1143         psString headname = pmFPAfileNameFromRule("{CHIP.NAME}.hdr", file, view);
    1144         psString dataname = pmFPAfileNameFromRule("{CHIP.NAME}.cff", file, view);
     1146        headname = pmFPAfileNameFromRule("{CHIP.NAME}.hdr", file, view);
     1147        dataname = pmFPAfileNameFromRule("{CHIP.NAME}.cff", file, view);
    11451148
    11461149        // advance to the IMAGE HEADER extension
     
    11621165        }
    11631166
    1164         psMetadata *tableHeader = psFitsReadHeader(NULL, file->fits); // The FITS header
     1167        tableHeader = psFitsReadHeader(NULL, file->fits); // The FITS header
    11651168        if (!tableHeader) psAbort("cannot read table header");
    11661169
  • branches/eam_branches/ipp-20130904/psModules/src/objects/pmSourceIO.h

    r35610 r36157  
    5252
    5353psArray *pmSourcesReadCMP (char *filename, psMetadata *header);
     54psArray *pmSourcesRead_CFF (psFits *fits, psMetadata *header);
    5455
    5556bool pmSourcesWritePSFs (psArray *sources, char *filename);
  • branches/eam_branches/ipp-20130904/psModules/src/objects/pmSourceIO_CFF.c

    r36154 r36157  
    5959
    6060    bool status;
    61     psF32 *PAR, *dPAR;
    6261    psEllipseAxes axes;
    6362
     
    9291        // here are the things we read from the FITS table (XXX modify names if needed)
    9392
    94         unsigned int ID  = psMetadataLookupU32 (&status, row, "IPP_IDET");
    95         float X          = psMetadataLookupF32 (&status, row, "X_PSF");
    96         float Y          = psMetadataLookupF32 (&status, row, "Y_PSF");
     93        unsigned int ID  = psMetadataLookupU32 (&status, row, "ID");
     94        float X          = psMetadataLookupF32 (&status, row, "X");
     95        float Y          = psMetadataLookupF32 (&status, row, "Y");
    9796
    9897        float apRadius   = psMetadataLookupS32 (&status, row, "AP_RADIUS");
     
    172171
    173172        if (fitGalaxy) {
    174             source->modelFits = psArrayAllocEmpty (models->list->n);
     173            source->modelFits = psArrayAllocEmpty (1);
    175174            pmModel *model = pmModelAlloc(modelType);
    176175            psF32 *xPAR = model->params->data.F32;
     
    181180            xPAR[PM_PAR_YPOS] = Y;
    182181           
    183             psEllipseAxes galAxes;
    184             galAxes.major = Rmajor;
    185             galAxes.minor = Rminor;
    186             galAxes.theta = theta; // XXX degrees or radians?
    187 
    188             pmPSF_AxesToModel (PAR, guessAxes, galModelType);
    189             xPAR[PM_PAR_7] = Sindex;
     182            psEllipseAxes galaxyAxes;
     183            galaxyAxes.major = Rmajor;
     184            galaxyAxes.minor = Rminor;
     185            galaxyAxes.theta = theta; // XXX degrees or radians?
     186
     187            pmPSF_AxesToModel (PAR, galaxyAxes, galaxyModelType);
     188            if (model->params->n > 7) {
     189              xPAR[PM_PAR_7] = Sindex;
     190            }
    190191
    191192            psArrayAdd (source->modelFits, 1, model);
Note: See TracChangeset for help on using the changeset viewer.