IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26523


Ignore:
Timestamp:
Jan 6, 2010, 11:41:09 AM (16 years ago)
Author:
eugene
Message:

starting work on psphotStack

Location:
branches/eam_branches/20091201
Files:
7 added
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/psModules/src/objects/pmSource.c

    r25754 r26523  
    33 *  Functions to define and manipulate sources on images
    44 *
    5  *  @author GLG, MHPCC
    6  *  @author EAM, IfA: significant modifications.
     5 *  @author EAM, IfA
     6 *  @author GLG, MHPCC (initial code base)
    77 *
    88 *  @version $Revision: 1.70 $ $Name: not supported by cvs2svn $
    99 *  @date $Date: 2009-02-16 22:29:59 $
    10  *
    11  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    12  *
     10 *  Copyright 2009 Institute for Astronomy, University of Hawaii
    1311 */
    1412
  • branches/eam_branches/20091201/psphot/src/psphotMaskReadout.c

    r25755 r26523  
    7575    return true;
    7676}
     77
     78bool psphotStackSetMaskAndVariance (pmConfig *config, const pmFPAview *view, psMetadata *recipe) {
     79
     80    int num = psMetadataAddS32 (&status, config->arguments, "INPUTS.NUM");
     81    psAbort (!status, "programming error: must define INPUTS.NUM");
     82
     83    // loop over the available readouts
     84    for (int i = 0; i < num; i++) {
     85
     86        pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PSPHOT.INPUT", i); // File of interest
     87
     88        // find the currently selected readout
     89        pmReadout  *readout = pmFPAviewThisReadout (view, file->fpa);
     90        PS_ASSERT_PTR_NON_NULL (readout, false);
     91
     92        // Generate the mask and weight images, including the user-defined analysis region of interest
     93        psphotSetMaskAndVariance (config, readout, recipe);
     94
     95        // display the image, weight, mask (ch 1,2,3)
     96        psphotVisualShowImage (readout);
     97    }
     98
     99}
  • branches/eam_branches/20091201/psphot/src/psphotModelBackground.c

    r25971 r26523  
    328328}
    329329
    330 
     330// XXX these two functions are absurdly-named and very similar -- fix!
    331331
    332332psImage *psphotBackgroundModel(pmReadout *ro, const pmConfig *config)
     
    376376    return true;
    377377}
     378
     379// XXX supply filename or keep PSPHOT.INPUT fixed?
     380bool psphotStackModelBackground (pmConfig *config, const pmFPAview *view)
     381{
     382    bool status = true;
     383
     384    int num = psMetadataAddS32 (&status, config->arguments, "INPUTS.NUM");
     385    psAbort (!status, "programming error: must define INPUTS.NUM");
     386
     387    // loop over the available readouts
     388    for (int i = 0; i < num; i++) {
     389
     390        pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PSPHOT.INPUT", i); // File of interest
     391
     392        // find the currently selected readout
     393        pmReadout  *readout = pmFPAviewThisReadout (view, file->fpa);
     394        PS_ASSERT_PTR_NON_NULL (readout, false);
     395
     396        psImageBinning *binning = psphotBackgroundBinning(readout->image, config); // Image binning parameters
     397        pmReadout *model = pmFPAGenerateReadout(config, view, "PSPHOT.BACKMDL", inFPA, binning); // this needs to be a MULTI like PSPHOT.INPUT
     398        pmReadout *modelStdev = pmFPAGenerateReadout(config, view, "PSPHOT.BACKMDL.STDEV", inFPA, binning); // this needs to be a MULTI like PSPHOT.INPUT
     399
     400        // XXX save results on model->analysis or readout->analysis??
     401        if (!backgroundModel(model->image, modelStdev->image, model->analysis, readout, binning, config)) {
     402            psError(PS_ERR_UNKNOWN, false, "Unable to generate background model");
     403            return false;
     404        }
     405        npass ++;
     406    }
     407    return true;
     408}
  • branches/eam_branches/20091201/psphot/src/psphotSubtractBackground.c

    r23287 r26523  
    112112    return true;
    113113}
     114
     115// XXX supply filename or keep PSPHOT.INPUT fixed?
     116bool psphotStackSubtractBackground (pmConfig *config, const pmFPAview *view)
     117{
     118    bool status = true;
     119
     120    int num = psMetadataAddS32 (&status, config->arguments, "INPUTS.NUM");
     121    psAbort (!status, "programming error: must define INPUTS.NUM");
     122
     123    // loop over the available readouts
     124    for (int i = 0; i < num; i++) {
     125
     126        pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PSPHOT.INPUT", i); // File of interest
     127
     128        // find the currently selected readout
     129        pmReadout  *readout = pmFPAviewThisReadout (view, file->fpa);
     130        PS_ASSERT_PTR_NON_NULL (readout, false);
     131
     132        psImageBinning *binning = psphotBackgroundBinning(readout->image, config); // Image binning parameters
     133        pmReadout *model = pmFPAGenerateReadout(config, view, "PSPHOT.BACKMDL", inFPA, binning); // this needs to be a MULTI like PSPHOT.INPUT
     134        pmReadout *modelStdev = pmFPAGenerateReadout(config, view, "PSPHOT.BACKMDL.STDEV", inFPA, binning); // this needs to be a MULTI like PSPHOT.INPUT
     135
     136        // XXX save results on model->analysis or readout->analysis??
     137        // XXX need to create a worker function from the function above...
     138        if (!backgroundModel(model->image, modelStdev->image, model->analysis, readout, binning, config)) {
     139            psError(PS_ERR_UNKNOWN, false, "Unable to generate background model");
     140            return false;
     141        }
     142        // display the backsub and backgnd images
     143        psphotVisualShowBackground (config, view, readout);
     144
     145        npass ++;
     146    }
     147    return true;
     148}
Note: See TracChangeset for help on using the changeset viewer.