IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34403 for trunk/psModules


Ignore:
Timestamp:
Sep 5, 2012, 4:16:36 PM (14 years ago)
Author:
eugene
Message:

adding SATSTAR profile code (but keeping it disabled for now); adding PS1_SV2 and PS1_DV3, finalizing PS1_V4; PLTSCALE now includes a sign for the image sky parity

Location:
trunk/psModules
Files:
64 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/psModules

  • trunk/psModules/src/camera/pmFPAfileIO.c

    r33690 r34403  
    3838#include "pmSourceExtendedPars.h"
    3939#include "pmSourceDiffStats.h"
     40#include "pmSourceSatstar.h"
    4041#include "pmSource.h"
    4142#include "pmSourceFitModel.h"
  • trunk/psModules/src/camera/pmReadoutFake.c

    r34085 r34403  
    2626#include "pmSourceExtendedPars.h"
    2727#include "pmSourceDiffStats.h"
     28#include "pmSourceSatstar.h"
    2829#include "pmSource.h"
    2930#include "pmSourceFitModel.h"
  • trunk/psModules/src/extras/pmVisual.c

    r31153 r34403  
    4040// #include "pmSourceExtendedPars.h"
    4141// #include "pmSourceDiffStats.h"
     42#include "pmSourceSatstar.h"
    4243// #include "pmSource.h"
    4344// #include "pmSourceFitModel.h"
  • trunk/psModules/src/imcombine/pmPSFEnvelope.c

    r32563 r34403  
    2626#include "pmSourceExtendedPars.h"
    2727#include "pmSourceDiffStats.h"
     28#include "pmSourceSatstar.h"
    2829#include "pmSource.h"
    2930#include "pmSourceFitModel.h"
  • trunk/psModules/src/imcombine/pmSubtractionStamps.c

    r33435 r34403  
    2525#include "pmSourceExtendedPars.h"
    2626#include "pmSourceDiffStats.h"
     27#include "pmSourceSatstar.h"
    2728#include "pmSource.h"
    2829
  • trunk/psModules/src/objects/Makefile.am

    r34259 r34403  
    2626        pmSourceDiffStats.c \
    2727        pmSourceExtendedPars.c \
     28        pmSourceSatstar.c \
    2829        pmSourceUtils.c \
    2930        pmSourceSky.c \
     
    4748        pmSourceIO_CMF_PS1_V4.c \
    4849        pmSourceIO_CMF_PS1_SV1.c \
     50        pmSourceIO_CMF_PS1_SV2.c \
    4951        pmSourceIO_CMF_PS1_DV1.c \
    5052        pmSourceIO_CMF_PS1_DV2.c \
     53        pmSourceIO_CMF_PS1_DV3.c \
    5154        pmSourceIO_MatchedRefs.c \
    5255        pmSourcePlots.c \
     
    99102        pmSourceDiffStats.h \
    100103        pmSourceExtendedPars.h \
     104        pmSourceSatstar.h \
    101105        pmSourceUtils.h \
    102106        pmSourceSky.h \
     
    133137
    134138# 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_DV1.c pmSourceIO_CMF_PS1_DV2.c pmSourceIO_CMF_PS1_SV1.c
     139BUILT_SOURCES = \
     140pmSourceIO_CMF_PS1_V1.c \
     141pmSourceIO_CMF_PS1_V2.c \
     142pmSourceIO_CMF_PS1_V3.c \
     143pmSourceIO_CMF_PS1_V4.c \
     144pmSourceIO_CMF_PS1_DV1.c \
     145pmSourceIO_CMF_PS1_DV2.c \
     146pmSourceIO_CMF_PS1_DV3.c \
     147pmSourceIO_CMF_PS1_SV1.c \
     148pmSourceIO_CMF_PS1_SV2.c
    136149
    137150pmSourceIO_CMF_PS1_V1.c : pmSourceIO_CMF.c.in mksource.pl
     
    153166        mksource.pl pmSourceIO_CMF.c.in PS1_DV2 pmSourceIO_CMF_PS1_DV2.c
    154167
     168pmSourceIO_CMF_PS1_DV3.c : pmSourceIO_CMF.c.in mksource.pl
     169        mksource.pl pmSourceIO_CMF.c.in PS1_DV3 pmSourceIO_CMF_PS1_DV3.c
     170
    155171pmSourceIO_CMF_PS1_SV1.c : pmSourceIO_CMF.c.in mksource.pl
    156172        mksource.pl pmSourceIO_CMF.c.in PS1_SV1 pmSourceIO_CMF_PS1_SV1.c
    157173
     174pmSourceIO_CMF_PS1_SV2.c : pmSourceIO_CMF.c.in mksource.pl
     175        mksource.pl pmSourceIO_CMF.c.in PS1_SV2 pmSourceIO_CMF_PS1_SV2.c
     176
    158177# EXTRA_DIST = pmErrorCodes.h.in pmErrorCodes.dat pmErrorCodes.c.in
  • trunk/psModules/src/objects/mksource.pl

    r34259 r34403  
    1414# validate the cmfmode
    1515
    16 # see if we can add in PS1_DV* and PS1_SV* as well...
    17 %cmfmodes = ("PS1_V1", 1,
    18              "PS1_V2", 2,
    19              "PS1_V3", 3,
    20              "PS1_V4", 4,
     16# keep the series (V1,SV1,DV1) separate)
     17%cmfmodes_v = ("PS1_V1", 1,
     18               "PS1_V2", 2,
     19               "PS1_V3", 3,
     20               "PS1_V4", 4,
     21    );
     22%cmfmodes_dv = ("PS1_DV1", 1,
     23                "PS1_DV2", 2,
     24                "PS1_DV3", 3,
     25    );
     26%cmfmodes_sv = ("PS1_SV1", 1,
     27                "PS1_SV2", 2,
    2128    );
    2229
     
    118125        if ($rule =~ m|^>=|) {
    119126            print ">= rule: $rule\n" if $DEBUG;
    120             if ($cmfmodes{$cmfmode} == 0) { next; }
     127            # find the cmfmode series (v, dv, sv)
    121128            $realrule = substr($rule,2);
    122             $thisLevel = $cmfmodes{$realrule};
    123             $myLevel = $cmfmodes{$cmfmode};
     129            %series = &cmf_series ($realrule);
     130            if (! %series) { next; }
     131            if ($series{$cmfmode} == 0) { next; }
     132            $thisLevel = $series{$realrule};
     133            $myLevel = $series{$cmfmode};
    124134            print "levels: $cmfmode, $realrule, $myLevel, $thisLevel\n" if $DEBUG;
    125135            if ($myLevel >= $thisLevel) { $keepLine = 1; }
     
    130140        if ($rule =~ m|^>|) {
    131141            print "> rule: $rule\n" if $DEBUG;
    132             if ($cmfmodes{$cmfmode} == 0) { next; }
     142            # find the cmfmode series (v, dv, sv)
    133143            $realrule = substr($rule,1);
    134             $thisLevel = $cmfmodes{$realrule};
    135             $myLevel = $cmfmodes{$cmfmode};
     144            %series = &cmf_series ($realrule);
     145            if (! %series) { next; }
     146            if ($series{$cmfmode} == 0) { next; }
     147            $thisLevel = $series{$realrule};
     148            $myLevel = $series{$cmfmode};
    136149            print "levels: $cmfmode, $realrule, $myLevel, $thisLevel\n" if $DEBUG;
    137150            if ($myLevel > $thisLevel) { $keepLine = 1; }
     
    142155        if ($rule =~ m|^<=|) {
    143156            print "<= rule: $rule\n" if $DEBUG;
    144             if ($cmfmodes{$cmfmode} == 0) { next; }
     157            # find the cmfmode series (v, dv, sv)
    145158            $realrule = substr($rule,2);
    146             $thisLevel = $cmfmodes{$realrule};
    147             $myLevel = $cmfmodes{$cmfmode};
     159            %series = &cmf_series ($realrule);
     160            if (! %series) { next; }
     161            if ($series{$cmfmode} == 0) { next; }
     162            $thisLevel = $series{$realrule};
     163            $myLevel = $series{$cmfmode};
    148164            print "levels: $cmfmode, $realrule, $myLevel, $thisLevel\n" if $DEBUG;
    149165            if ($myLevel <= $thisLevel) { $keepLine = 1; }
     
    154170        if ($rule =~ m|^<|) {
    155171            print "< rule: $rule\n" if $DEBUG;
    156             if ($cmfmodes{$cmfmode} == 0) { next; }
     172            # find the cmfmode series (v, dv, sv)
    157173            $realrule = substr($rule,1);
    158             $thisLevel = $cmfmodes{$realrule};
    159             $myLevel = $cmfmodes{$cmfmode};
     174            %series = &cmf_series ($realrule);
     175            if (! %series) { next; }
     176            if ($series{$cmfmode} == 0) { next; }
     177            $thisLevel = $series{$realrule};
     178            $myLevel = $series{$cmfmode};
    160179            print "levels: $cmfmode, $realrule, $myLevel, $thisLevel\n" if $DEBUG;
    161180            if ($myLevel < $thisLevel) { $keepLine = 1; }
     
    174193
    175194exit 0;
     195
     196sub cmf_series {
     197
     198    my ($rule) = $_[0];
     199
     200    if ($cmfmodes_v{$rule})  { return %cmfmodes_v;  }
     201    if ($cmfmodes_sv{$rule}) { return %cmfmodes_sv; }
     202    if ($cmfmodes_dv{$rule}) { return %cmfmodes_dv; }
     203    return 0;
     204}
  • trunk/psModules/src/objects/models/pmModel_DEV.c

    r32347 r34403  
    4343#include "pmSourceExtendedPars.h"
    4444#include "pmSourceDiffStats.h"
     45#include "pmSourceSatstar.h"
    4546#include "pmSource.h"
    4647#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/models/pmModel_EXP.c

    r32347 r34403  
    3939#include "pmSourceExtendedPars.h"
    4040#include "pmSourceDiffStats.h"
     41#include "pmSourceSatstar.h"
    4142#include "pmSource.h"
    4243#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/models/pmModel_GAUSS.c

    r31153 r34403  
    3939#include "pmSourceExtendedPars.h"
    4040#include "pmSourceDiffStats.h"
     41#include "pmSourceSatstar.h"
    4142#include "pmSource.h"
    4243#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/models/pmModel_PGAUSS.c

    r34085 r34403  
    3939#include "pmSourceExtendedPars.h"
    4040#include "pmSourceDiffStats.h"
     41#include "pmSourceSatstar.h"
    4142#include "pmSource.h"
    4243#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/models/pmModel_PS1_V1.c

    r34085 r34403  
    4040#include "pmSourceExtendedPars.h"
    4141#include "pmSourceDiffStats.h"
     42#include "pmSourceSatstar.h"
    4243#include "pmSource.h"
    4344#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/models/pmModel_QGAUSS.c

    r34085 r34403  
    4040#include "pmSourceExtendedPars.h"
    4141#include "pmSourceDiffStats.h"
     42#include "pmSourceSatstar.h"
    4243#include "pmSource.h"
    4344#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/models/pmModel_RGAUSS.c

    r34085 r34403  
    4040#include "pmSourceExtendedPars.h"
    4141#include "pmSourceDiffStats.h"
     42#include "pmSourceSatstar.h"
    4243#include "pmSource.h"
    4344#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/models/pmModel_SERSIC.c

    r33409 r34403  
    4949#include "pmSourceExtendedPars.h"
    5050#include "pmSourceDiffStats.h"
     51#include "pmSourceSatstar.h"
    5152#include "pmSource.h"
    5253#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/models/pmModel_TRAIL.c

    r34259 r34403  
    3939#include "pmSourceExtendedPars.h"
    4040#include "pmSourceDiffStats.h"
     41#include "pmSourceSatstar.h"
    4142#include "pmSource.h"
    4243#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmDetEff.c

    r29004 r34403  
    2323#include "pmSourceExtendedPars.h"
    2424#include "pmSourceDiffStats.h"
     25#include "pmSourceSatstar.h"
    2526#include "pmSource.h"
    2627#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmGrowthCurve.c

    r31451 r34403  
    3636#include "pmSourceExtendedPars.h"
    3737#include "pmSourceDiffStats.h"
     38#include "pmSourceSatstar.h"
    3839#include "pmSource.h"
    3940#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmGrowthCurveGenerate.c

    r31451 r34403  
    4343#include "pmSourceExtendedPars.h"
    4444#include "pmSourceDiffStats.h"
     45#include "pmSourceSatstar.h"
    4546#include "pmSource.h"
    4647#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmModelUtils.c

    r34085 r34403  
    3838#include "pmSourceExtendedPars.h"
    3939#include "pmSourceDiffStats.h"
     40#include "pmSourceSatstar.h"
    4041#include "pmSource.h"
    4142#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmPCM_MinimizeChisq.c

    r32725 r34403  
    3737#include "pmSourceExtendedPars.h"
    3838#include "pmSourceDiffStats.h"
     39#include "pmSourceSatstar.h"
    3940#include "pmSource.h"
    4041#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmPCMdata.c

    r33442 r34403  
    3737#include "pmSourceExtendedPars.h"
    3838#include "pmSourceDiffStats.h"
     39#include "pmSourceSatstar.h"
    3940#include "pmSource.h"
    4041#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmPSF.c

    r32347 r34403  
    4343#include "pmSourceExtendedPars.h"
    4444#include "pmSourceDiffStats.h"
     45#include "pmSourceSatstar.h"
    4546#include "pmSource.h"
    4647#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmPSF_IO.c

    r31451 r34403  
    5353#include "pmSourceExtendedPars.h"
    5454#include "pmSourceDiffStats.h"
     55#include "pmSourceSatstar.h"
    5556#include "pmSource.h"
    5657#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmPSFtry.c

    r30621 r34403  
    3535#include "pmSourceExtendedPars.h"
    3636#include "pmSourceDiffStats.h"
     37#include "pmSourceSatstar.h"
    3738#include "pmSource.h"
    3839#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmPSFtryFitEXT.c

    r33586 r34403  
    3535#include "pmSourceExtendedPars.h"
    3636#include "pmSourceDiffStats.h"
     37#include "pmSourceSatstar.h"
    3738#include "pmSource.h"
    3839#include "pmSourceUtils.h"
  • trunk/psModules/src/objects/pmPSFtryFitPSF.c

    r31451 r34403  
    3333#include "pmSourceExtendedPars.h"
    3434#include "pmSourceDiffStats.h"
     35#include "pmSourceSatstar.h"
    3536#include "pmSource.h"
    3637#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmPSFtryMakePSF.c

    r34156 r34403  
    3434#include "pmSourceExtendedPars.h"
    3535#include "pmSourceDiffStats.h"
     36#include "pmSourceSatstar.h"
    3637#include "pmSource.h"
    3738#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmPSFtryMetric.c

    r29004 r34403  
    3434#include "pmSourceExtendedPars.h"
    3535#include "pmSourceDiffStats.h"
     36#include "pmSourceSatstar.h"
    3637#include "pmSource.h"
    3738#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmPSFtryModel.c

    r30621 r34403  
    3535#include "pmSourceExtendedPars.h"
    3636#include "pmSourceDiffStats.h"
     37#include "pmSourceSatstar.h"
    3738#include "pmSource.h"
    3839#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmPhotObj.c

    r31153 r34403  
    3535#include "pmSourceExtendedPars.h"
    3636#include "pmSourceDiffStats.h"
     37#include "pmSourceSatstar.h"
    3738#include "pmSource.h"
    3839
  • trunk/psModules/src/objects/pmSource.c

    r34318 r34403  
    4040#include "pmSourceDiffStats.h"
    4141#include "pmSourcePhotometry.h"
     42#include "pmSourceSatstar.h"
    4243#include "pmSource.h"
    4344
     
    6162    psFree(tmp->modelFits);
    6263    psFree(tmp->extFitPars);
     64    psFree(tmp->blends);
     65    psFree(tmp->satstar);
    6366    psFree(tmp->extpars);
    64     psFree(tmp->moments);
    6567    psFree(tmp->diffStats);
    6668    psFree(tmp->radialAper);
    67     psFree(tmp->blends);
    6869    psTrace("psModules.objects", 10, "---- end ----\n");
    6970}
     
    160161    source->region = psRegionSet(NAN, NAN, NAN, NAN);
    161162    source->blends = NULL;
     163    source->satstar = NULL;
    162164    source->extpars = NULL;
    163165    source->diffStats = NULL;
     
    650652        if (source->peak->y >= region->y1) continue;
    651653
     654# define DEBUG 0
     655# define TEST_X 2792
     656# define TEST_Y 1741
     657# if (DEBUG)
     658        if ((fabs(source->peak->x - TEST_X) < 5) && (fabs(source->peak->y - TEST_Y) < 5)) {
     659          fprintf (stderr, "test peak\n");
     660        }
     661# endif
     662
    652663        // should be set by pmSourceAlloc
    653664        psAssert (source->type == PM_SOURCE_TYPE_UNKNOWN, "source type was not init-ed?");
     
    665676
    666677        // XXX EAM : can we use the value of SATURATE if mask is NULL?
     678        // XXX a 5x5 box centered on the peak is a rather small region to check for
    667679        inner = psRegionForSquare (source->peak->x, source->peak->y, 2);
    668680        inner = psRegionForImage (source->maskView, inner);
  • trunk/psModules/src/objects/pmSource.h

    r34315 r34403  
    114114    psRegion region;                    ///< area on image covered by selected pixels
    115115    psArray *blends;                    ///< collection of sources thought to be confused with object
     116    pmSourceSatstar *satstar;
    116117    pmSourceExtendedPars *extpars;      ///< extended source parameters
    117118    pmSourceDiffStats *diffStats;       ///< extra parameters for difference detections
  • trunk/psModules/src/objects/pmSourceContour.c

    r29004 r34403  
    3939#include "pmSourceExtendedPars.h"
    4040#include "pmSourceDiffStats.h"
     41#include "pmSourceSatstar.h"
    4142#include "pmSource.h"
    4243
  • trunk/psModules/src/objects/pmSourceExtendedPars.c

    r32347 r34403  
    190190bool pmSourceRadialProfileSortPair (psVector *index, psVector *extra) {
    191191
     192    psAssert (index->n == extra->n, "mismatched vector lengths");
     193    if (index->n < 2) return true;
     194
    192195    // sort the vector set by the radius
    193196    PSSORT (index->n, COMPARE_INDEX, SWAP_INDEX, NONE);
  • trunk/psModules/src/objects/pmSourceFitModel.c

    r34259 r34403  
    3939#include "pmSourceExtendedPars.h"
    4040#include "pmSourceDiffStats.h"
     41#include "pmSourceSatstar.h"
    4142#include "pmSource.h"
    4243#include "pmSourcePhotometry.h"
  • trunk/psModules/src/objects/pmSourceFitPCM.c

    r34287 r34403  
    3737#include "pmSourceExtendedPars.h"
    3838#include "pmSourceDiffStats.h"
     39#include "pmSourceSatstar.h"
    3940#include "pmSource.h"
    4041#include "pmSourcePhotometry.h"
  • trunk/psModules/src/objects/pmSourceFitSet.c

    r31153 r34403  
    3838#include "pmSourceExtendedPars.h"
    3939#include "pmSourceDiffStats.h"
     40#include "pmSourceSatstar.h"
    4041#include "pmSource.h"
    4142#include "pmSourcePhotometry.h"
  • trunk/psModules/src/objects/pmSourceGroups.c

    r29004 r34403  
    2424#include "pmSourceExtendedPars.h"
    2525#include "pmSourceDiffStats.h"
     26#include "pmSourceSatstar.h"
    2627#include "pmSource.h"
    2728#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmSourceIO.c

    r34271 r34403  
    4646#include "pmSourceExtendedPars.h"
    4747#include "pmSourceDiffStats.h"
     48#include "pmSourceSatstar.h"
    4849#include "pmSource.h"
    4950#include "pmSourceFitModel.h"
     
    574575            PM_SOURCES_WRITE("PS1_V4",    CMF_PS1_V4);
    575576            PM_SOURCES_WRITE("PS1_SV1",   CMF_PS1_SV1);
     577            PM_SOURCES_WRITE("PS1_SV2",   CMF_PS1_SV2);
    576578            PM_SOURCES_WRITE("PS1_DV1",   CMF_PS1_DV1);
    577579            PM_SOURCES_WRITE("PS1_DV2",   CMF_PS1_DV2);
     580            PM_SOURCES_WRITE("PS1_DV3",   CMF_PS1_DV3);
    578581
    579582            psFree (outhead);
     
    10471050            PM_SOURCES_READ_PSF("PS1_V4",    CMF_PS1_V4);
    10481051            PM_SOURCES_READ_PSF("PS1_SV1",   CMF_PS1_SV1);
     1052            PM_SOURCES_READ_PSF("PS1_SV2",   CMF_PS1_SV2);
    10491053            PM_SOURCES_READ_PSF("PS1_DV1",   CMF_PS1_DV1);
    10501054            PM_SOURCES_READ_PSF("PS1_DV2",   CMF_PS1_DV2);
     1055            PM_SOURCES_READ_PSF("PS1_DV3",   CMF_PS1_DV3);
    10511056
    10521057            long *sourceIndex = NULL;
     
    12531258        PM_SOURCES_READ_XSRC("PS1_V4",    CMF_PS1_V4);
    12541259        PM_SOURCES_READ_XSRC("PS1_SV1",   CMF_PS1_SV1);
     1260        PM_SOURCES_READ_XSRC("PS1_SV2",   CMF_PS1_SV2);
    12551261        PM_SOURCES_READ_XSRC("PS1_DV1",   CMF_PS1_DV1);
    12561262        PM_SOURCES_READ_XSRC("PS1_DV2",   CMF_PS1_DV2);
     1263        PM_SOURCES_READ_XSRC("PS1_DV3",   CMF_PS1_DV3);
    12571264    }
    12581265    psFree(tableHeader);
     
    12891296        PM_SOURCES_READ_XFIT("PS1_V4",    CMF_PS1_V4);
    12901297        PM_SOURCES_READ_XFIT("PS1_SV1",   CMF_PS1_SV1);
     1298        PM_SOURCES_READ_XFIT("PS1_SV2",   CMF_PS1_SV2);
    12911299        PM_SOURCES_READ_XFIT("PS1_DV1",   CMF_PS1_DV1);
    12921300        PM_SOURCES_READ_XFIT("PS1_DV2",   CMF_PS1_DV2);
     1301        PM_SOURCES_READ_XFIT("PS1_DV3",   CMF_PS1_DV3);
    12931302    }
    12941303    psFree(tableHeader);
     
    13241333        PM_SOURCES_READ_XRAD("PS1_V4",    CMF_PS1_V4);
    13251334        PM_SOURCES_READ_XRAD("PS1_SV1",   CMF_PS1_SV1);
     1335        PM_SOURCES_READ_XRAD("PS1_SV2",   CMF_PS1_SV2);
    13261336        PM_SOURCES_READ_XRAD("PS1_DV1",   CMF_PS1_DV1);
    13271337        PM_SOURCES_READ_XRAD("PS1_DV2",   CMF_PS1_DV2);
     1338        PM_SOURCES_READ_XRAD("PS1_DV3",   CMF_PS1_DV3);
    13281339    }
    13291340    psFree(tableHeader);
  • trunk/psModules/src/objects/pmSourceIO.h

    r34269 r34403  
    3636MK_PROTO(CMF_PS1_V4);
    3737MK_PROTO(CMF_PS1_SV1);
     38MK_PROTO(CMF_PS1_SV2);
    3839MK_PROTO(CMF_PS1_DV1);
    3940MK_PROTO(CMF_PS1_DV2);
     41MK_PROTO(CMF_PS1_DV3);
    4042
    4143int pmSourceGetDophotType (pmSource *source);
  • trunk/psModules/src/objects/pmSourceIO_CMF.c.in

    r34362 r34403  
    4343#include "pmSourceExtendedPars.h"
    4444#include "pmSourceDiffStats.h"
     45#include "pmSourceSatstar.h"
    4546#include "pmSource.h"
    4647#include "pmSourceFitModel.h"
     
    135136        @ALL,!PS1_V1,!PS1_V2@     psMetadataAdd (row, PS_LIST_TAIL, "PSF_INST_FLUX_SIG",PS_DATA_F32, "Sigma of PSF instrumental flux",             source->psfFluxErr);
    136137
    137         @ALL@                     psMetadataAdd (row, PS_LIST_TAIL, "AP_MAG",           PS_DATA_F32, "magnitude in standard aperture",             source->apMag);
    138         @>PS1_V2,PS1_SV1,PS1_DV2@ psMetadataAdd (row, PS_LIST_TAIL, "AP_MAG_RAW",       PS_DATA_F32, "magnitude in reported aperture",             source->apMagRaw);
    139         @ALL@                     psMetadataAdd (row, PS_LIST_TAIL, "AP_MAG_RADIUS",    PS_DATA_F32, "radius used for aperture mags",              outputs.apRadius);
    140         @PS1_DV2@                psMetadataAdd (row, PS_LIST_TAIL, "AP_FLUX",          PS_DATA_F32, "instrumental flux in standard aperture",     source->apFlux);
    141         @PS1_DV2@                psMetadataAdd (row, PS_LIST_TAIL, "AP_FLUX_SIG",      PS_DATA_F32, "aperture flux error",                        source->apFluxErr);
     138        @ALL@                       psMetadataAdd (row, PS_LIST_TAIL, "AP_MAG",           PS_DATA_F32, "magnitude in standard aperture",             source->apMag);
     139        @>PS1_V2,PS1_SV?,>PS1_DV1@ psMetadataAdd (row, PS_LIST_TAIL, "AP_MAG_RAW",       PS_DATA_F32, "magnitude in reported aperture",             source->apMagRaw);
     140        @ALL@                       psMetadataAdd (row, PS_LIST_TAIL, "AP_MAG_RADIUS",    PS_DATA_F32, "radius used for aperture mags",              outputs.apRadius);
     141        @>PS1_DV1,>PS1_V3,>PS1_SV1@ psMetadataAdd (row, PS_LIST_TAIL, "AP_FLUX",          PS_DATA_F32, "instrumental flux in standard aperture",     source->apFlux);
     142        @>PS1_DV1,>PS1_V3,>PS1_SV1@ psMetadataAdd (row, PS_LIST_TAIL, "AP_FLUX_SIG",      PS_DATA_F32, "aperture flux error",                        source->apFluxErr);
    142143
    143144        @<PS1_V3,PS1_SV1,PS1_DV?@ psMetadataAdd (row, PS_LIST_TAIL, "PEAK_FLUX_AS_MAG", PS_DATA_F32, "Peak flux expressed as magnitude",           outputs.peakMag);
     
    150151        @ALL,!PS1_V1@             psMetadataAdd (row, PS_LIST_TAIL, "DEC_PSF",          PS_DATA_F64, "PSF DEC coordinate (degrees)",               outputs.dec);
    151152
    152         @>=PS1_V3@                psMetadataAdd (row, PS_LIST_TAIL, "PEAK_FLUX_AS_MAG", PS_DATA_F32, "Peak flux expressed as magnitude",           outputs.peakMag);
     153        @>=PS1_V3,>PS1_SV1@       psMetadataAdd (row, PS_LIST_TAIL, "PEAK_FLUX_AS_MAG", PS_DATA_F32, "Peak flux expressed as magnitude",           outputs.peakMag);
    153154        @ALL@                     psMetadataAdd (row, PS_LIST_TAIL, "SKY",              PS_DATA_F32, "Sky level",                                  source->sky);
    154155        @ALL@                     psMetadataAdd (row, PS_LIST_TAIL, "SKY_SIGMA",        PS_DATA_F32, "Sigma of sky level",                         source->skyErr);
     
    162163        @ALL@                     psMetadataAdd (row, PS_LIST_TAIL, "PSF_THETA",        PS_DATA_F32, "PSF orientation angle",                      outputs.psfTheta);
    163164        @ALL@                     psMetadataAdd (row, PS_LIST_TAIL, "PSF_QF",           PS_DATA_F32, "PSF coverage/quality factor (bad)",          source->pixWeightNotBad);
    164         @>PS1_V2,PS1_SV1,PS1_DV2@ psMetadataAdd (row, PS_LIST_TAIL, "PSF_QF_PERFECT",   PS_DATA_F32, "PSF coverage/quality factor (poor)",         source->pixWeightNotPoor);
     165        @>PS1_V2,PS1_SV?,>PS1_DV1@ psMetadataAdd (row, PS_LIST_TAIL, "PSF_QF_PERFECT",   PS_DATA_F32, "PSF coverage/quality factor (poor)",         source->pixWeightNotPoor);
    165166        @ALL@                     psMetadataAdd (row, PS_LIST_TAIL, "PSF_NDOF",         PS_DATA_S32, "degrees of freedom",                         outputs.nDOF);
    166167        @ALL@                     psMetadataAdd (row, PS_LIST_TAIL, "PSF_NPIX",         PS_DATA_S32, "number of pixels in fit",                    outputs.nPix);
     
    170171        @ALL@                     psMetadataAdd (row, PS_LIST_TAIL, "MOMENTS_YY",       PS_DATA_F32, "second moments (Y*Y)",                       moments.Myy);
    171172
    172         @>PS1_V2,PS1_SV1@         psMetadataAdd (row, PS_LIST_TAIL, "MOMENTS_M3C",      PS_DATA_F32, "third momemt cos theta",                     moments.M_c3);
    173         @>PS1_V2,PS1_SV1@         psMetadataAdd (row, PS_LIST_TAIL, "MOMENTS_M3S",      PS_DATA_F32, "third momemt sin theta",                     moments.M_s3);
    174         @>PS1_V2,PS1_SV1@         psMetadataAdd (row, PS_LIST_TAIL, "MOMENTS_M4C",      PS_DATA_F32, "fourth momemt cos theta",                    moments.M_c4);
    175         @>PS1_V2,PS1_SV1@         psMetadataAdd (row, PS_LIST_TAIL, "MOMENTS_M4S",      PS_DATA_F32, "fourth momemt sin theta",                    moments.M_s4);
    176 
    177         @>PS1_V2,PS1_SV1,PS1_DV2@ psMetadataAdd (row, PS_LIST_TAIL, "MOMENTS_R1",       PS_DATA_F32, "first radial moment",                        moments.Mrf);
    178         @>PS1_V2,PS1_SV1,PS1_DV2@ psMetadataAdd (row, PS_LIST_TAIL, "MOMENTS_RH",       PS_DATA_F32, "half radial moment",                         moments.Mrh);
    179         @>PS1_V2,PS1_SV1,PS1_DV2@ psMetadataAdd (row, PS_LIST_TAIL, "KRON_FLUX",        PS_DATA_F32, "Kron Flux (in 2.5 R1)",                      moments.Krf);
    180         @>PS1_V2,PS1_SV1,PS1_DV2@ psMetadataAdd (row, PS_LIST_TAIL, "KRON_FLUX_ERR",    PS_DATA_F32, "Kron Flux Error",                            moments.dKrf);
    181         @>PS1_V2,PS1_SV1,PS1_DV2@ psMetadataAdd (row, PS_LIST_TAIL, "KRON_FLUX_INNER",  PS_DATA_F32, "Kron Flux (in 1.0 R1)",                      moments.Kinner);
    182         @>PS1_V2,PS1_SV1,PS1_DV2@ psMetadataAdd (row, PS_LIST_TAIL, "KRON_FLUX_OUTER",  PS_DATA_F32, "Kron Flux (in 4.0 R1)",                      moments.Kouter);
     173        @>PS1_V2,PS1_SV?@         psMetadataAdd (row, PS_LIST_TAIL, "MOMENTS_M3C",      PS_DATA_F32, "third momemt cos theta",                     moments.M_c3);
     174        @>PS1_V2,PS1_SV?@         psMetadataAdd (row, PS_LIST_TAIL, "MOMENTS_M3S",      PS_DATA_F32, "third momemt sin theta",                     moments.M_s3);
     175        @>PS1_V2,PS1_SV?@         psMetadataAdd (row, PS_LIST_TAIL, "MOMENTS_M4C",      PS_DATA_F32, "fourth momemt cos theta",                    moments.M_c4);
     176        @>PS1_V2,PS1_SV?@         psMetadataAdd (row, PS_LIST_TAIL, "MOMENTS_M4S",      PS_DATA_F32, "fourth momemt sin theta",                    moments.M_s4);
     177
     178        @>PS1_V2,PS1_SV?,>PS1_DV1@ psMetadataAdd (row, PS_LIST_TAIL, "MOMENTS_R1",       PS_DATA_F32, "first radial moment",                        moments.Mrf);
     179        @>PS1_V2,PS1_SV?,>PS1_DV1@ psMetadataAdd (row, PS_LIST_TAIL, "MOMENTS_RH",       PS_DATA_F32, "half radial moment",                         moments.Mrh);
     180        @>PS1_V2,PS1_SV?,>PS1_DV1@ psMetadataAdd (row, PS_LIST_TAIL, "KRON_FLUX",        PS_DATA_F32, "Kron Flux (in 2.5 R1)",                      moments.Krf);
     181        @>PS1_V2,PS1_SV?,>PS1_DV1@ psMetadataAdd (row, PS_LIST_TAIL, "KRON_FLUX_ERR",    PS_DATA_F32, "Kron Flux Error",                            moments.dKrf);
     182        @>PS1_V2,PS1_SV?,>PS1_DV1@ psMetadataAdd (row, PS_LIST_TAIL, "KRON_FLUX_INNER",  PS_DATA_F32, "Kron Flux (in 1.0 R1)",                      moments.Kinner);
     183        @>PS1_V2,PS1_SV?,>PS1_DV1@ psMetadataAdd (row, PS_LIST_TAIL, "KRON_FLUX_OUTER",  PS_DATA_F32, "Kron Flux (in 4.0 R1)",                      moments.Kouter);
    183184
    184185        @>PS1_V3@                 psMetadataAdd (row, PS_LIST_TAIL, "SKY_LIMIT_RAD",    PS_DATA_F32, "Radius where object hits sky",               source->skyRadius);
     
    197198        @PS1_DV2@                 psMetadataAdd (row, PS_LIST_TAIL, "DIFF_SN_M",        PS_DATA_F32, "signal-to-noise of neg match src",           diffStats.SNm);
    198199
    199         @ALL@                     psMetadataAdd (row, PS_LIST_TAIL, "FLAGS",            PS_DATA_U32, "psphot analysis flags",                      source->mode);
    200         @>PS1_V2,PS1_SV1,PS1_DV2@ psMetadataAdd (row, PS_LIST_TAIL, "FLAGS2",           PS_DATA_U32, "psphot analysis flags",                      source->mode2);
    201         // @>PS1_V2,PS1_SV1,PS1_DV2@ psMetadataAdd (row, PS_LIST_TAIL, "FLAGS2",           PS_DATA_U32, "psphot analysis flags",                      source->mode2 | (source->id<<8));
    202         @>PS1_V2@                 psMetadataAdd (row, PS_LIST_TAIL, "PADDING2",         PS_DATA_S32, "more padding", 0);
    203         @PS1_SV1@
     200        @ALL@                      psMetadataAdd (row, PS_LIST_TAIL, "FLAGS",            PS_DATA_U32, "psphot analysis flags",                      source->mode);
     201        @>PS1_V2,PS1_SV?,>PS1_DV1@ psMetadataAdd (row, PS_LIST_TAIL, "FLAGS2",           PS_DATA_U32, "psphot analysis flags",                      source->mode2);
     202        @PS1_V3,PS1_SV2@           psMetadataAdd (row, PS_LIST_TAIL, "PADDING2",         PS_DATA_S32, "more padding", 0);
     203        @PS1_SV?@
    204204
    205205          // note that this definition is inconsistent with the definition in
     
    316316        @ALL@     source->psfMagErr = psMetadataLookupF32 (&status, row, "PSF_INST_MAG_SIG");
    317317        @ALL@     source->apMag     = psMetadataLookupF32 (&status, row, "AP_MAG");
    318         @>PS1_V2,PS1_SV1,PS1_DV2@ source->apMagRaw  = psMetadataLookupF32 (&status, row, "AP_MAG_RAW");
     318        @>PS1_V2,PS1_SV?,>PS1_DV1@ source->apMagRaw  = psMetadataLookupF32 (&status, row, "AP_MAG_RAW");
    319319
    320320        // XXX use these to determine PAR[PM_PAR_I0] if they exist?
    321321        // XXX add these to PS1_SV1?
    322         @>PS1_V2,PS1_SV1,PS1_DV?@ source->psfFlux   = psMetadataLookupF32 (&status, row, "PSF_INST_FLUX");
    323         @>PS1_V2,PS1_SV1,PS1_DV?@ source->psfFluxErr= psMetadataLookupF32 (&status, row, "PSF_INST_FLUX_SIG");
     322        @>PS1_V2,PS1_SV?,PS1_DV?@ source->psfFlux   = psMetadataLookupF32 (&status, row, "PSF_INST_FLUX");
     323        @>PS1_V2,PS1_SV?,PS1_DV?@ source->psfFluxErr= psMetadataLookupF32 (&status, row, "PSF_INST_FLUX_SIG");
    324324
    325325        // XXX this scaling is incorrect: does not include the 2 \pi AREA factor
     
    342342
    343343        @ALL@     source->pixWeightNotBad = psMetadataLookupF32 (&status, row, "PSF_QF");
    344         @>PS1_V2,PS1_SV1,PS1_DV2@ source->pixWeightNotPoor = psMetadataLookupF32 (&status, row, "PSF_QF_PERFECT");
     344        @>PS1_V2,PS1_SV?,>PS1_DV1@ source->pixWeightNotPoor = psMetadataLookupF32 (&status, row, "PSF_QF_PERFECT");
    345345        @ALL@     source->crNsigma  = psMetadataLookupF32 (&status, row, "CR_NSIGMA");
    346346        @ALL@     source->extNsigma = psMetadataLookupF32 (&status, row, "EXT_NSIGMA");
     
    362362        // XXX we do not save all of the 3rd and 4th moment parameters. when we load in data,
    363363        // we are storing enough information so the output will be consistent with the input
    364         @>PS1_V2,PS1_SV1@ source->moments->Mxxx = +1.0 * psMetadataLookupF32 (&status, row, "MOMENTS_M3C");
    365         @>PS1_V2,PS1_SV1@ source->moments->Mxxy = 0.0;
    366         @>PS1_V2,PS1_SV1@ source->moments->Mxyy = 0.0;
    367         @>PS1_V2,PS1_SV1@ source->moments->Myyy = -1.0 * psMetadataLookupF32 (&status, row, "MOMENTS_M3S");
    368 
    369         @>PS1_V2,PS1_SV1@ source->moments->Mxxxx = +1.00 * psMetadataLookupF32 (&status, row, "MOMENTS_M4C");
    370         @>PS1_V2,PS1_SV1@ source->moments->Mxxxy = 0.0;
    371         @>PS1_V2,PS1_SV1@ source->moments->Mxxyy = 0.0;
    372         @>PS1_V2,PS1_SV1@ source->moments->Mxyyy = -0.25 * psMetadataLookupF32 (&status, row, "MOMENTS_M4S");
    373         @>PS1_V2,PS1_SV1@ source->moments->Myyyy = 0.0;
    374 
    375         @>PS1_V2,PS1_SV1,PS1_DV2@ source->moments->Mrf         = psMetadataLookupF32 (&status, row, "MOMENTS_R1");
    376         @>PS1_V2,PS1_SV1,PS1_DV2@ source->moments->Mrh         = psMetadataLookupF32 (&status, row, "MOMENTS_RH");
    377         @>PS1_V2,PS1_SV1,PS1_DV2@ source->moments->KronFlux    = psMetadataLookupF32 (&status, row, "KRON_FLUX");
    378         @>PS1_V2,PS1_SV1,PS1_DV2@ source->moments->KronFluxErr = psMetadataLookupF32 (&status, row, "KRON_FLUX_ERR");
    379         @>PS1_V2,PS1_SV1,PS1_DV2@ source->moments->KronFinner  = psMetadataLookupF32 (&status, row, "KRON_FLUX_INNER");
    380         @>PS1_V2,PS1_SV1,PS1_DV2@ source->moments->KronFouter  = psMetadataLookupF32 (&status, row, "KRON_FLUX_OUTER");
     364        @>PS1_V2,PS1_SV?@ source->moments->Mxxx = +1.0 * psMetadataLookupF32 (&status, row, "MOMENTS_M3C");
     365        @>PS1_V2,PS1_SV?@ source->moments->Mxxy = 0.0;
     366        @>PS1_V2,PS1_SV?@ source->moments->Mxyy = 0.0;
     367        @>PS1_V2,PS1_SV?@ source->moments->Myyy = -1.0 * psMetadataLookupF32 (&status, row, "MOMENTS_M3S");
     368
     369        @>PS1_V2,PS1_SV?@ source->moments->Mxxxx = +1.00 * psMetadataLookupF32 (&status, row, "MOMENTS_M4C");
     370        @>PS1_V2,PS1_SV?@ source->moments->Mxxxy = 0.0;
     371        @>PS1_V2,PS1_SV?@ source->moments->Mxxyy = 0.0;
     372        @>PS1_V2,PS1_SV?@ source->moments->Mxyyy = -0.25 * psMetadataLookupF32 (&status, row, "MOMENTS_M4S");
     373        @>PS1_V2,PS1_SV?@ source->moments->Myyyy = 0.0;
     374
     375        @>PS1_V2,PS1_SV?,>PS1_DV1@ source->moments->Mrf         = psMetadataLookupF32 (&status, row, "MOMENTS_R1");
     376        @>PS1_V2,PS1_SV?,>PS1_DV1@ source->moments->Mrh         = psMetadataLookupF32 (&status, row, "MOMENTS_RH");
     377        @>PS1_V2,PS1_SV?,>PS1_DV1@ source->moments->KronFlux    = psMetadataLookupF32 (&status, row, "KRON_FLUX");
     378        @>PS1_V2,PS1_SV?,>PS1_DV1@ source->moments->KronFluxErr = psMetadataLookupF32 (&status, row, "KRON_FLUX_ERR");
     379        @>PS1_V2,PS1_SV?,>PS1_DV1@ source->moments->KronFinner  = psMetadataLookupF32 (&status, row, "KRON_FLUX_INNER");
     380        @>PS1_V2,PS1_SV?,>PS1_DV1@ source->moments->KronFouter  = psMetadataLookupF32 (&status, row, "KRON_FLUX_OUTER");
    381381
    382382        @>PS1_V3@ source->skyRadius            = psMetadataLookupF32 (&status, row, "SKY_LIMIT_RAD");
     
    393393        @PS1_DV?@      source->diffStats->nRatioAll  = psMetadataLookupF32 (&status, row, "DIFF_NRATIO_ALL");
    394394       
    395         @PS1_DV2@      source->diffStats->Rp         = psMetadataLookupF32 (&status, row, "DIFF_R_P");
    396         @PS1_DV2@      source->diffStats->SNp        = psMetadataLookupF32 (&status, row, "DIFF_SN_P");
    397         @PS1_DV2@      source->diffStats->Rm         = psMetadataLookupF32 (&status, row, "DIFF_R_M");
    398         @PS1_DV2@      source->diffStats->SNm        = psMetadataLookupF32 (&status, row, "DIFF_SN_M");
     395        @>PS1_DV1@      source->diffStats->Rp         = psMetadataLookupF32 (&status, row, "DIFF_R_P");
     396        @>PS1_DV1@      source->diffStats->SNp        = psMetadataLookupF32 (&status, row, "DIFF_SN_P");
     397        @>PS1_DV1@      source->diffStats->Rm         = psMetadataLookupF32 (&status, row, "DIFF_R_M");
     398        @>PS1_DV1@      source->diffStats->SNm        = psMetadataLookupF32 (&status, row, "DIFF_SN_M");
    399399        @PS1_DV?@  }
    400400
    401         @ALL@                     source->mode       = psMetadataLookupU32 (&status, row, "FLAGS");
    402         @>PS1_V2,PS1_SV1,PS1_DV2@ source->mode2      = psMetadataLookupU32 (&status, row, "FLAGS2");
    403         @ALL@                     source->nFrames    = psMetadataLookupU16 (&status, row, "N_FRAMES");
     401        @ALL@                      source->mode       = psMetadataLookupU32 (&status, row, "FLAGS");
     402        @>PS1_V2,PS1_SV?,>PS1_DV1@ source->mode2      = psMetadataLookupU32 (&status, row, "FLAGS2");
     403        @ALL@                      source->nFrames    = psMetadataLookupU16 (&status, row, "N_FRAMES");
    404404        assert (status);
    405405
     
    735735    }
    736736
     737    @>PS1_DV2@ pmChip *chip = readout->parent->parent;
     738
    737739    table = psArrayAllocEmpty (sources->n);
    738740
     
    768770            yErr = dPAR[PM_PAR_YPOS];
    769771
     772            @>PS1_DV2@ psSphere ptSky = {0.0, 0.0, 0.0, 0.0};
     773            @>PS1_DV2@ float posAngle = 0.0;
     774            @>PS1_DV2@ float pltScale = 0.0;
     775            @>PS1_DV2@ pmSourceLocalAstrometry (&ptSky, &posAngle, &pltScale, chip, xPos, yPos);
     776            @>PS1_DV2@ double raPos = ptSky.r*PS_DEG_RAD;
     777            @>PS1_DV2@ double decPos = ptSky.d*PS_DEG_RAD;
     778
    770779            float kronFlux = source->moments ? source->moments->KronFlux : NAN;
    771780            float kronMag = isfinite(kronFlux) ? -2.5*log10(kronFlux) : NAN;
     
    779788            psMetadataAddF32 (row, PS_LIST_TAIL, "X_EXT_SIG",        0, "Sigma in EXT x coordinate",                  xErr);
    780789            psMetadataAddF32 (row, PS_LIST_TAIL, "Y_EXT_SIG",        0, "Sigma in EXT y coordinate",                  yErr);
     790            @>PS1_DV2@ psMetadataAddF32 (row, PS_LIST_TAIL, "RA_EXT",           0, "EXT model ra coordinate",                    raPos);
     791            @>PS1_DV2@ psMetadataAddF32 (row, PS_LIST_TAIL, "DEC_EXT",          0, "EXT model dec coordinate",                   decPos);
    781792            psMetadataAddF32 (row, PS_LIST_TAIL, "EXT_INST_MAG",     0, "EXT fit instrumental magnitude",             model->mag);
    782793            psMetadataAddF32 (row, PS_LIST_TAIL, "EXT_INST_MAG_SIG", 0, "Sigma of PSF instrumental magnitude",        model->magErr);
     794
     795            @>PS1_DV2@ psMetadataAddF32 (row, PS_LIST_TAIL, "POSANGLE",   0, "position angle at source (degrees)",         posAngle);
     796            @>PS1_DV2@ psMetadataAddF32 (row, PS_LIST_TAIL, "PLTSCALE",   0, "plate scale at source (arcsec/pixel)",       pltScale);
    783797
    784798            // psMetadataAddF32 (row, PS_LIST_TAIL, "MOMENTS_XX",       0, "second moment in x",                      extPars->Mxx);
     
    792806            psMetadataAddF32 (row, PS_LIST_TAIL, "KRON_MAG",         0, "Kron Mag",                                   kronMag);
    793807
    794             psMetadataAddF32 (row, PS_LIST_TAIL, "NPARAMS",          0, "number of model parameters",                 model->params->n);
     808            @ALL, <PS1_DV3@ psMetadataAddF32 (row, PS_LIST_TAIL, "NPARAMS",          0, "number of model parameters",                 model->params->n);
     809            @>PS1_DV2@       psMetadataAddS32 (row, PS_LIST_TAIL, "NPARAMS",          0, "number of model parameters",                 model->params->n);
    795810            psMetadataAddStr (row, PS_LIST_TAIL, "MODEL_TYPE",       0, "name of model",                              pmModelClassGetName (model->type));
    796811
  • trunk/psModules/src/objects/pmSourceIO_CMP.c

    r34085 r34403  
    4343#include "pmSourceExtendedPars.h"
    4444#include "pmSourceDiffStats.h"
     45#include "pmSourceSatstar.h"
    4546#include "pmSource.h"
    4647#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmSourceIO_MatchedRefs.c

    r29004 r34403  
    4343#include "pmSourceExtendedPars.h"
    4444#include "pmSourceDiffStats.h"
     45#include "pmSourceSatstar.h"
    4546#include "pmSource.h"
    4647#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmSourceIO_OBJ.c

    r32347 r34403  
    4343#include "pmSourceExtendedPars.h"
    4444#include "pmSourceDiffStats.h"
     45#include "pmSourceSatstar.h"
    4546#include "pmSource.h"
    4647#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmSourceIO_PS1_CAL_0.c

    r34085 r34403  
    4343#include "pmSourceExtendedPars.h"
    4444#include "pmSourceDiffStats.h"
     45#include "pmSourceSatstar.h"
    4546#include "pmSource.h"
    4647#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmSourceIO_PS1_DEV_0.c

    r32347 r34403  
    4343#include "pmSourceExtendedPars.h"
    4444#include "pmSourceDiffStats.h"
     45#include "pmSourceSatstar.h"
    4546#include "pmSource.h"
    4647#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmSourceIO_PS1_DEV_1.c

    r32347 r34403  
    4343#include "pmSourceExtendedPars.h"
    4444#include "pmSourceDiffStats.h"
     45#include "pmSourceSatstar.h"
    4546#include "pmSource.h"
    4647#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmSourceIO_RAW.c

    r31451 r34403  
    4343#include "pmSourceExtendedPars.h"
    4444#include "pmSourceDiffStats.h"
     45#include "pmSourceSatstar.h"
    4546#include "pmSource.h"
    4647#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmSourceIO_SMPDATA.c

    r34085 r34403  
    4343#include "pmSourceExtendedPars.h"
    4444#include "pmSourceDiffStats.h"
     45#include "pmSourceSatstar.h"
    4546#include "pmSource.h"
    4647#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmSourceIO_SX.c

    r34085 r34403  
    4343#include "pmSourceExtendedPars.h"
    4444#include "pmSourceDiffStats.h"
     45#include "pmSourceSatstar.h"
    4546#include "pmSource.h"
    4647#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmSourceMasks.h

    r32808 r34403  
    55// When adding to or subtracting from this list, please also modify pmSourceMaskHeader
    66typedef enum {
    7     PM_SOURCE_MODE_DEFAULT          = 0x00000000, ///< Initial value: resets all bits
    8     PM_SOURCE_MODE_PSFMODEL         = 0x00000001, ///< Source fitted with a psf model (linear or non-linear)
    9     PM_SOURCE_MODE_EXTMODEL         = 0x00000002, ///< Source fitted with an extended-source model
    10     PM_SOURCE_MODE_FITTED           = 0x00000004, ///< Source fitted with non-linear model (PSF or EXT; good or bad)
    11     PM_SOURCE_MODE_FAIL             = 0x00000008, ///< Fit (non-linear) failed (non-converge, off-edge, run to zero)
    12     PM_SOURCE_MODE_POOR             = 0x00000010, ///< Fit succeeds, but low-SN, high-Chisq, or large (for PSF -- drop?)
    13     PM_SOURCE_MODE_PAIR             = 0x00000020, ///< Source fitted with a double psf
    14     PM_SOURCE_MODE_PSFSTAR          = 0x00000040, ///< Source used to define PSF model
    15     PM_SOURCE_MODE_SATSTAR          = 0x00000080, ///< Source model peak is above saturation
    16     PM_SOURCE_MODE_BLEND            = 0x00000100, ///< Source is a blend with other sources
    17     PM_SOURCE_MODE_EXTERNAL         = 0x00000200, ///< Source based on supplied input position
    18     PM_SOURCE_MODE_BADPSF           = 0x00000400, ///< Failed to get good estimate of object's PSF
    19     PM_SOURCE_MODE_DEFECT           = 0x00000800, ///< Source is thought to be a defect
    20     PM_SOURCE_MODE_SATURATED        = 0x00001000, ///< Source is thought to be saturated pixels (bleed trail)
    21     PM_SOURCE_MODE_CR_LIMIT         = 0x00002000, ///< Source has crNsigma above limit
    22     PM_SOURCE_MODE_EXT_LIMIT        = 0x00004000, ///< Source has extNsigma above limit
    23     PM_SOURCE_MODE_MOMENTS_FAILURE  = 0x00008000, ///< could not measure the moments
    24     PM_SOURCE_MODE_SKY_FAILURE      = 0x00010000, ///< could not measure the local sky
    25     PM_SOURCE_MODE_SKYVAR_FAILURE   = 0x00020000, ///< could not measure the local sky variance
    26     PM_SOURCE_MODE_BELOW_MOMENTS_SN = 0x00040000, ///< moments not measured due to low S/N
    27     PM_SOURCE_MODE_BIG_RADIUS       = 0x00100000, ///< poor moments for small radius, try large radius
    28     PM_SOURCE_MODE_AP_MAGS          = 0x00200000, ///< source has an aperture magnitude
    29     PM_SOURCE_MODE_BLEND_FIT        = 0x00400000, ///< source was fitted as a blend
    30     PM_SOURCE_MODE_EXTENDED_FIT     = 0x00800000, ///< full extended fit was used
    31     PM_SOURCE_MODE_EXTENDED_STATS   = 0x01000000, ///< extended aperture stats calculated
    32     PM_SOURCE_MODE_LINEAR_FIT       = 0x02000000, ///< source fitted with the linear fit
    33     PM_SOURCE_MODE_NONLINEAR_FIT    = 0x04000000, ///< source fitted with the non-linear fit
    34     PM_SOURCE_MODE_RADIAL_FLUX      = 0x08000000, ///< radial flux measurements calculated
    35     PM_SOURCE_MODE_SIZE_SKIPPED     = 0x10000000, ///< size could not be determined
    36     PM_SOURCE_MODE_ON_SPIKE         = 0x20000000, ///< peak lands on diffraction spike
    37     PM_SOURCE_MODE_ON_GHOST         = 0x40000000, ///< peak lands on ghost or glint
    38     PM_SOURCE_MODE_OFF_CHIP         = 0x80000000, ///< peak lands off edge of chip
     7    PM_SOURCE_MODE_DEFAULT                = 0x00000000, ///< Initial value: resets all bits
     8    PM_SOURCE_MODE_PSFMODEL               = 0x00000001, ///< Source fitted with a psf model (linear or non-linear)
     9    PM_SOURCE_MODE_EXTMODEL               = 0x00000002, ///< Source fitted with an extended-source model
     10    PM_SOURCE_MODE_FITTED                 = 0x00000004, ///< Source fitted with non-linear model (PSF or EXT; good or bad)
     11    PM_SOURCE_MODE_FAIL                   = 0x00000008, ///< Fit (non-linear) failed (non-converge, off-edge, run to zero)
     12    PM_SOURCE_MODE_POOR                   = 0x00000010, ///< Fit succeeds, but low-SN, high-Chisq, or large (for PSF -- drop?)
     13    PM_SOURCE_MODE_PAIR                   = 0x00000020, ///< Source fitted with a double psf
     14    PM_SOURCE_MODE_PSFSTAR                = 0x00000040, ///< Source used to define PSF model
     15    PM_SOURCE_MODE_SATSTAR                = 0x00000080, ///< Source model peak is above saturation
     16    PM_SOURCE_MODE_BLEND                  = 0x00000100, ///< Source is a blend with other sources
     17    PM_SOURCE_MODE_EXTERNAL               = 0x00000200, ///< Source based on supplied input position
     18    PM_SOURCE_MODE_BADPSF                 = 0x00000400, ///< Failed to get good estimate of object's PSF
     19    PM_SOURCE_MODE_DEFECT                 = 0x00000800, ///< Source is thought to be a defect
     20    PM_SOURCE_MODE_SATURATED              = 0x00001000, ///< Source is thought to be saturated pixels (bleed trail)
     21    PM_SOURCE_MODE_CR_LIMIT               = 0x00002000, ///< Source has crNsigma above limit
     22    PM_SOURCE_MODE_EXT_LIMIT              = 0x00004000, ///< Source has extNsigma above limit
     23    PM_SOURCE_MODE_MOMENTS_FAILURE        = 0x00008000, ///< could not measure the moments
     24    PM_SOURCE_MODE_SKY_FAILURE            = 0x00010000, ///< could not measure the local sky
     25    PM_SOURCE_MODE_SKYVAR_FAILURE         = 0x00020000, ///< could not measure the local sky variance
     26    PM_SOURCE_MODE_BELOW_MOMENTS_SN       = 0x00040000, ///< moments not measured due to low S/N
     27    PM_SOURCE_MODE_BIG_RADIUS             = 0x00100000, ///< poor moments for small radius, try large radius
     28    PM_SOURCE_MODE_AP_MAGS                = 0x00200000, ///< source has an aperture magnitude
     29    PM_SOURCE_MODE_BLEND_FIT              = 0x00400000, ///< source was fitted as a blend
     30    PM_SOURCE_MODE_EXTENDED_FIT           = 0x00800000, ///< full extended fit was used
     31    PM_SOURCE_MODE_EXTENDED_STATS         = 0x01000000, ///< extended aperture stats calculated
     32    PM_SOURCE_MODE_LINEAR_FIT             = 0x02000000, ///< source fitted with the linear fit
     33    PM_SOURCE_MODE_NONLINEAR_FIT          = 0x04000000, ///< source fitted with the non-linear fit
     34    PM_SOURCE_MODE_RADIAL_FLUX            = 0x08000000, ///< radial flux measurements calculated
     35    PM_SOURCE_MODE_SIZE_SKIPPED           = 0x10000000, ///< size could not be determined
     36    PM_SOURCE_MODE_ON_SPIKE               = 0x20000000, ///< peak lands on diffraction spike
     37    PM_SOURCE_MODE_ON_GHOST               = 0x40000000, ///< peak lands on ghost or glint
     38    PM_SOURCE_MODE_OFF_CHIP               = 0x80000000, ///< peak lands off edge of chip
    3939} pmSourceMode;
    4040
     
    4242// When adding to or subtracting from this list, please also modify pmSourceMaskHeader
    4343typedef enum {
    44     PM_SOURCE_MODE2_DEFAULT          = 0x00000000, ///< Initial value: resets all bits
    45     PM_SOURCE_MODE2_DIFF_WITH_SINGLE = 0x00000001, ///< diff source matched to a single positive detection
    46     PM_SOURCE_MODE2_DIFF_WITH_DOUBLE = 0x00000002, ///< diff source matched to positive detections in both images
    47     PM_SOURCE_MODE2_MATCHED          = 0x00000004, ///< diff source matched to positive detections in both images
    48     PM_SOURCE_MODE2_DIFF_SELF_MATCH  = 0x00000800, ///< positive detection match is probably this source
    49 
    50     PM_SOURCE_MODE2_ON_SPIKE         = 0x00000008, ///< > 25% of (PSF-weighted) pixels land on diffraction spike
    51     PM_SOURCE_MODE2_ON_STARCORE      = 0x00000010, ///< > 25% of (PSF-weighted) pixels land on starcore
    52     PM_SOURCE_MODE2_ON_BURNTOOL      = 0x00000020, ///< > 25% of (PSF-weighted) pixels land on burntool
    53     PM_SOURCE_MODE2_ON_CONVPOOR      = 0x00000040, ///< > 25% of (PSF-weighted) pixels land on convpoor
    54 
    55     PM_SOURCE_MODE2_PASS1_SRC        = 0x00000080, ///< source detected in first pass analysis
    56 
     44    PM_SOURCE_MODE2_DEFAULT               = 0x00000000, ///< Initial value: resets all bits
     45    PM_SOURCE_MODE2_DIFF_WITH_SINGLE      = 0x00000001, ///< diff source matched to a single positive detection
     46    PM_SOURCE_MODE2_DIFF_WITH_DOUBLE      = 0x00000002, ///< diff source matched to positive detections in both images
     47    PM_SOURCE_MODE2_MATCHED               = 0x00000004, ///< diff source matched to positive detections in both images
     48    PM_SOURCE_MODE2_ON_SPIKE              = 0x00000008, ///< > 25% of (PSF-weighted) pixels land on diffraction spike
     49    PM_SOURCE_MODE2_ON_STARCORE           = 0x00000010, ///< > 25% of (PSF-weighted) pixels land on starcore
     50    PM_SOURCE_MODE2_ON_BURNTOOL           = 0x00000020, ///< > 25% of (PSF-weighted) pixels land on burntool
     51    PM_SOURCE_MODE2_ON_CONVPOOR           = 0x00000040, ///< > 25% of (PSF-weighted) pixels land on convpoor
     52    PM_SOURCE_MODE2_PASS1_SRC             = 0x00000080, ///< source detected in first pass analysis
    5753    PM_SOURCE_MODE2_HAS_BRIGHTER_NEIGHBOR = 0x00000100, ///< peak is not the brightest in its footprint
    5854    PM_SOURCE_MODE2_BRIGHT_NEIGHBOR_1     = 0x00000200, ///< flux_n / (r^2 flux_p) > 1
    5955    PM_SOURCE_MODE2_BRIGHT_NEIGHBOR_10    = 0x00000400, ///< flux_n / (r^2 flux_p) > 10
     56    PM_SOURCE_MODE2_DIFF_SELF_MATCH       = 0x00000800, ///< positive detection match is probably this source
     57    PM_SOURCE_MODE2_SATSTAR_PROFILE       = 0x00001000, ///< saturated source is modeled with a radial profile
    6058} pmSourceMode2;
    6159
  • trunk/psModules/src/objects/pmSourceMatch.c

    r32046 r34403  
    2424#include "pmSourceExtendedPars.h"
    2525#include "pmSourceDiffStats.h"
     26#include "pmSourceSatstar.h"
    2627#include "pmSource.h"
    2728#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmSourceMoments.c

    r33838 r34403  
    4141#include "pmSourceExtendedPars.h"
    4242#include "pmSourceDiffStats.h"
     43#include "pmSourceSatstar.h"
    4344#include "pmSource.h"
    4445
  • trunk/psModules/src/objects/pmSourceOutputs.c

    r33690 r34403  
    3232#include "pmSourceExtendedPars.h"
    3333#include "pmSourceDiffStats.h"
     34#include "pmSourceSatstar.h"
    3435#include "pmSource.h"
    3536#include "pmSourceFitModel.h"
     
    226227    *pltScale = 0.5*(pltScale_x + pltScale_y);
    227228
     229    float crossProduct = dTPx_dCHx * dTPy_dCHy - dTPx_dCHy * dTPy_dCHx;
     230    if  (crossProduct > 0.) {
     231      *pltScale *= -1.0;
     232    }
     233
    228234    float posAngle_x = atan2 (+dTPy_dCHx, +dTPx_dCHx);
    229235    float posAngle_y = atan2 (-dTPy_dCHy, +dTPx_dCHy);
  • trunk/psModules/src/objects/pmSourcePhotometry.c

    r34085 r34403  
    3939#include "pmSourceExtendedPars.h"
    4040#include "pmSourceDiffStats.h"
     41#include "pmSourceSatstar.h"
    4142#include "pmSource.h"
    4243#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmSourcePlotApResid.c

    r29004 r34403  
    4141#include "pmSourceExtendedPars.h"
    4242#include "pmSourceDiffStats.h"
     43#include "pmSourceSatstar.h"
    4344#include "pmSource.h"
    4445#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmSourcePlotMoments.c

    r29004 r34403  
    4444#include "pmSourceExtendedPars.h"
    4545#include "pmSourceDiffStats.h"
     46#include "pmSourceSatstar.h"
    4647#include "pmSource.h"
    4748#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmSourcePlotPSFModel.c

    r32347 r34403  
    4545#include "pmSourceExtendedPars.h"
    4646#include "pmSourceDiffStats.h"
     47#include "pmSourceSatstar.h"
    4748#include "pmSource.h"
    4849#include "pmSourceFitModel.h"
  • trunk/psModules/src/objects/pmSourceSky.c

    r29004 r34403  
    4040#include "pmSourceExtendedPars.h"
    4141#include "pmSourceDiffStats.h"
     42#include "pmSourceSatstar.h"
    4243#include "pmSource.h"
    4344
  • trunk/psModules/src/objects/pmSourceUtils.c

    r29004 r34403  
    4040#include "pmSourceExtendedPars.h"
    4141#include "pmSourceDiffStats.h"
     42#include "pmSourceSatstar.h"
    4243#include "pmSource.h"
    4344
  • trunk/psModules/src/objects/pmSourceVisual.c

    r31153 r34403  
    2222#include "pmSourceExtendedPars.h"
    2323#include "pmSourceDiffStats.h"
     24#include "pmSourceSatstar.h"
    2425#include "pmSource.h"
    2526#include "pmSourceFitModel.h"
  • trunk/psModules/src/psmodules.h

    r31451 r34403  
    132132#include <pmSourceMasks.h>
    133133#include <pmSourceExtendedPars.h>
     134#include <pmSourceSatstar.h>
    134135#include <pmSourceDiffStats.h>
    135136#include <pmSource.h>
Note: See TracChangeset for help on using the changeset viewer.