Changeset 24458 for trunk/ppNoiseMap
- Timestamp:
- Jun 17, 2009, 8:33:56 AM (17 years ago)
- Location:
- trunk/ppNoiseMap
- Files:
-
- 1 added
- 1 deleted
- 9 edited
-
. (modified) (1 prop)
-
configure.ac (modified) (1 diff)
-
src (modified) (1 prop)
-
src/Makefile.am (modified) (2 diffs)
-
src/ppNoiseMap.c (modified) (1 diff)
-
src/ppNoiseMap.h (modified) (1 diff)
-
src/ppNoiseMapArguments.c (modified) (1 diff)
-
src/ppNoiseMapLoop.c (modified) (2 diffs)
-
src/ppNoiseMapParseCamera.c (modified) (2 diffs)
-
src/ppNoiseMapVersionDefinitions.h (deleted)
-
src/ppNoiseMapVersionDefinitions.h.in (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppNoiseMap
-
Property svn:ignore
set to
configure
Makefile.in
Doxyfile
config.log
depcomp
config.status
config.guess
ltmain.sh
config.sub
autom4te.cache
libtool
missing
Makefile
aclocal.m4
install-sh
-
Property svn:ignore
set to
-
trunk/ppNoiseMap/configure.ac
r24453 r24458 23 23 CFLAGS="${CFLAGS=} -Wall -Werror" 24 24 25 IPP_VERSION 26 25 27 AC_SUBST([PPNOISEMAP_CFLAGS]) 26 28 AC_SUBST([PPNOISEMAP_LIBS]) -
trunk/ppNoiseMap/src
-
Property svn:ignore
set to
Makefile.in
stamp-h1
config.h
config.h.in
.deps
ppNoiseMap
Makefile
-
Property svn:ignore
set to
-
trunk/ppNoiseMap/src/Makefile.am
r24453 r24458 4 4 ppNoiseMap.h 5 5 6 ppNoiseMap_CFLAGS = $(PPNOISEMAP_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -DPPNOISEMAP_VERSION=$(SVN_VERSION) -DPPNOISEMAP_BRANCH=$(SVN_BRANCH) -DPPNOISEMAP_SOURCE=$(SVN_SOURCE) 6 if HAVE_SVNVERSION 7 PPNOISEMAP_VERSION=`$(SVNVERSION) ..` 8 else 9 PPNOISEMAP_VERSION="UNKNOWN" 10 endif 11 12 if HAVE_SVN 13 PPIMAGE_BRANCH=`$(SVN) info .. | $(SED) -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'` 14 PPIMAGE_SOURCE=`$(SVN) info | $(SED) -n -e 's/Repository UUID: // p'` 15 else 16 PPIMAGE_BRANCH="UNKNOWN" 17 PPIMAGE_SOURCE="UNKNOWN" 18 endif 19 20 # Force recompilation of ppNoiseMapVersion.c, since it gets the version information 21 ppNoiseMapVersion.c: ppNoiseMapVersionDefinitions.h 22 ppNoiseMapVersionDefinitions.h: ppNoiseMapVersionDefinitions.h.in FORCE 23 -$(RM) ppNoiseMapVersionDefinitions.h 24 $(SED) -e "s|@PPNOISEMAP_VERSION@|\"$(PPNOISEMAP_VERSION)\"|" -e "s|@PPNOISEMAP_BRANCH@|\"$(PPNOISEMAP_BRANCH)\"|" -e "s|@PPNOISEMAP_SOURCE@|\"$(PPNOISEMAP_SOURCE)\"|" ppNoiseMapVersionDefinitions.h.in > ppNoiseMapVersionDefinitions.h 25 FORCE: ; 26 27 BUILT_SOURCES = ppNoiseMapVersionDefinitions.h 28 29 ppNoiseMap_CFLAGS = $(PPNOISEMAP_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) 7 30 ppNoiseMap_LDFLAGS = $(PPNOISEMAP_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 8 31 ppNoiseMap_SOURCES = \ … … 12 35 ppNoiseMapLoop.c \ 13 36 ppNoiseMapCleanup.c \ 14 ppNoiseMapFileCheck.c \15 37 ppNoiseMapVersion.c \ 16 38 ppNoiseMapDefineFile.c -
trunk/ppNoiseMap/src/ppNoiseMap.c
r24453 r24458 14 14 if (config == NULL) { 15 15 psErrorStackPrint(stderr, "Unable to parse command-line arguments."); 16 ppNoiseMapCleanup(config , NULL);16 ppNoiseMapCleanup(config); 17 17 exit(PS_EXIT_CONFIG_ERROR); 18 18 } -
trunk/ppNoiseMap/src/ppNoiseMap.h
r24453 r24458 12 12 #include "pslib.h" 13 13 #include "psmodules.h" 14 #include "psphot.h"15 #include "psastro.h"16 #include "ppStats.h"17 14 18 #define RECIPE_NAME "PPNOISEMAP" // Name of the recipe to use 19 #define TIMER_TOTAL "PPNOISE.TOTAL" // Name of timer for total time 20 #define TIMER_DETREND "PPNOISE.DETREND" // Name of timer for detrend time 21 #define TIMER_PHOT "PPNOISE.PHOT" // Name of timer for photometry time 15 #define RECIPE_NAME "PPNOISEMAP" // Name of the recipe to use 16 #define TIMER_TOTAL "PPNOISEMAP.TOTAL" // Name of timer for total time 22 17 23 // Options for ppImage processing 24 typedef struct { 25 // actions which ppImage should perform 26 bool doMaskBuild; // Build internal mask 27 bool doVarianceBuild; // Build internal variance map 28 bool doMask; // Mask bad pixels 29 bool doNonLin; // Non-linearity correction 30 bool doOverscan; // Overscan subtraction 31 bool doBias; // Bias subtraction 32 bool doDark; // Dark subtraction 33 bool doRemnance; // Remnance masking 34 bool doShutter; // Shutter correction 35 bool doFlat; // Flat-field normalisation 36 bool doFringe; // Fringe subtraction 37 bool doPhotom; // Source identification and photometry 38 bool doBG; // Background subtraction 39 bool doAstromChip; // per-chip Astrometry 40 bool doAstromMosaic; // full-mosaic Astrometry 41 bool doStats; // call ppStats on the image 42 bool checkCTE; // measure pixel-based variance 18 /// Get the configuration 19 pmConfig *ppNoiseMapArguments(int argc, char **argv); 43 20 44 // output files requested 45 bool BaseFITS; 46 bool BaseMaskFITS; 47 bool BaseVarianceFITS; 21 /// Determine what type of camera, and initialise 22 bool ppNoiseMapParseCamera(pmConfig *config); 48 23 49 bool ChipFITS; 50 bool ChipMaskFITS; 51 bool ChipVarianceFITS; 24 /// Loop over the input 25 bool ppNoiseMapLoop(pmConfig *config); 52 26 53 bool FPA1FITS; 54 bool FPA2FITS; 55 bool Bin1FITS; 56 bool Bin1JPEG; 57 bool Bin2FITS; 58 bool Bin2JPEG; 27 /// free memory, check for leaks 28 void ppNoiseMapCleanup (pmConfig *config); 59 29 60 // make values for abstract concepts of masking 61 psImageMaskType maskValue; // apply this bit-mask to choose masked bits 62 psImageMaskType markValue; // apply this bit-mask to choose masked bits 63 psImageMaskType satMask; // Mask value to give saturated pixels 64 psImageMaskType badMask; // Mask value to give bad pixels 65 psImageMaskType flatMask; // Mask value to give bad flat pixels 66 psImageMaskType blankMask; // Mask value to give blank pixels 67 68 // non-linear correction parameters 69 psDataType nonLinearType; 70 psMetadataItem *nonLinearData; 71 void *nonLinearSource; 72 73 // options for the analysis 74 pmOverscanOptions *overscan; // Overscan options 75 76 // binning parameters 77 int xBin1; // x-binning, scale 1 78 int yBin1; // y-binning, scale 1 79 int xBin2; // x-binning, scale 2 80 int yBin2; // y-binning, scale 2 81 82 // parameters used by the fringe analysis 83 float fringeRej; // Fringe rejection limit 84 int fringeIter; // Fringe iterations 85 float fringeKeep; // Fringe keep fraction 86 87 int remnanceSize; // Size for remnance detection 88 float remnanceThresh; // Threshold for remnance detection 89 90 char *normClass; // class to use for per-class normalization 91 } ppImageOptions; 92 93 // Cells to be used in the detrend 94 typedef struct { 95 pmCell *input; // The input cell, to be operated upon 96 pmCell *mask; // The bad pixel mask 97 pmCell *bias; // The bias correction 98 pmCell *dark; // The dark correction 99 pmCell *flat; // The flat-field correction 100 } ppImageDetrend; 101 102 ppImageOptions *ppImageOptionsAlloc(void); 103 104 // Determine the processing options 105 ppImageOptions *ppImageOptionsParse(pmConfig *config); 106 107 // Get the configuration 108 pmConfig *ppImageArguments(int argc, char **argv); 109 110 // Determine what type of camera, and initialise 111 ppImageOptions *ppImageParseCamera(pmConfig *config); 112 bool ppImageSetMaskBits (pmConfig *config, ppImageOptions *options); 113 114 // Loop over the input 115 bool ppImageLoop(pmConfig *config, ppImageOptions *options); 116 117 // free memory, check for leaks 118 void ppImageCleanup (pmConfig *config, ppImageOptions *options); 119 120 // perform the detrend analysis on the current readout 121 bool ppImageDetrendReadout (pmConfig *config, ppImageOptions *options, pmFPAview *view); 122 123 bool ppImageDetrendBias(pmReadout *inputReadout, pmReadout *bias, pmReadout *dark, ppImageOptions *options); 124 125 bool ppImageDetrendNonLinear(pmReadout *input, ppImageOptions *options); 126 bool ppImageDetrendNonLinearLookup(pmReadout *input, psMetadataItem *dataItem); 127 bool ppImageDetrendNonLinearPolynomial(pmReadout *input, psMetadataItem *dataItem); 128 129 bool ppImageDetrendCell(ppImageDetrend *detrend, ppImageOptions *options, pmConfig *config); 130 bool ppImageDetrendBias(pmReadout *inputReadout, pmReadout *bias, pmReadout *dark, ppImageOptions *options); 131 pmReadout* ppImageDetrendSelectFirst(pmCell *cell, char *name, bool doThis); 132 133 bool ppImageDetrendFree(pmConfig *config, pmFPAview *view); 134 bool ppImageFringeFree(pmConfig *config, pmFPAview *view); 135 136 bool ppImageCheckCTE(pmConfig *config, ppImageOptions *options, pmFPAview *view); 137 138 // Record which detrend file was used for the detrending 139 bool ppImageDetrendRecord( 140 pmCell *cell, // Cell of interest 141 const pmConfig *config, // Configuration 142 const ppImageOptions *options, // Processing options 143 const pmFPAview *view // View to cell 144 ); 145 146 bool ppImageRebinChip (pmConfig *config, pmFPAview *view, ppImageOptions *options, char *outName); 147 148 bool ppImagePhotom (pmConfig *config, pmFPAview *view); 149 bool ppImageAstrom (pmConfig *config); 150 bool ppImageAddstar (pmConfig *config); 151 152 // Subtract background from the chip-mosaicked image 153 bool ppImageSubtractBackground( 154 pmConfig *config, // Configuration 155 const pmFPAview *view, // View to chip of interest 156 const ppImageOptions *options // Processing options 157 ); 158 159 bool ppImageMosaicChip (pmConfig *config, const ppImageOptions *options, const pmFPAview *view, 160 const char *outFile, const char *inFile); 161 bool ppImageMosaicFPA (pmConfig *config, const ppImageOptions *options, 162 const char *outFile, const char *inFile); 163 164 bool ppImageSetMaskBits (pmConfig *config, ppImageOptions *options); 165 166 void ppImageFileCheck (pmConfig *config); 167 168 // functions used by ppFocus 169 pmConfig *ppFocusArguments(int argc, char **argv); 170 ppImageOptions *ppFocusParseCamera (pmConfig *config, int entry); 171 bool ppFocusGetFWHM (pmConfig *config, psVector *focus, psVector *fwhm); 172 bool ppFocusFitFWHM (pmConfig *config, psVector *focus, psVector *fwhm); 173 174 void ppFocusDropCamera (pmConfig *config); 175 176 bool ppImageDefineFile (pmConfig *config, pmFPA *input, char *filerule, char *argname, pmFPAfileType fileType, pmDetrendType detrendType); 177 178 // write stats to output file 179 bool ppImageStatsOutput(pmConfig *config, // Configuration 180 psMetadata *stats, // Statistics output 181 const ppImageOptions *options // Options 182 ); 183 184 185 // Measure fringes 186 bool ppImageDetrendFringeMeasure(pmReadout *readout, // Readout to measure 187 pmCell *fringe, // Fringe cell (each readout is a different component) 188 const bool isResidual, 189 const ppImageOptions *options // Options 190 ); 191 192 // Solve the fringe system 193 bool ppImageDetrendFringeSolve(pmChip *scienceChip, // Chip with science 194 const pmChip *refChip, // Chip with reference fringes 195 const bool isResidual, 196 const ppImageOptions *options // Options 197 ); 198 199 // Generate fringe frame 200 bool ppImageDetrendFringeGenerate(pmCell *science, // Science cell 201 pmCell *fringes, // Fringe cell, one readout per fringe component 202 const ppImageOptions *options // Options 203 ); 204 205 206 bool ppImageDetrendFringeApply (pmConfig *config, // config 207 pmChip *chip, // science chip 208 const pmFPAview *inputView, // current view 209 const ppImageOptions *options // options 210 ); 30 /// define the input files 31 bool ppNoiseMapDefineFile (pmConfig *config, pmFPA *input, char *filerule, char *argname, pmFPAfileType fileType); 211 32 212 33 /// Return short version information 213 psString pp ImageVersion(void);34 psString ppNoiseMapVersion(void); 214 35 215 36 /// Return software source 216 psString pp ImageSource(void);37 psString ppNoiseMapSource(void); 217 38 218 39 /// Return long version information 219 psString pp ImageVersionLong(void);40 psString ppNoiseMapVersionLong(void); 220 41 221 42 /// Populate the header with version information for all dependencies 222 bool ppImageVersionHeader(psMetadata *metadata ///< Header to populate 223 ); 43 bool ppNoiseMapVersionHeader(psMetadata *header); 224 44 225 45 /// Print version information 226 void ppImageVersionPrint(void); 227 228 229 // calculate stats, including MD5 230 bool ppImagePixelStats(pmConfig *config,// Configuration 231 psMetadata *stats, // Statistics output 232 const ppImageOptions *options, // Options 233 const pmFPAview *inputView // View to data 234 ); 235 236 // calculate stats from headers and concepts 237 bool ppImageMetadataStats(pmConfig *config, // Configuration 238 psMetadata *stats, // Statistics output 239 const ppImageOptions *options // Options 240 ); 241 242 void ppImageFileCheck(pmConfig *config); 243 244 /// Dump memory summary to text file 245 void ppImageMemoryDump(const char *description); 46 void ppNoiseMapVersionPrint(void); 246 47 247 48 #endif -
trunk/ppNoiseMap/src/ppNoiseMapArguments.c
r24453 r24458 9 9 pmConfig *ppNoiseMapArguments(int argc, char **argv) 10 10 { 11 int argnum; // Argument number of interest12 13 11 if (argc == 1) { 14 12 usage(); -
trunk/ppNoiseMap/src/ppNoiseMapLoop.c
r24453 r24458 51 51 pmHDU *hdu = pmHDUGetHighest(input->fpa, chip, cell); 52 52 if (hdu && hdu != lastHDU) { 53 pp ImageVersionHeader(hdu->header);53 ppNoiseMapVersionHeader(hdu->header); 54 54 lastHDU = hdu; 55 55 } … … 72 72 73 73 // perform the noise analysis 74 if (!ppNoiseMapReadout(config, view)) {75 ESCAPE("Unable to detrend readout");76 }74 // if (!ppNoiseMapReadout(config, view)) { 75 // ESCAPE("Unable to detrend readout"); 76 // } 77 77 78 78 } -
trunk/ppNoiseMap/src/ppNoiseMapParseCamera.c
r24453 r24458 2 2 3 3 bool ppNoiseMapParseCamera(pmConfig *config) { 4 5 bool status = false;6 4 7 5 if (!ppNoiseMapDefineFile(config, NULL, "PPNOISEMAP.INPUT", "INPUT", PM_FPA_FILE_IMAGE)) { … … 13 11 14 12 // add recipe options supplied on command line 15 psMetadata *recipe = psMetadataLookupPtr(&status, config->recipes, RECIPE_NAME); 13 // bool status = false; 14 // psMetadata *recipe = psMetadataLookupPtr(&status, config->recipes, RECIPE_NAME); 16 15 17 16 // the following files are output targets
Note:
See TracChangeset
for help on using the changeset viewer.
