IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26693


Ignore:
Timestamp:
Jan 27, 2010, 11:23:32 AM (16 years ago)
Author:
Paul Price
Message:

Pulling in pattern subtraction enhancements from trunk (rr26682,26692) into Gene's branch. Small conflicts in ippconfig/gpc1/ppImage.config easily resolved.

Location:
branches/eam_branches/20091201
Files:
8 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201

  • branches/eam_branches/20091201/ippconfig/gpc1/ppImage.config

    r26070 r26693  
    2121TILTYSTREAK.APPLY       BOOL    FALSE          # apply the 'tiltystreak' tool
    2222NOISEMAP                BOOL    FALSE          # Apply read noise map
     23
     24PATTERN         BOOL    FALSE   # Do any pattern subtraction at all?
     25PATTERN.SUBSET  METADATA        # List of chips and whether to do pattern subtraction
     26        XY01    BOOL    FALSE
     27        XY02    BOOL    FALSE
     28        XY03    BOOL    FALSE
     29        XY04    BOOL    FALSE
     30        XY05    BOOL    FALSE
     31        XY06    BOOL    FALSE
     32        XY10    BOOL    FALSE
     33        XY11    BOOL    FALSE
     34        XY12    BOOL    FALSE
     35        XY13    BOOL    FALSE
     36        XY14    BOOL    FALSE
     37        XY15    BOOL    FALSE
     38        XY16    BOOL    FALSE
     39        XY17    BOOL    FALSE
     40        XY20    BOOL    FALSE
     41        XY21    BOOL    FALSE
     42        XY22    BOOL    FALSE
     43        XY23    BOOL    FALSE
     44        XY24    BOOL    FALSE
     45        XY25    BOOL    FALSE
     46        XY26    BOOL    FALSE
     47        XY27    BOOL    FALSE
     48        XY30    BOOL    FALSE
     49        XY31    BOOL    FALSE
     50        XY32    BOOL    FALSE
     51        XY33    BOOL    FALSE
     52        XY34    BOOL    FALSE
     53        XY35    BOOL    FALSE
     54        XY36    BOOL    FALSE
     55        XY37    BOOL    FALSE
     56        XY40    BOOL    FALSE
     57        XY41    BOOL    FALSE
     58        XY42    BOOL    FALSE
     59        XY43    BOOL    FALSE
     60        XY44    BOOL    FALSE
     61        XY45    BOOL    FALSE
     62        XY46    BOOL    FALSE
     63        XY47    BOOL    FALSE
     64        XY50    BOOL    FALSE
     65        XY51    BOOL    FALSE
     66        XY52    BOOL    FALSE
     67        XY53    BOOL    FALSE
     68        XY54    BOOL    FALSE
     69        XY55    BOOL    FALSE
     70        XY56    BOOL    FALSE
     71        XY57    BOOL    FALSE
     72        XY60    BOOL    FALSE
     73        XY61    BOOL    FALSE
     74        XY62    BOOL    FALSE
     75        XY63    BOOL    FALSE
     76        XY64    BOOL    FALSE
     77        XY65    BOOL    FALSE
     78        XY66    BOOL    FALSE
     79        XY67    BOOL    FALSE
     80        XY71    BOOL    FALSE
     81        XY72    BOOL    FALSE
     82        XY73    BOOL    FALSE
     83        XY74    BOOL    FALSE
     84        XY75    BOOL    FALSE
     85        XY76    BOOL    FALSE
     86END
     87
    2388
    2489TILTYSTREAK.BY.CLASS METADATA              # apply the 'tiltystreak' tool
  • branches/eam_branches/20091201/ippconfig/recipes/ppImage.config

    r25827 r26693  
    1919VARIANCE.BUILD     BOOL    FALSE           # Build internal variance image
    2020PATTERN            BOOL    FALSE           # Fit and remove pattern noise?
     21PATTERN.SUBSET     METADATA
     22END
    2123FRINGE             BOOL    FALSE           # Fringe subtraction
    2224PHOTOM             BOOL    FALSE           # Source identification and photometry
  • branches/eam_branches/20091201/ppImage/src/ppImageDetrendPattern.c

    r25930 r26693  
    55#include "ppImage.h"
    66
    7 #define ESCAPE(MESSAGE) { \
    8   psError(PS_ERR_UNKNOWN, false, MESSAGE); \
    9   psFree(view); \
    10   return false; \
     7#define ESCAPE(MESSAGE) {                               \
     8        psError(PS_ERR_UNKNOWN, false, MESSAGE);        \
     9        psFree(view);                                   \
     10        return false;                                   \
     11    }
     12
     13bool ppImageDetrendPatternApply(pmConfig *config, pmChip *chip, const pmFPAview *inputView,
     14                                const ppImageOptions *options)
     15{
     16    pmCell *cell = NULL;
     17
     18    assert (options->doPattern); // do not call if not needed
     19    assert (inputView->chip != -1);
     20    assert (inputView->cell == -1);
     21    assert (inputView->readout == -1);
     22    bool status;
     23    pmFPAfile *input = psMetadataLookupPtr(&status, config->files, "PPIMAGE.INPUT");
     24
     25    pmFPAview *view = pmFPAviewAlloc(0); // View for local processing
     26    *view = *inputView;
     27
     28    while ((cell = pmFPAviewNextCell(view, input->fpa, 1)) != NULL) {
     29        if (!cell->process || !cell->file_exists) {
     30            continue;
     31        }
     32        if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
     33            ESCAPE("load failure for Cell");
     34        }
     35
     36        if (!cell->data_exists) {
     37            continue;
     38        }
     39
     40        if (cell->readouts->n > 1) {
     41            psWarning ("Skipping Video Cell for ppImageDetrendPatternApply");
     42            continue;
     43        }
     44
     45        psMetadataItem *doPattern = pmConfigRecipeValueByView(config, RECIPE_NAME, "PATTERN.SUBSET",
     46                                                              chip->parent, view); // Do we do pattern sub?
     47        if (!doPattern || doPattern->type != PS_DATA_BOOL) {
     48            ESCAPE("Unable to determine whether pattern matching should be applied.");
     49        }
     50        if (!doPattern->data.B) {
     51            fprintf(stderr, "*NOT* DOING PATTERN SUBTRACTION FOR %d,%d\n", view->chip, view->cell);
     52            continue;
     53        }
     54
     55        fprintf(stderr, "DOING PATTERN SUBTRACTION FOR %d,%d\n", view->chip, view->cell);
     56        continue;
     57
     58        // process each of the readouts
     59        pmReadout *readout;         // Readout from cell
     60        while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {
     61            if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
     62                ESCAPE("load failure for Readout");
     63            }
     64            if (!readout->data_exists) {
     65                continue;
     66            }
     67
     68            // perfore pattern correction
     69            if (!pmPatternRow(readout, options->patternOrder, options->patternIter, options->patternRej,
     70                              options->patternThresh, options->patternMean, options->patternStdev,
     71                              options->maskValue, options->darkMask)) {
     72                psFree(view);
     73                return(false);
     74            }
     75        }
     76    }
     77
     78    psFree(view);
     79    return(true);
    1180}
    1281
    13 bool ppImageDetrendPatternApply(pmConfig *config, pmChip *chip, const pmFPAview *inputView, const ppImageOptions *options) {
    1482
    15  
    16   pmCell *cell = NULL;
    17 
    18   assert (options->doPattern); // do not call if not needed
    19   assert (inputView->chip != -1);
    20   assert (inputView->cell == -1);
    21   assert (inputView->readout == -1);
    22   bool status;
    23   pmFPAfile *input = psMetadataLookupPtr(&status, config->files, "PPIMAGE.INPUT");
    24  
    25   pmFPAview *view = pmFPAviewAlloc(0); // View for local processing
    26   *view = *inputView;
    27 
    28   while ((cell = pmFPAviewNextCell(view, input->fpa, 1)) != NULL) {
    29     if (!cell->process || !cell->file_exists) {
    30       continue;
    31     }
    32     if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    33       ESCAPE("load failure for Cell");
    34     }
    35 
    36     if (!cell->data_exists) {
    37       continue;
    38     }
    39    
    40     if (cell->readouts->n > 1) {
    41       psWarning ("Skipping Video Cell for ppImageDetrendPatternApply");
    42       continue;
    43     }
    44    
    45     // process each of the readouts
    46     pmReadout *readout;         // Readout from cell
    47     while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {
    48       if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    49         ESCAPE("load failure for Readout");
    50       }
    51       if (!readout->data_exists) {
    52         continue;
    53       }
    54 
    55       // perfore pattern correction
    56       if (!pmPatternRow(readout, options->patternOrder, options->patternIter, options->patternRej,
    57                         options->patternThresh, options->patternMean, options->patternStdev,
    58                         options->maskValue, options->darkMask)) {
    59         psFree(view);
    60         return(false);
    61       }
    62     }
    63   }
    64 
    65   psFree(view);
    66   return(true);
    67 }
    68  
    69    
  • branches/eam_branches/20091201/ppImage/src/ppImageLoop.c

    r25930 r26693  
    100100
    101101                // flip the image to match the native detector orientation (to match bias, flat, etc)
    102                 if (!ppImageParityFlip(config, options, view, true)) {
     102                if (!ppImageParityFlip(config, options, view, true)) {
    103103                    ESCAPE("Unable to detrend readout");
    104104                }
     
    131131
    132132            // process each of the readouts
    133             // XXX reset the view to the first readout?
     133            // XXX reset the view to the first readout?
    134134            while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {
    135135                if (!readout->data_exists) {
     
    140140                    ESCAPE("Unable to detrend readout");
    141141                }
    142             }
     142            }
    143143
    144144            // free detrend images potentially in use: MASK, BIAS, DARK, SHUTTER, FLAT
     
    163163        }
    164164
    165         // Apply the pattern noise correction
    166         if (options->doPattern) {
    167           if (!ppImageDetrendPatternApply(config,chip,view,options)) {
    168             ESCAPE("Unable to apply pattern corrections");
    169           }
    170         }
    171        
     165        // Apply the pattern noise correction
     166        if (options->doPattern) {
     167          if (!ppImageDetrendPatternApply(config,chip,view,options)) {
     168            ESCAPE("Unable to apply pattern corrections");
     169          }
     170        }
     171
    172172        // measure various pixel-based statistics for this image
    173173        if (!ppImagePixelStats(config, stats, options, view)) {
  • branches/eam_branches/20091201/ppStack

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/20091201/psModules/src/config/Makefile.am

    r23794 r26693  
    3232        pmConfigDump.c \
    3333        pmConfigRun.c \
     34        pmConfigRecipeValue.c \
    3435        pmVersion.c \
    3536        pmErrorCodes.c
     
    4344        pmConfigDump.h \
    4445        pmConfigRun.h \
     46        pmConfigRecipeValue.h \
    4547        pmVersion.h \
    4648        pmErrorCodes.h
  • branches/eam_branches/20091201/psModules/src/psmodules.h

    r26486 r26693  
    2929#include <pmConfigDump.h>
    3030#include <pmConfigRun.h>
     31#include <pmConfigRecipeValue.h>
    3132#include <pmVersion.h>
    3233
Note: See TracChangeset for help on using the changeset viewer.