IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 5, 2010, 9:42:25 PM (16 years ago)
Author:
eugene
Message:

psphotReadout* API modification to accept a filerule name; wrap lookup of filerule.NUM values in a function (missing = 1); drop deprecated psphotDetect and related; add function to cleanup input pmFPAfile; use psMetadataAddF32 instead of psMetadataAdd (... PS_DATA_F32); add psphotReadoutForcedKnownSources.c; add psphotAddKnownSources

Location:
trunk/psphot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot

  • trunk/psphot/src/psphotReadoutFindPSF.c

    r28013 r29936  
    33// in this psphotReadout-variant, we are only trying to determine the PSF given an existing set
    44// of input source positions to use as initial PSF stars.
    5 bool psphotReadoutFindPSF(pmConfig *config, const pmFPAview *view, psArray *inSources) {
     5bool psphotReadoutFindPSF(pmConfig *config, const pmFPAview *view, const char *filerule, psArray *inSources) {
    66
    77    psTimerStart ("psphotReadout");
    88
    9     // set the photcode for the PSPHOT.INPUT
    10     if (!psphotAddPhotcode(config, view, "PSPHOT.INPUT")) {
     9    // set the photcode for the input
     10    if (!psphotAddPhotcode(config, view, filerule)) {
    1111        psError(PSPHOT_ERR_CONFIG, false, "trouble defining the photcode");
    1212        return false;
     
    1414
    1515    // Generate the mask and variance images, including the user-defined analysis region of interest
    16     psphotSetMaskAndVariance (config, view, "PSPHOT.INPUT");
     16    psphotSetMaskAndVariance (config, view, filerule);
    1717
    1818    // Note that in this implementation, we do NOT model the background and we do not
    1919    // attempt to detect the sources in the image
    2020
    21     // include externally-supplied sources (supplied as PSPHOT.INPUT.CMF)
    22     // XXX we assume a single set of input sources is supplied
    23     if (!psphotDetectionsFromSources (config, view, "PSPHOT.INPUT", inSources)) {
     21    // include the externally-supplied sources (inSources)
     22    // (we assume a single set of input sources is supplied)
     23    if (!psphotDetectionsFromSources (config, view, filerule, inSources)) {
    2424        psError(PSPHOT_ERR_ARGUMENTS, true, "Can't find PSF stars");
    25         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     25        return psphotReadoutCleanup (config, view, filerule);
    2626    }
    2727
    2828    // construct detections->newSources and measure basic stats (moments, local sky)
    29     if (!psphotSourceStats(config, view, "PSPHOT.INPUT", true)) {
     29    if (!psphotSourceStats(config, view, filerule, true)) {
    3030        psError(PSPHOT_ERR_UNKNOWN, false, "failure to generate sources");
    3131        return false;
     
    3333
    3434    // peak flux is wrong : use the peak measured in the moments analysis:
    35     if (!psphotRepairLoadedSources(config, view, "PSPHOT.INPUT")) {
     35    if (!psphotRepairLoadedSources(config, view, filerule)) {
    3636        psError(PSPHOT_ERR_UNKNOWN, false, "failure to repair sources");
    3737        return false;
     
    3939
    4040    // classify sources based on moments, brightness (psf is not known)
    41     if (!psphotRoughClass (config, view, "PSPHOT.INPUT")) {
     41    if (!psphotRoughClass (config, view, filerule)) {
    4242        psError (PSPHOT_ERR_UNKNOWN, false, "failed to determine rough source class");
    43         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     43        return psphotReadoutCleanup (config, view, filerule);
    4444    }
    4545
    46     if (!psphotImageQuality (config, view, "PSPHOT.INPUT")) {
     46    if (!psphotImageQuality (config, view, filerule)) {
    4747        psError (PSPHOT_ERR_UNKNOWN, false, "failed to measure image quality");
    48         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     48        return psphotReadoutCleanup (config, view, filerule);
    4949    }
    5050
    51     if (!psphotChoosePSF(config, view, "PSPHOT.INPUT")) {
     51    if (!psphotChoosePSF(config, view, filerule)) {
    5252        psError(PSPHOT_ERR_PSF, false, "Failed to construct a psf model");
    53         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     53        return psphotReadoutCleanup (config, view, filerule);
    5454    }
    5555
     
    5959    // fits from that analysis, or run the linear PSF fit for all objects currently in hand
    6060    // construct an initial model for each object, set the radius to fitRadius, set circular fit mask
    61     psphotGuessModels (config, view, "PSPHOT.INPUT");
     61    psphotGuessModels (config, view, filerule);
    6262# endif
    6363
    6464    // merge the newly selected sources into the existing list
    6565    // NOTE: merge OLD and NEW
    66     psphotMergeSources (config, view, "PSPHOT.INPUT");
     66    psphotMergeSources (config, view, filerule);
    6767
    6868# if 0
    6969    // measure aperture photometry corrections
    70     if (!psphotApResid (config, view, "PSPHOT.INPUT")) {
     70    if (!psphotApResid (config, view, filerule)) {
    7171        psLogMsg ("psphot", 3, "failed on psphotApResid");
    72         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     72        return psphotReadoutCleanup (config, view, filerule);
    7373    }
    7474# endif
    7575
    7676    // drop the references to the image pixels held by each source
    77     psphotSourceFreePixels(config, view, "PSPHOT.INPUT");
     77    psphotSourceFreePixels(config, view, filerule);
    7878
    7979    // create the exported-metadata and free local data
    80     return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     80    return psphotReadoutCleanup (config, view, filerule);
    8181}
Note: See TracChangeset for help on using the changeset viewer.