Changeset 8348
- Timestamp:
- Aug 14, 2006, 7:14:30 PM (20 years ago)
- Location:
- trunk/ppImage
- Files:
-
- 4 edited
-
configure.ac (modified) (1 diff)
-
src/Makefile.am (modified) (2 diffs)
-
src/ppImageArguments.c (modified) (1 diff)
-
src/ppImageLoop.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/configure.ac
r7531 r8348 27 27 PKG_CHECK_MODULES([PSPHOT], [psphot >= 0.0.0]) 28 28 PKG_CHECK_MODULES([PSASTRO], [psastro >= 0.0.0]) 29 PKG_CHECK_MODULES([PPSTATS], [ppStats >= 0.0.0]) 29 30 30 31 CFLAGS="${CFLAGS} -Wall -Werror -std=c99" -
trunk/ppImage/src/Makefile.am
r7771 r8348 6 6 ppMem.h 7 7 8 ppImage_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PSPHOT_CFLAGS) $(PSASTRO_CFLAGS) $( ppImage_CFLAGS)9 ppImage_LDFLAGS = $(PSLIB_LIBS) $(PSMODULE_LIBS) $(PSPHOT_LIBS) $(P SASTRO_LIBS)8 ppImage_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PSPHOT_CFLAGS) $(PSASTRO_CFLAGS) $(PPSTATS_CFLAGS) $(ppImage_CFLAGS) 9 ppImage_LDFLAGS = $(PSLIB_LIBS) $(PSMODULE_LIBS) $(PSPHOT_LIBS) $(PPSTATS_LIBS) $(PSASTRO_LIBS) 10 10 ppImage_SOURCES = \ 11 11 ppImage.c \ … … 24 24 ppImageAddstar.c 25 25 26 ppFocus_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PSPHOT_CFLAGS) $(PSASTRO_CFLAGS) $( ppImage_CFLAGS)27 ppFocus_LDFLAGS = $(PSLIB_LIBS) $(PSMODULE_LIBS) $(PSPHOT_LIBS) $(P SASTRO_LIBS)26 ppFocus_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PSPHOT_CFLAGS) $(PSASTRO_CFLAGS) $(PPSTATS_CFLAGS) $(ppImage_CFLAGS) 27 ppFocus_LDFLAGS = $(PSLIB_LIBS) $(PSMODULE_LIBS) $(PSPHOT_LIBS) $(PPSTATS_LIBS) $(PSASTRO_LIBS) 28 28 ppFocus_SOURCES = \ 29 29 ppFocus.c \ -
trunk/ppImage/src/ppImageArguments.c
r7829 r8348 23 23 psMetadata *options = psMetadataAlloc (); 24 24 psMetadataAddPtr (config->arguments, PS_LIST_TAIL, "PPIMAGE.OPTIONS", PS_DATA_METADATA, "", options); 25 26 if ((N = psArgumentGet(argc, argv, "-stat"))) { 27 psArgumentRemove(N, &argc, argv); 28 psMetadataAddStr(options, PS_LIST_TAIL, "STATS", PS_META_REPLACE, 29 "Filename for summary statistics", argv[N]); 30 psArgumentRemove(N, &argc, argv); 31 } 25 32 26 33 // the following options override the PPIMAGE recipe options -
trunk/ppImage/src/ppImageLoop.c
r7771 r8348 1 # include "ppImage.h" 1 #include <ppStats.h> 2 #include "ppImage.h" 2 3 3 4 bool ppImageLoop (pmConfig *config, ppImageOptions *options) { … … 8 9 pmReadout *readout; 9 10 11 bool mdok; // Status of MD lookup 12 psMetadata *extraOpts = psMetadataLookupMD(&mdok, config->arguments, "PPIMAGE.OPTIONS"); // Extra options 13 const char *statsName = psMetadataLookupStr(&mdok, extraOpts, "STATS"); // Filename for statistics 14 psMetadata *stats = NULL; // Container for statistics 15 FILE *statsFile = NULL; // File stream for statistics 16 if (mdok && statsName && strlen(statsName) > 0) { 17 statsFile = fopen(statsName, "w"); 18 if (!statsFile) { 19 psError(PS_ERR_IO, true, "Unable to open statistics file %s for writing.\n", statsName); 20 } else { 21 stats = psMetadataAlloc(); 22 } 23 } 24 10 25 pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "PPIMAGE.INPUT"); 11 26 if (!status) { 12 psErrorStackPrint(stderr, "Can't find input data!\n");13 exit(EXIT_FAILURE);27 psErrorStackPrint(stderr, "Can't find input data!\n"); 28 exit(EXIT_FAILURE); 14 29 } 15 30 … … 23 38 if (!chip->process || !chip->file_exists) { continue; } 24 39 25 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) return false;40 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) return false; 26 41 27 while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) {42 while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) { 28 43 psLogMsg ("ppImageLoop", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 29 44 if (!cell->process || !cell->file_exists) { continue; } 30 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) return false;45 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) return false; 31 46 32 // process each of the readouts33 while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {34 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) return false;35 if (!readout->data_exists) { continue; }47 // process each of the readouts 48 while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) { 49 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) return false; 50 if (!readout->data_exists) { continue; } 36 51 37 // perform the detrend analysis 38 if (!ppImageDetrendReadout (config, options, view)) return false; 39 40 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) return false; 41 } 42 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) return false; 43 } 52 // perform the detrend analysis 53 if (!ppImageDetrendReadout (config, options, view)) return false; 44 54 45 ppImageMosaicChip (config, view, "PPIMAGE.OUTPUT.CHIP", "PPIMAGE.OUTPUT"); 46 ppImageRebinChip (config, view, "PPIMAGE.BIN1", "PPIMAGE.OUTPUT.CHIP"); 47 ppImageRebinChip (config, view, "PPIMAGE.BIN2", "PPIMAGE.OUTPUT.CHIP"); 55 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) return false; 56 } 48 57 49 // we perform photometry on the readouts of this chip in the output 50 if (options->doPhotom) ppImagePhotom (config, view); 58 // Perform statistics on the detrended cell 59 if (stats) { 60 ppStats(stats, input->fpa, view, config); 61 } 51 62 52 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) return false; 63 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) return false; 64 } 65 66 ppImageMosaicChip (config, view, "PPIMAGE.OUTPUT.CHIP", "PPIMAGE.OUTPUT"); 67 ppImageRebinChip (config, view, "PPIMAGE.BIN1", "PPIMAGE.OUTPUT.CHIP"); 68 ppImageRebinChip (config, view, "PPIMAGE.BIN2", "PPIMAGE.OUTPUT.CHIP"); 69 70 // we perform photometry on the readouts of this chip in the output 71 if (options->doPhotom) ppImagePhotom (config, view); 72 73 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) return false; 74 } 75 76 // Write out summary statistics 77 if (stats) { 78 const char *statsMDC = psMetadataConfigFormat(stats); 79 if (!statsMDC || strlen(statsMDC) == 0) { 80 psError(PS_ERR_IO, false, "Unable to get statistics MDC file.\n"); 81 } else { 82 fprintf(statsFile, "%s", statsMDC); 83 } 84 psFree(statsMDC); 85 fclose(statsFile); 86 87 psFree(stats); 53 88 } 54 89
Note:
See TracChangeset
for help on using the changeset viewer.
