IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34185


Ignore:
Timestamp:
Jul 20, 2012, 6:34:24 AM (14 years ago)
Author:
eugene
Message:

fix the autocode CMF formats

Location:
branches/eam_branches/ipp-20120627/psModules/src/objects
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20120627/psModules/src/objects/Makefile.am

    r34133 r34185  
    133133
    134134# pmSourceID_CMF_* functions use a common framework
    135 BUILT_SOURCES = pmSourceIO_CMF_PS1_V1.c pmSourceIO_CMF_PS1_V2.c pmSourceIO_CMF_PS1_V3.c pmSourceIO_CMF_PS1_V4.c
     135BUILT_SOURCES = pmSourceIO_CMF_PS1_V1.c pmSourceIO_CMF_PS1_V2.c pmSourceIO_CMF_PS1_V3.c pmSourceIO_CMF_PS1_DV1.c pmSourceIO_CMF_PS1_DV2.c pmSourceIO_CMF_PS1_SV1.c
    136136
    137137pmSourceIO_CMF_PS1_V1.c : pmSourceIO_CMF.c.in mksource.pl
     
    147147        mksource.pl pmSourceIO_CMF.c.in PS1_V4 pmSourceIO_CMF_PS1_V4.c
    148148
     149pmSourceIO_CMF_PS1_DV1.c : pmSourceIO_CMF.c.in mksource.pl
     150        mksource.pl pmSourceIO_CMF.c.in PS1_DV1 pmSourceIO_CMF_PS1_DV1.c
     151
     152pmSourceIO_CMF_PS1_DV2.c : pmSourceIO_CMF.c.in mksource.pl
     153        mksource.pl pmSourceIO_CMF.c.in PS1_DV2 pmSourceIO_CMF_PS1_DV2.c
     154
     155pmSourceIO_CMF_PS1_SV1.c : pmSourceIO_CMF.c.in mksource.pl
     156        mksource.pl pmSourceIO_CMF.c.in PS1_SV1 pmSourceIO_CMF_PS1_SV1.c
     157
    149158# EXTRA_DIST = pmErrorCodes.h.in pmErrorCodes.dat pmErrorCodes.c.in
  • branches/eam_branches/ipp-20120627/psModules/src/objects/mksource.pl

    r34182 r34185  
    5858
    5959    # grab the rules and the rest of the line
    60     ($prefix,$rules,$content) = ($line =~ m|(.*)\@(.*)\@(.*)|);
     60    ($prefix,$rules,$content) = ($line =~ m|(.*)\@(.*)\@\s*(.*)|);
    6161   
    6262    # split the rules into separate items
  • branches/eam_branches/ipp-20120627/psModules/src/objects/pmSourceIO_CMF.c.in

    r34183 r34185  
    8989    // by the time we call this function, all values should be assigned.  let's use asserts to be sure in some cases.
    9090    for (int i = 0; i < sources->n; i++) {
    91         pmSource *source = (pmSource *) sources->data[i];
     91        // this is the source associated with this image
     92        pmSource *thisSource = sources->data[i];
     93
     94        // this is the "real" version of this source
     95        pmSource *source = thisSource->parent ? thisSource->parent : thisSource;
    9296
    9397        // If source->seq is -1, source was generated in this analysis.  If source->seq is
     
    128132        @ALL@                     psMetadataAdd (row, PS_LIST_TAIL, "PSF_INST_MAG_SIG", PS_DATA_F32, "Sigma of PSF instrumental magnitude",        source->psfMagErr);
    129133
    130         @ALL,!PS1_V1@             psMetadataAdd (row, PS_LIST_TAIL, "PSF_INST_FLUX",    PS_DATA_F32, "PSF fit instrumental flux (counts)",         source->psfFlux);
    131         @ALL,!PS1_V1@             psMetadataAdd (row, PS_LIST_TAIL, "PSF_INST_FLUX_SIG",PS_DATA_F32, "Sigma of PSF instrumental flux",             source->psfFluxErr);
     134        @ALL,!PS1_V1,!PS1_V2@     psMetadataAdd (row, PS_LIST_TAIL, "PSF_INST_FLUX",    PS_DATA_F32, "PSF fit instrumental flux (counts)",         source->psfFlux);
     135        @ALL,!PS1_V1,!PS1_V2@     psMetadataAdd (row, PS_LIST_TAIL, "PSF_INST_FLUX_SIG",PS_DATA_F32, "Sigma of PSF instrumental flux",             source->psfFluxErr);
    132136
    133137        @ALL@                     psMetadataAdd (row, PS_LIST_TAIL, "AP_MAG",           PS_DATA_F32, "magnitude in standard aperture",             source->apMag);
     
    195199        @ALL@                     psMetadataAdd (row, PS_LIST_TAIL, "FLAGS",            PS_DATA_U32, "psphot analysis flags",                      source->mode);
    196200        @>PS1_V2,PS1_SV1,PS1_DV2@ psMetadataAdd (row, PS_LIST_TAIL, "FLAGS2",           PS_DATA_U32, "psphot analysis flags",                      source->mode2);
    197         @>PS1_V2,PS1_SV1,PS1_DV?@ psMetadataAdd (row, PS_LIST_TAIL, "PADDING2",         PS_DATA_S32, "more padding", 0);
     201        @>PS1_V2@                 psMetadataAdd (row, PS_LIST_TAIL, "PADDING2",         PS_DATA_S32, "more padding", 0);
     202        @PS1_SV1@ // XXX do I need PADDING2 or not?
    198203
    199204        // XXX not sure how to get this : need to load Nimages with weight?
     
    383388        @PS1_DV2@      source->diffStats->Rm         = psMetadataLookupF32 (&status, row, "DIFF_R_M");
    384389        @PS1_DV2@      source->diffStats->SNm        = psMetadataLookupF32 (&status, row, "DIFF_SN_M");
    385         @DV1,DV2@  }
     390        @PS1_DV?@  }
    386391
    387392        @ALL@                     source->mode  = psMetadataLookupU32 (&status, row, "FLAGS");
     
    589594}
    590595
    591 bool pmSourcesRead_CMF_PS1_@CMFMODE@_XSRC(psFits *fits, psMetadata *hduHeader, psArray *sources, long *sourceIndex)
     596bool pmSourcesRead_CMF_@CMFMODE@_XSRC(psFits *fits, psMetadata *hduHeader, psArray *sources, long *sourceIndex)
    592597{
    593598    PS_ASSERT_PTR_NON_NULL(fits, false);
     
    813818
    814819                if (k < model->params->n) {
    815                     psMetadataAdd (row, PS_LIST_TAIL, name, PS_DATA_F32, "", model->params->data.F32[k]);
     820                    psMetadataAddF32 (row, PS_LIST_TAIL, name, 0, "", model->params->data.F32[k]);
    816821                } else {
    817                     psMetadataAddF32 (row, PS_LIST_TAIL, name, PS_DATA_F32, "", NAN);
     822                    psMetadataAddF32 (row, PS_LIST_TAIL, name, 0, "", NAN);
    818823                }
    819824            }
     
    859864}
    860865
    861 bool pmSourcesRead_CMF_PS1_@CMFMODE@_XFIT(psFits *fits, psMetadata *hduHeader, psArray *sources, long *sourceIndex)
     866bool pmSourcesRead_CMF_@CMFMODE@_XFIT(psFits *fits, psMetadata *hduHeader, psArray *sources, long *sourceIndex)
    862867{
    863868    PS_ASSERT_PTR_NON_NULL(fits, false);
     
    961966// **** write out the radial flux values for the sources for a given matched-PSF image
    962967// **** how do we distinguish the matched-PSF images from the non-matched version
    963 bool pmSourcesWrite_CMF_PS1_@CMFMODE@_XRAD(psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, char *extname, psMetadata *recipe)
     968bool pmSourcesWrite_CMF_@CMFMODE@_XRAD(psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, char *extname, psMetadata *recipe)
    964969{
    965970    bool status = false;
     
    11041109}
    11051110
    1106 bool pmSourcesRead_CMF_PS1_@CMFMODE@_XRAD(psFits *fits, pmReadout *readout, psMetadata *hduHeader, psArray *sources, long *sourceIndex)
     1111bool pmSourcesRead_CMF_@CMFMODE@_XRAD(psFits *fits, pmReadout *readout, psMetadata *hduHeader, psArray *sources, long *sourceIndex)
    11071112{
    11081113    PS_ASSERT_PTR_NON_NULL(fits, false);
Note: See TracChangeset for help on using the changeset viewer.