Changeset 7531
- Timestamp:
- Jun 12, 2006, 4:49:23 PM (20 years ago)
- Location:
- trunk/ppImage
- Files:
-
- 1 added
- 11 edited
-
configure.ac (modified) (1 diff)
-
src/Makefile.am (modified) (2 diffs)
-
src/ppImage.c (modified) (1 diff)
-
src/ppImage.h (modified) (2 diffs)
-
src/ppImageArguments.c (modified) (1 diff)
-
src/ppImageAstrom.c (added)
-
src/ppImageCleanup.c (modified) (1 diff)
-
src/ppImageDetrendReadout.c (modified) (2 diffs)
-
src/ppImageLoop.c (modified) (3 diffs)
-
src/ppImageOptions.c (modified) (7 diffs)
-
src/ppImageOptions.h (modified) (2 diffs)
-
src/ppImageParseCamera.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/configure.ac
r7508 r7531 26 26 PKG_CHECK_MODULES([PSMODULE], [psmodule >= 0.0.0]) 27 27 PKG_CHECK_MODULES([PSPHOT], [psphot >= 0.0.0]) 28 PKG_CHECK_MODULES([PSASTRO], [psastro >= 0.0.0]) 28 29 29 30 CFLAGS="${CFLAGS} -Wall -Werror -std=c99" -
trunk/ppImage/src/Makefile.am
r7522 r7531 6 6 ppMem.h 7 7 8 ppImage_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PSPHOT_CFLAGS) $( ppImage_CFLAGS)9 ppImage_LDFLAGS = $(PSLIB_LIBS) $(PSMODULE_LIBS) $(PSPHOT_LIBS) 8 ppImage_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PSPHOT_CFLAGS) $(PSASTRO_CFLAGS) $(ppImage_CFLAGS) 9 ppImage_LDFLAGS = $(PSLIB_LIBS) $(PSMODULE_LIBS) $(PSPHOT_LIBS) $(PSASTRO_LIBS) 10 10 ppImage_SOURCES = \ 11 11 ppImage.c \ … … 20 20 ppImageRebinReadout.c \ 21 21 ppImagePhotom.c \ 22 pp Mem.c22 ppImageAstrom.c 23 23 24 24 # ppImageParseCamera.c \ -
trunk/ppImage/src/ppImage.c
r7522 r7531 26 26 ppImageLoop(config, options); 27 27 28 psLogMsg ("p sphot", 3, "complete psphotrun: %f sec\n", psTimerMark ("complete"));28 psLogMsg ("ppImage", 3, "complete ppImage run: %f sec\n", psTimerMark ("complete")); 29 29 30 30 // Cleaning up -
trunk/ppImage/src/ppImage.h
r7522 r7531 6 6 #include "psmodules.h" 7 7 #include "psphot.h" 8 #include "psastro.h" 8 9 #include "ppImageOptions.h" 9 10 … … 36 37 37 38 bool ppImagePhotom (pmConfig *config, pmFPAview *view); 39 bool ppImageAstrom (pmConfig *config); 38 40 39 41 #endif -
trunk/ppImage/src/ppImageArguments.c
r7522 r7531 56 56 if ((N = psArgumentGet (*argc, argv, "-chip"))) { 57 57 psArgumentRemove (N, argc, argv); 58 psMetadataAddStr (config->arguments, PS_LIST_TAIL, "CHIP_SELECTIONS", PS_DATA_STRING, "", psStringCopy(argv[N]));58 psMetadataAddStr (config->arguments, PS_LIST_TAIL, "CHIP_SELECTIONS", PS_DATA_STRING, "", argv[N]); 59 59 psArgumentRemove (N, argc, argv); 60 60 } -
trunk/ppImage/src/ppImageCleanup.c
r7522 r7531 12 12 pmConfigDone(); 13 13 fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, NULL, false), "ppImage"); 14 // fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, stdout, false), "ppImage"); 14 15 return; 15 16 } -
trunk/ppImage/src/ppImageDetrendReadout.c
r7522 r7531 39 39 40 40 // Bias, dark and overscan subtraction are all merged. 41 ppImageDetrendBias(input, bias, dark, options); 41 if (options->doBias || options->doDark) { 42 ppImageDetrendBias(input, bias, dark, options); 43 } 42 44 43 45 // Flat-field correction (no options used?) 44 46 if (options->doFlat) { 45 pmReadout *flat = pmFPAfileThisReadout (config->files, detview, "PPIMAGE.FLAT");47 pmReadout *flat = pmFPAfileThisReadout (config->files, detview, "PPIMAGE.FLAT"); 46 48 pmFlatField(input, flat); 47 49 } … … 50 52 return true; 51 53 } 52 53 // XXX in psphot, the recipe options are parsed at this depth54 // XXX consider if we move ppImageOptions in here55 // psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, "PSPHOT");56 -
trunk/ppImage/src/ppImageLoop.c
r7522 r7531 20 20 21 21 while ((chip = pmFPAviewNextChip (view, input->fpa, 1)) != NULL) { 22 psLogMsg ("p sphot", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);22 psLogMsg ("ppImageLoop", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 23 23 if (!chip->process || !chip->file_exists) { continue; } 24 24 pmFPAfileIOChecks (config->files, view, PM_FPA_BEFORE); 25 25 26 26 while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) { 27 psLogMsg ("p sphot", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);27 psLogMsg ("ppImageLoop", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 28 28 if (!cell->process || !cell->file_exists) { continue; } 29 29 pmFPAfileIOChecks (config->files, view, PM_FPA_BEFORE); … … 48 48 49 49 // we perform photometry on the readouts of this chip in the output 50 ppImagePhotom (config, view);50 if (options->doPhotom) ppImagePhotom (config, view); 51 51 52 52 pmFPAfileIOChecks (config->files, view, PM_FPA_AFTER); … … 62 62 } 63 63 64 // ppImageAstrom (config); 64 // we perform astrometry on all chips after sources have been detected 65 if (options->doAstrom) ppImageAstrom (config); 65 66 66 67 // ppImageFPAMosaic (config, view); -
trunk/ppImage/src/ppImageOptions.c
r7508 r7531 18 18 options->nonLinearSource = NULL; 19 19 20 return options;21 }22 23 ppImageOptions *ppImageOptionsParse(pmConfig *config)24 {25 bool status;26 ppImageOptions *options = ppImageOptionsAlloc ();27 28 20 // default flags for various activities 29 21 options->doMask = false; // Mask bad pixels … … 36 28 options->doFlat = false; // Flat-field normalisation 37 29 options->doFringe = false; // Fringe subtraction 38 options->do Source= false; // Source identification and photometry30 options->doPhotom = false; // Source identification and photometry 39 31 options->doAstrom = false; // Astrometry 32 33 options->doBin1 = false; // create binned image (scale 1) 34 options->doBin2 = false; // create binned image (scale 2) 35 options->doBin1JPG = false; // create jpg of binned image (scale 1) 36 options->doBin2JPG = false; // create jpg of binned image (scale 2) 40 37 41 38 // Overscan defaults 42 39 options->overscan = NULL; // Overscan options 43 bool overscanSingle = false; // A single value for entire overscan?44 pmFit overscanFit = PM_FIT_NONE; // Fit type for overscan45 int overscanOrder = 0; // Order for overscan fit46 psStats *overscanStats = NULL; // Statistics for overscan47 40 48 41 // Non-linearity default options … … 50 43 options->nonLinearData = NULL; // The non-linearity data 51 44 options->nonLinearSource = NULL; // If the non-linearity data is a menu, this provides the key 45 46 return options; 47 } 48 49 ppImageOptions *ppImageOptionsParse(pmConfig *config) 50 { 51 bool status; 52 ppImageOptions *options = ppImageOptionsAlloc (); 52 53 53 54 // select the recipe for this analysis … … 105 106 106 107 // Do the overscan as a single value? 107 overscanSingle = psMetadataLookupBool(NULL, recipe, "OVERSCAN.SINGLE");108 bool overscanSingle = psMetadataLookupBool(NULL, recipe, "OVERSCAN.SINGLE"); 108 109 109 110 // How do we fit it? 111 pmFit overscanFit = PM_FIT_NONE; // Fit type for overscan 112 int overscanOrder = 0; // Order for overscan fit 110 113 psString fit = psMetadataLookupStr(NULL, recipe, "OVERSCAN.FIT"); 111 114 if (! strcasecmp(fit, "POLYNOMIAL")) { … … 118 121 overscanFit = PM_FIT_SPLINE; 119 122 } else if (strcasecmp(fit, "NONE")) { 120 psLogMsg(__func__, PS_LOG_WARN, "OVERSCAN.FIT (%s) in recipe %s is not one of NONE, "121 "POLYNOMIAL, or SPLINE: assuming NONE.\n", fit, RECIPE_NAME);123 psLogMsg(__func__, PS_LOG_WARN, "OVERSCAN.FIT (%s) in recipe %s is not one of NONE, POLYNOMIAL, or SPLINE", fit, RECIPE_NAME); 124 exit(EXIT_FAILURE); 122 125 } 123 126 127 // What method do we use to measure the overscan statistics? 128 psStats *overscanStats = NULL; // Statistics for overscan 124 129 psString stat = psMetadataLookupStr(NULL, recipe, "OVERSCAN.STAT"); 125 130 if (! strcasecmp(stat, "MEAN")) { … … 128 133 overscanStats = psStatsAlloc(PS_STAT_SAMPLE_MEDIAN); 129 134 } else { 130 psErrorStackPrint(stderr, "OVERSCAN.STAT (%s) in recipe %s is not one of MEAN, MEDIAN: " 131 "assuming MEAN\n", stat, RECIPE_NAME); 132 overscanStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN); 135 psErrorStackPrint(stderr, "OVERSCAN.STAT (%s) in recipe %s is not one of MEAN or MEDIAN", stat, RECIPE_NAME); 136 exit(EXIT_FAILURE); 133 137 } 134 138 … … 161 165 162 166 options->doBin1 = psMetadataLookupBool(NULL, recipe, "BIN1.FITS"); 167 options->doBin1JPG = psMetadataLookupBool(NULL, recipe, "BIN1.JPEG"); 168 if (options->doBin1JPG && !options->doBin1) { 169 psLogMsg(__func__, PS_LOG_ERROR, "Invalid Phase2 Options: cannot make JPG of Bin1 image without Bin1 image"); 170 exit(EXIT_FAILURE); 171 } 172 163 173 options->doBin2 = psMetadataLookupBool(NULL, recipe, "BIN2.FITS"); 174 options->doBin2JPG = psMetadataLookupBool(NULL, recipe, "BIN2.JPEG"); 175 if (options->doBin2JPG && !options->doBin2) { 176 psLogMsg(__func__, PS_LOG_ERROR, "Invalid Phase2 Options: cannot make JPG of Bin2 image without Bin2 image"); 177 exit(EXIT_FAILURE); 178 } 179 180 options->doPhotom = psMetadataLookupBool(NULL, recipe, "PHOTOM"); 181 options->doAstrom = psMetadataLookupBool(NULL, recipe, "ASTROM"); 182 if (options->doAstrom && !options->doPhotom) { 183 psLogMsg(__func__, PS_LOG_ERROR, "Invalid Phase2 Options: cannot do ASTROMetry without PHOTOMetry"); 184 exit(EXIT_FAILURE); 185 } 164 186 165 // options->doBin1JPEG = psMetadataLookupBool(NULL, recipe, "BIN1.JPEG");166 // options->doBin2JPEG = psMetadataLookupBool(NULL, recipe, "BIN2.JPEG");167 168 187 return options; 169 188 } -
trunk/ppImage/src/ppImageOptions.h
r7508 r7531 11 11 bool doFlat; // Flat-field normalisation 12 12 bool doFringe; // Fringe subtraction 13 bool do Source; // Source identification and photometry13 bool doPhotom; // Source identification and photometry 14 14 bool doAstrom; // Astrometry 15 15 … … 23 23 24 24 bool doBin1; 25 bool doBin1JPG; 25 26 int xBin1, yBin1; 26 27 27 28 bool doBin2; 29 bool doBin2JPG; 28 30 int xBin2, yBin2; 29 31 -
trunk/ppImage/src/ppImageParseCamera.c
r7522 r7531 53 53 if (options->doBin1) { 54 54 pmFPAfile *file = pmFPAfileFromFPA (config, input->fpa, options->xBin1, options->yBin1, "PPIMAGE.BIN1"); 55 pmFPAfileDefine (config->files, config->camera, file->fpa, "PPIMAGE.JPEG1"); 55 if (options->doBin1JPG) { 56 pmFPAfileDefine (config->files, config->camera, file->fpa, "PPIMAGE.JPEG1"); 57 } 56 58 } 57 59 if (options->doBin2) { 58 60 pmFPAfile *file = pmFPAfileFromFPA (config, input->fpa, options->xBin2, options->yBin2, "PPIMAGE.BIN2"); 59 pmFPAfileDefine (config->files, config->camera, file->fpa, "PPIMAGE.JPEG2"); 61 if (options->doBin2JPG) { 62 pmFPAfileDefine (config->files, config->camera, file->fpa, "PPIMAGE.JPEG2"); 63 } 60 64 } 61 65
Note:
See TracChangeset
for help on using the changeset viewer.
