Changeset 7749
- Timestamp:
- Jun 29, 2006, 8:09:31 AM (20 years ago)
- Location:
- trunk/ppImage/src
- Files:
-
- 4 edited
-
ppFocus.c (modified) (4 diffs)
-
ppFocusGetFWHM.c (modified) (4 diffs)
-
ppFocusParseCamera.c (modified) (3 diffs)
-
ppImage.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/ppFocus.c
r7738 r7749 17 17 } 18 18 19 // define recipe options20 // define the active I/O files21 ppImageOptions *options = ppFocusParseCamera(config);22 if (options == NULL) {23 psErrorStackPrint(stderr, "");24 exit(1);25 }26 27 19 // we search the argument data for the named fileset (argname) 28 20 psArray *infiles = psMetadataLookupPtr(NULL, config->arguments, "INPUT"); … … 38 30 for (int i = 0; i < infiles->n; i++) { 39 31 32 // define recipe options 33 // define the active I/O files 34 ppImageOptions *options = ppFocusParseCamera(config, i); 35 if (options == NULL) { 36 psErrorStackPrint(stderr, ""); 37 exit(1); 38 } 39 40 40 // Image Arithmetic Loop 41 // XXX ppFocus REQUIRES photom: for it to be true? 41 42 if (!ppImageLoop(config, options)) { 42 43 psErrorStackPrint(stderr, ""); … … 48 49 ppFocusGetFWHM (config, focus, fwhm); 49 50 50 // silently ignore failure for (i == infiles->n)51 p mFPAfileDefineSingleFromArgs (NULL, config, "PPIMAGE.INPUT", "INPUT", i+1);51 ppFocusDropCamera (config); 52 psFree (options); 52 53 } 53 54 … … 57 58 58 59 // Cleaning up 59 ppImageCleanup(config, options);60 ppImageCleanup(config, NULL); 60 61 return EXIT_SUCCESS; 61 62 } -
trunk/ppImage/src/ppFocusGetFWHM.c
r7738 r7749 11 11 int FWHMnum; 12 12 13 pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "P PIMAGE.INPUT");13 pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "PSPHOT.OUTPUT"); 14 14 if (!status) { 15 15 psErrorStackPrint(stderr, "Can't find input data!\n"); … … 45 45 // in this example, we use the supplied PSPHOT.HEADER data in which FWHM_X,Y are supplied 46 46 header = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.HEADER"); 47 if (header == NULL) continue; 47 if (header == NULL) { 48 psError(PS_ERR_IO, false, "Missing header in ppFocus"); 49 continue; 50 } 48 51 49 52 FWHM_X = psMetadataLookupF32 (&status, header, "FWHM_X"); … … 52 55 FWHMsum += 0.5*(FWHM_X + FWHM_Y); 53 56 FWHMnum ++; 57 58 psLogMsg ("ppFocus", 4, "focus pt: %f,%f, fwhm sum: %f, fwhm num: %d\n", FWHM_X, FWHM_Y, FWHMsum, FWHMnum); 54 59 } 55 60 } … … 67 72 psVectorExtend (focus, 10, 1); 68 73 69 psMetadataRemoveKey (config->files, "PPIMAGE.INPUT"); 74 psLogMsg ("ppFocus", 4, "focus: %f, fwhm: %f (%d,%d)\n", FOCUS, FWHM, FWHMnum); 75 70 76 psFree (view); 71 77 return true; -
trunk/ppImage/src/ppFocusParseCamera.c
r7738 r7749 2 2 3 3 // XXX clean up error checks: return NULL, not psAbort 4 ppImageOptions *ppFocusParseCamera (pmConfig *config ) {4 ppImageOptions *ppFocusParseCamera (pmConfig *config, int entry) { 5 5 6 6 bool status = false; … … 8 8 // the first input image defines the camera, and all recipes and options that follow 9 9 // select only the first file from the INPUT array 10 pmFPAfile *input = pmFPAfileDefineSingleFromArgs (&status, config, "PPIMAGE.INPUT", "INPUT", 0);10 pmFPAfile *input = pmFPAfileDefineSingleFromArgs (&status, config, "PPIMAGE.INPUT", "INPUT", entry); 11 11 if (!status) { 12 12 psError(PS_ERR_IO, false, "Failed to build FPA from PPIMAGE.INPUT"); … … 103 103 return (options); 104 104 } 105 106 // remove from config all pmFPAfiles which could have been added (ignore missing entries) 107 void ppFocusDropCamera (pmConfig *config) { 108 109 psMetadataRemoveKey (config->files, "PPIMAGE.INPUT"); 110 111 psMetadataRemoveKey (config->files, "PPIMAGE.BIAS"); 112 psMetadataRemoveKey (config->files, "PPIMAGE.DARK"); 113 psMetadataRemoveKey (config->files, "PPIMAGE.MASK"); 114 psMetadataRemoveKey (config->files, "PPIMAGE.FLAT"); 115 116 psMetadataRemoveKey (config->files, "PPIMAGE.OUTPUT"); 117 psMetadataRemoveKey (config->files, "PPIMAGE.OUTPUT.CHIP"); 118 psMetadataRemoveKey (config->files, "PPIMAGE.OUTPUT.FPA1"); 119 psMetadataRemoveKey (config->files, "PPIMAGE.OUTPUT.FPA2"); 120 121 psMetadataRemoveKey (config->files, "PPIMAGE.BIN1"); 122 psMetadataRemoveKey (config->files, "PPIMAGE.BIN2"); 123 124 psMetadataRemoveKey (config->files, "PPIMAGE.JPEG1"); 125 psMetadataRemoveKey (config->files, "PPIMAGE.JPEG2"); 126 127 psMetadataRemoveKey (config->files, "PSPHOT.INPUT"); 128 psMetadataRemoveKey (config->files, "PSPHOT.OUTPUT"); 129 psMetadataRemoveKey (config->files, "PSPHOT.RESID"); 130 psMetadataRemoveKey (config->files, "PSPHOT.BACKMDL"); 131 psMetadataRemoveKey (config->files, "PSPHOT.BACKGND"); 132 psMetadataRemoveKey (config->files, "PSPHOT.BACKSUB"); 133 psMetadataRemoveKey (config->files, "PSPHOT.PSF.LOAD"); 134 psMetadataRemoveKey (config->files, "PSPHOT.PSF.SAVE"); 135 136 return; 137 } 138 -
trunk/ppImage/src/ppImage.h
r7738 r7749 47 47 // functions used by ppFocus 48 48 pmConfig *ppFocusArguments(int argc, char **argv); 49 ppImageOptions *ppFocusParseCamera (pmConfig *config );49 ppImageOptions *ppFocusParseCamera (pmConfig *config, int entry); 50 50 bool ppFocusGetFWHM (pmConfig *config, psVector *focus, psVector *fwhm); 51 51 bool ppFocusFitFWHM (pmConfig *config, psVector *focus, psVector *fwhm); 52 52 53 void ppFocusDropCamera (pmConfig *config); 54 53 55 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
