IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26691


Ignore:
Timestamp:
Jan 27, 2010, 9:17:17 AM (16 years ago)
Author:
eugene
Message:

build works

Location:
branches/eam_branches/psphot.stack.20100120/src
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/psphot.stack.20100120/src/Makefile.am

    r26688 r26691  
    2525libpsphot_la_LDFLAGS = $(PSPHOT_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS)
    2626
    27 bin_PROGRAMS = psphot psphotForced psphotMakePSF psphotTest psphotMomentsStudy
    28 # bin_PROGRAMS = psphotPetrosianStudy
    29 # bin_PROGRAMS = psphot
     27bin_PROGRAMS = psphot
     28# bin_PROGRAMS = psphotPetrosianStudy psphotForced psphotMakePSF psphotTest psphotMomentsStudy
    3029
    3130psphot_CFLAGS = $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS)
     
    113112        psphotDefineFiles.c            \
    114113        psphotReadout.c                \
    115         psphotReadoutFindPSF.c         \
    116         psphotReadoutKnownSources.c    \
    117         psphotReadoutMinimal.c         \
    118114        psphotModelBackground.c        \
    119115        psphotSubtractBackground.c     \
     
    146142        psphotKernelFromPSF.c          \
    147143        psphotPSFConvModel.c           \
    148         psphotModelTest.c              \
    149144        psphotFitSet.c                 \
    150145        psphotSourceFreePixels.c       \
     
    175170        psphotEfficiency.c
    176171
     172# XXX need to fix these for the new apis
     173#       psphotReadoutFindPSF.c         
     174#       psphotReadoutKnownSources.c   
     175#       psphotReadoutMinimal.c         
     176#       psphotModelTest.c             
     177
    177178# re-instate these
    178179#       psphotIsophotal.c              \
  • branches/eam_branches/psphot.stack.20100120/src/psphot.h

    r26688 r26691  
    3737bool            psphotReadoutMinimal(pmConfig *config, const pmFPAview *view);
    3838
    39 bool            psphotReadoutCleanup (pmConfig *config, pmReadout *readout, psMetadata *recipe, pmDetections *detections, pmPSF *psf, psArray *sources);
     39bool            psphotReadoutCleanup (pmConfig *config, const pmFPAview *view);
     40bool            psphotReadoutCleanupReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe);
     41
    4042bool            psphotDefineFiles (pmConfig *config, pmFPAfile *input);
    4143void            psphotFilesActivate(pmConfig *config, bool state);
     
    5254bool            psphotAddPhotcodeReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int index);
    5355
    54 bool            psphotSetMaskAndVariance (pmConfig *config, const pmFPAview *view, psMetadata *recipe);
     56bool            psphotSetMaskAndVariance (pmConfig *config, const pmFPAview *view);
    5557bool            psphotSetMaskAndVarianceReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe);
    5658
     
    7173
    7274bool            psphotBasicDeblend (pmConfig *config, const pmFPAview *view);
    73 bool            psphotBasicDeblend (pmConfig *config, const pmFPAview *view, const char *filename, int index);
     75bool            psphotBasicDeblendReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index);
    7476
    7577bool            psphotRoughClass (pmConfig *config, const pmFPAview *view);
     
    9092
    9193bool            psphotFitSourcesLinear (pmConfig *config, const pmFPAview *view, bool final);
    92 bool            psphotFitSourcesLinearReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index);
     94bool            psphotFitSourcesLinearReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, bool final);
    9395
    9496bool            psphotSourceSize (pmConfig *config, const pmFPAview *view, bool getPSFsize);
     
    114116
    115117bool            psphotApResid (pmConfig *config, const pmFPAview *view);
    116 bool            psphotApResid (pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe);
     118bool            psphotApResidReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe);
    117119
    118120bool            psphotMagnitudes (pmConfig *config, const pmFPAview *view);
     
    162164bool            psphotRemoveAllSources (const psArray *sources, const psMetadata *recipe);
    163165bool            psphotReplaceUnfitSources (psArray *sources, psImageMaskType maskVal);
    164 bool            psphotReplaceUnfitSources (psArray *sources, psImageMaskType maskVal);
    165 
    166 bool            psphotReplaceAllSources (psArray *sources, psMetadata *recipe);
    167 bool            psphotRemoveAllSources (const psArray *sources, const psMetadata *recipe);
    168166
    169167// thread-related:
     
    186184void            psphotModelClassInit (void);
    187185bool            psphotGrowthCurve (pmReadout *readout, pmPSF *psf, bool ignore, psImageMaskType maskVal);
    188 void            psphotSourceFreePixels (psArray *sources);
    189186
    190187// functions to set the correct source pixels
     
    226223bool            psphotFitSummary (void);
    227224
    228 pmPSF          *psphotLoadPSF (pmConfig *config, const pmFPAview *view, psMetadata *recipe);
     225bool            psphotLoadPSF (pmConfig *config, const pmFPAview *view);
     226bool            psphotLoadPSFReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe);
     227
    229228bool            psphotSetHeaderNstars (psMetadata *recipe, psArray *sources);
    230 bool            psphotAddNoise (pmReadout *readout, const psArray *sources, const psMetadata *recipe);
    231 bool            psphotSubNoise (pmReadout *readout, const psArray *sources, const psMetadata *recipe);
    232 bool            psphotAddOrSubNoise (pmReadout *readout, const psArray *sources, const psMetadata *recipe, bool add);
    233229bool            psphotRadialPlot (int *kapa, const char *filename, pmSource *source);
    234230bool            psphotSourcePlots (pmReadout *readout, psArray *sources, psMetadata *recipe);
  • branches/eam_branches/psphot.stack.20100120/src/psphotAddNoise.c

    r26688 r26691  
    1818    psAssert (recipe, "missing recipe?");
    1919
    20     int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     20    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    2121    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
    2222
  • branches/eam_branches/psphot.stack.20100120/src/psphotApResid.c

    r26688 r26691  
    1313    psAssert (recipe, "missing recipe?");
    1414
    15     int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     15    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    1616    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
    1717
    1818    // loop over the available readouts
    1919    for (int i = 0; i < num; i++) {
    20         if (!psphottApResidReadout (config, view, "PSPHOT.INPUT", i, recipe)) {
     20        if (!psphotApResidReadout (config, view, "PSPHOT.INPUT", i, recipe)) {
    2121            psError (PSPHOT_ERR_CONFIG, false, "failed on saturated star deblend analysis for PSPHOT.INPUT entry %d", i);
    2222            return false;
     
    2626}
    2727
    28 bool psphotApResid (pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe)
     28bool psphotApResidReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe)
    2929{
    3030    int Nfail = 0;
     
    3939    // find the currently selected readout
    4040    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
    41     psAssert (readout, "missing file?");
     41    psAssert (file, "missing file?");
    4242
    4343    pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
  • branches/eam_branches/psphot.stack.20100120/src/psphotBasicDeblend.c

    r26688 r26691  
    66    bool status = true;
    77
    8     int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     8    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    99    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
    1010
     
    1919}
    2020
    21 bool psphotBasicDeblend (pmConfig *config, const pmFPAview *view, const char *filename, int index) {
     21bool psphotBasicDeblendReadout (pmConfig *config, const pmFPAview *view, const char *filename, int fileIndex) {
    2222
    2323    int N;
     
    3131
    3232    // find the currently selected readout
    33     pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
     33    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, fileIndex); // File of interest
    3434    psAssert (file, "missing file?");
    3535
  • branches/eam_branches/psphot.stack.20100120/src/psphotBlendFit.c

    r26688 r26691  
    1010    psAssert (recipe, "missing recipe?");
    1111
    12     int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     12    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    1313    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
    1414
  • branches/eam_branches/psphot.stack.20100120/src/psphotChoosePSF.c

    r26688 r26691  
    1010    psAssert (recipe, "missing recipe?");
    1111
    12     int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     12    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    1313    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
    1414
     
    2828    bool status;
    2929
    30     // do not generate a PSF if we already were supplied one
    31     if (psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF")) {
    32         psLogMsg ("psphot", PS_LOG_DETAIL, "psf model supplied for input file %d", i);
    33         return true;
    34     }
    35 
    3630    psTimerStart ("psphot.choose.psf");
    3731
     
    4236    pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
    4337    psAssert (readout, "missing readout?");
     38
     39    // do not generate a PSF if we already were supplied one
     40    if (psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF")) {
     41        psLogMsg ("psphot", PS_LOG_DETAIL, "psf model supplied for input file %d", index);
     42        return true;
     43    }
    4444
    4545    pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
     
    350350
    351351    // save PSF on readout->analysis
    352     if (!psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_DATA_PTR, "psphot psf model", psf)) {
     352    if (!psMetadataAddPtr (readout->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_META_REPLACE | PS_DATA_UNKNOWN, "psphot psf model", psf)) {
    353353        psError (PSPHOT_ERR_UNKNOWN, false, "problem saving sources on readout");
    354354        return false;
  • branches/eam_branches/psphot.stack.20100120/src/psphotDeblendSatstars.c

    r26688 r26691  
    66    bool status = true;
    77
    8     int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     8    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    99    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
    1010
     
    1919}
    2020
    21 bool psphotDeblendSatstarsReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index) {
     21bool psphotDeblendSatstarsReadout (pmConfig *config, const pmFPAview *view, const char *filename, int fileIndex) {
    2222
    2323    int N;
    2424    pmSource *source;
     25    bool status;
    2526
    2627    psTimerStart ("psphot.deblend.sat");
     
    3031
    3132    // find the currently selected readout
    32     pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
     33    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, fileIndex); // File of interest
    3334    psAssert (file, "missing file?");
    3435
     
    5152    psAssert (recipe, "missing recipe?");
    5253
    53     bool status;
    5454    pmCell *cell = readout->parent;
    5555    float SATURATION = 0.75*psMetadataLookupF32 (&status, cell->concepts, "CELL.SATURATION");
  • branches/eam_branches/psphot.stack.20100120/src/psphotEfficiency.c

    r26688 r26691  
    66//#define TESTING
    77
     8
     9# if 0
    810
    911// Calculate the limiting magnitude for an image
     
    148150}
    149151
     152# endif
    150153
    151154bool psphotEfficiency (pmConfig *config, const pmFPAview *view)
     
    157160    psAssert (recipe, "missing recipe?");
    158161
    159     int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     162    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    160163    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
    161164
    162165    // loop over the available readouts
    163166    for (int i = 0; i < num; i++) {
    164         if (!psphotReadout (config, view, "PSPHOT.INPUT", i, recipe)) {
     167        if (!psphotEfficiencyReadout (config, view, "PSPHOT.INPUT", i, recipe)) {
    165168            psError (PSPHOT_ERR_CONFIG, false, "failed on saturated star deblend analysis for PSPHOT.INPUT entry %d", i);
    166169            return false;
     
    173176bool psphotEfficiencyReadout(pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe)
    174177{
     178# if 0
     179    bool status = true;
     180
    175181    psTimerStart("psphot.fake");
    176182
    177183    // find the currently selected readout
    178184    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
    179     psAssert (readout, "missing file?");
     185    psAssert (file, "missing file?");
    180186
    181187    pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
     
    512518    psLogMsg("psphot", PS_LOG_INFO, "Detection efficiency: %lf sec\n", psTimerClear("psphot.fake"));
    513519
     520# endif
    514521
    515522    return true;
  • branches/eam_branches/psphot.stack.20100120/src/psphotExtendedSourceAnalysis.c

    r26688 r26691  
    1616    }
    1717
    18     int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     18    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    1919    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
    2020
     
    4141    // find the currently selected readout
    4242    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
    43     psAssert (readout, "missing file?");
     43    psAssert (file, "missing file?");
    4444
    4545    pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
  • branches/eam_branches/psphot.stack.20100120/src/psphotExtendedSourceFits.c

    r26688 r26691  
    1616    }
    1717
    18     int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     18    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    1919    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
    2020
     
    4242    // find the currently selected readout
    4343    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
    44     psAssert (readout, "missing file?");
     44    psAssert (file, "missing file?");
    4545
    4646    pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
  • branches/eam_branches/psphot.stack.20100120/src/psphotFindDetections.c

    r26688 r26691  
    1212    psAssert (recipe, "missing recipe?");
    1313
    14     int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     14    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    1515    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
    1616
     
    5454       
    5555        // save detections on the readout->analysis
    56         if (!psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_DATA_PTR, "psphot detectinos", detections)) {
     56        if (!psMetadataAddPtr (readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_META_REPLACE | PS_DATA_UNKNOWN, "psphot detectinos", detections)) {
    5757            psError (PSPHOT_ERR_CONFIG, false, "problem saving detections on readout");
    5858            return false;
  • branches/eam_branches/psphot.stack.20100120/src/psphotFitSourcesLinear.c

    r26688 r26691  
    1717    bool status = true;
    1818
    19     int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     19    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    2020    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
    2121
     
    3030}
    3131
    32 bool psphotFitSourcesLinearReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index) {
     32bool psphotFitSourcesLinearReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, bool final) {
    3333
    3434    bool status;
  • branches/eam_branches/psphot.stack.20100120/src/psphotGuessModels.c

    r26688 r26691  
    1212    bool status = true;
    1313
    14     int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     14    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    1515    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
    1616
     
    3434    // find the currently selected readout
    3535    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
    36     psAssert (readout, "missing file?");
     36    psAssert (file, "missing file?");
    3737
    3838    pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
  • branches/eam_branches/psphot.stack.20100120/src/psphotImageQuality.c

    r26688 r26691  
    1313    psAssert (recipe, "missing recipe?");
    1414
    15     int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     15    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    1616    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
    1717
     
    2929bool psphotImageQualityReadout(pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe)
    3030{
     31    bool status = true;
     32
    3133    // find the currently selected readout
    3234    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
  • branches/eam_branches/psphot.stack.20100120/src/psphotLoadPSF.c

    r26681 r26691  
    22
    33// load an externally supplied psf model
    4 pmPSF *psphotLoadPSFReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe) {
     4bool psphotLoadPSFReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe) {
     5
     6    bool status;
    57
    68    // find the currently selected readout
    79    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
    8     psAssert (readout, "missing file?");
     10    psAssert (file, "missing file?");
    911
    1012    // find the currently selected chip
     
    1315
    1416    // find the currently selected readout
    15     pmReadout *readout = pmFPAfileThisReadout (view, file->fpa);
     17    pmReadout *readout = pmFPAviewThisReadout (view, file->fpa);
    1618    if (!readout) return false;
    1719
    1820    // check if a PSF model is supplied by the user
    19     pmPSF *psf = psMetadataLookupPtr (NULL, chip->analysis, "PSPHOT.PSF");
     21    pmPSF *psf = psMetadataLookupPtr (&status, chip->analysis, "PSPHOT.PSF");
    2022    if (psf == NULL) {
    2123        psLogMsg ("psphot", 3, "no psf supplied for this chip");
     
    3032
    3133    // save PSF on readout->analysis
    32     if (!psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_DATA_PTR, "psphot psf model", psf)) {
     34    if (!psMetadataAddPtr (readout->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_META_REPLACE | PS_DATA_UNKNOWN, "psphot psf model", psf)) {
    3335        psError (PSPHOT_ERR_UNKNOWN, false, "problem saving sources on readout");
    3436        return false;
  • branches/eam_branches/psphot.stack.20100120/src/psphotMagnitudes.c

    r26688 r26691  
    99    psAssert (recipe, "missing recipe?");
    1010
    11     int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     11    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    1212    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
    1313
     
    3131    // find the currently selected readout
    3232    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
    33     psAssert (readout, "missing file?");
     33    psAssert (file, "missing file?");
    3434
    3535    pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
  • branches/eam_branches/psphot.stack.20100120/src/psphotMaskReadout.c

    r26681 r26691  
    1616
    1717        // Generate the mask and weight images, including the user-defined analysis region of interest
    18         if (!psphotSetMaskAndVarianceReadout (config, readout, recipe)) {
     18        if (!psphotSetMaskAndVarianceReadout (config, view, "PSPHOT.INPUT", i, recipe)) {
    1919            psError (PSPHOT_ERR_CONFIG, false, "failed to generate mask for PSPHOT.INPUT entry %d", i);
    2020            return false;
    2121        }
    22 
    23         // display the image, weight, mask (ch 1,2,3)
    24         psphotVisualShowImage (readout);
    2522    }
    2623    return true;
  • branches/eam_branches/psphot.stack.20100120/src/psphotMergeSources.c

    r26688 r26691  
    1010    bool status = true;
    1111
    12     int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     12    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    1313    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
    1414
     
    2626bool psphotMergeSourcesReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index) {
    2727
     28    bool status;
     29
    2830    // find the currently selected readout
    2931    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
     
    8082                source->modelPSF = NULL;
    8183            }
    82             psphotMergeSources (sources, extSourcesCMF);
     84            // XXX psphotMergeSources (sources, extSourcesCMF);
    8385        }
    8486    }
     
    101103                source->modelPSF = NULL;
    102104            }
    103             psphotMergeSources (sources, extSourcesTXT);
     105            // XXX psphotMergeSources (sources, extSourcesTXT);
    104106        }
    105107    }
  • branches/eam_branches/psphot.stack.20100120/src/psphotReadout.c

    r26688 r26691  
    127127    // merge the newly selected sources into the existing list
    128128    // NOTE: merge OLD and NEW
    129     psphotMergeSources (config, view); FIX:
     129    psphotMergeSources (config, view);
    130130
    131131    // linear PSF fit to source peaks, subtract the models from the image (in PSF mask)
     
    186186    // merge the newly selected sources into the existing list
    187187    // NOTE: merge OLD and NEW
    188     psphotMergeSources (config, view); FIX: // (detections->newSources + detections->allSources -> detections->allSources)
     188    // XXX check on free of sources...
     189    psphotMergeSources (config, view); // (detections->newSources + detections->allSources -> detections->allSources)
    189190
    190191    // NOTE: apply to ALL sources
  • branches/eam_branches/psphot.stack.20100120/src/psphotReadoutCleanup.c

    r26688 r26691  
    1515    }
    1616
    17     int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     17    // select the appropriate recipe information
     18    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
     19    psAssert (recipe, "missing recipe?");
     20
     21    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    1822    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
    1923
    2024    // loop over the available readouts
    2125    for (int i = 0; i < num; i++) {
    22         if (!psphotReadoutCleanupReadout (config, view, "PSPHOT.INPUT", i)) {
     26        if (!psphotReadoutCleanupReadout (config, view, "PSPHOT.INPUT", i, recipe)) {
    2327            psError (PSPHOT_ERR_CONFIG, false, "failed on psphotReadoutCleanup for PSPHOT.INPUT entry %d", i);
    2428            return false;
     
    3539// not a DATA error, then there was a serious problem.  Only in this case, or if the fail
    3640// on the stats measurement, do we return false
    37 bool psphotReadoutCleanupReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index) {
     41bool psphotReadoutCleanupReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe) {
    3842
    39     pmReadout *readout, psMetadata *recipe, pmDetections *detections, pmPSF *psf, psArray *sources;
    40 
    41     // select the appropriate recipe information
    42     psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
    43     psAssert (recipe, "missing recipe?");
     43    bool status = true;
    4444
    4545    // find the currently selected readout
    4646    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
    47     psAssert (readout, "missing file?");
     47    psAssert (file, "missing file?");
    4848
    4949    pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
     
    5151
    5252    // when psphotReadoutCleanup is called, these are not necessarily defined
    53     pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF");
     53    pmPSF        *psf        = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF");
    5454    pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
    55     psArray *sources = detections->allSources;
     55    psArray      *sources    = detections->allSources;
    5656    // XXX where do we free these, in here (psMetadataRemove?)
    5757
  • branches/eam_branches/psphot.stack.20100120/src/psphotReplaceUnfit.c

    r26688 r26691  
    3131    psAssert (recipe, "missing recipe?");
    3232
    33     int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     33    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    3434    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
    3535
  • branches/eam_branches/psphot.stack.20100120/src/psphotRoughClass.c

    r26688 r26691  
    1616    psAssert (recipe, "missing recipe?");
    1717
    18     int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     18    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    1919    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
    2020
  • branches/eam_branches/psphot.stack.20100120/src/psphotSkyReplace.c

    r26688 r26691  
    55    bool status = true;
    66
    7     int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     7    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    88    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
    99
    1010    // loop over the available readouts
    1111    for (int i = 0; i < num; i++) {
    12         if (!psphotReadout (config, view, "PSPHOT.INPUT", i)) {
     12        if (!psphotSkyReplaceReadout (config, view, "PSPHOT.INPUT", i)) {
    1313            psError (PSPHOT_ERR_CONFIG, false, "failed on saturated star deblend analysis for PSPHOT.INPUT entry %d", i);
    1414            return false;
     
    2626    // find the currently selected readout
    2727    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
    28     psAssert (readout, "missing file?");
     28    psAssert (file, "missing file?");
    2929
    3030    pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
  • branches/eam_branches/psphot.stack.20100120/src/psphotSourceFreePixels.c

    r26688 r26691  
    55    bool status = true;
    66
    7     int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     7    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    88    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
    99
     
    2020bool psphotSourceFreePixelsReadout(pmConfig *config, const pmFPAview *view, const char *filename, int index) {
    2121
     22    bool status;
     23
    2224    // find the currently selected readout
    2325    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
    24     psAssert (readout, "missing file?");
     26    psAssert (file, "missing file?");
    2527
    2628    pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
  • branches/eam_branches/psphot.stack.20100120/src/psphotSourceSize.c

    r26688 r26691  
    3838    psAssert (recipe, "missing recipe?");
    3939
    40     int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     40    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    4141    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
    4242
     
    6161    // find the currently selected readout
    6262    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
    63     psAssert (readout, "missing file?");
     63    psAssert (file, "missing file?");
    6464
    6565    pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
     
    131131    psphotSourceSizeCR (readout, sources, &options);
    132132
    133     psLogMsg ("psphot.size", PS_LOG_INFO, "measure source sizes for %ld sources: %f sec\n", sources->n - first, psTimerMark ("psphot.size"));
     133    // XXX fix this (was source->n  - first)
     134    psLogMsg ("psphot.size", PS_LOG_INFO, "measure source sizes for %ld sources: %f sec\n", sources->n, psTimerMark ("psphot.size"));
    134135
    135136    psphotVisualPlotSourceSize (recipe, readout->analysis, sources);
     
    633634/**** ------ old versions of cosmic ray masking ----- ****/
    634635
     636bool psphotMaskCosmicRayIsophot (pmSource *source, psImageMaskType maskVal, psImageMaskType crMask);
     637
    635638// This attempt to mask the cosmic rays used the isophotal boundary
    636639bool psphotMaskCosmicRay_V1 (psImage *mask, pmSource *source, psImageMaskType maskVal, psImageMaskType crMask) {
  • branches/eam_branches/psphot.stack.20100120/src/psphotSourceStats.c

    r26688 r26691  
    1111    psAssert (recipe, "missing recipe?");
    1212
    13     int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     13    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    1414    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
    1515
Note: See TracChangeset for help on using the changeset viewer.