Changeset 26662
- Timestamp:
- Jan 22, 2010, 2:02:53 AM (16 years ago)
- Location:
- trunk/ppbgrestore/src
- Files:
-
- 3 edited
-
ppbgrestoreArguments.c (modified) (2 diffs)
-
ppbgrestoreLoop.c (modified) (5 diffs)
-
ppbgrestoreParseCamera.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppbgrestore/src/ppbgrestoreArguments.c
r25973 r26662 8 8 pmConfig *ppbgrestoreArguments(int argc, char *argv[]) 9 9 { 10 int argnum; 10 11 if (argc == 1) { 11 12 usage(); … … 32 33 usage(); 33 34 } 35 36 if ((argnum = psArgumentGet(argc, argv, "-savebg"))) { 37 psArgumentRemove(argnum, &argc, argv); 38 psMetadataAddBool(config->arguments, PS_LIST_TAIL, "SAVE_BACKGROUND", 0, "save background innmage", true); 39 } 40 34 41 if (argc != 2) usage (); 35 42 -
trunk/ppbgrestore/src/ppbgrestoreLoop.c
r25974 r26662 30 30 exit(PS_EXIT_PROG_ERROR); 31 31 } 32 pmFPAfile *background= psMetadataLookupPtr(&status, config->files, "PPBGRESTORE.BACKGROUND"); 33 if (!status) { 34 psErrorStackPrint(stderr, "Can't find output data!\n"); 35 ppbgrestoreCleanup(config, options); 36 exit(PS_EXIT_PROG_ERROR); 37 } 38 bool save_background = psMetadataLookupBool(&status, config->arguments, "SAVE_BACKGROUND"); 32 39 33 40 pmFPAview *view = pmFPAviewAlloc(0);// View for level of interest … … 90 97 } 91 98 output->save = true; 99 background->save = save_background; 92 100 93 101 psImageBinning *binning = psphotBackgroundBinning(image, config); … … 96 104 return false; 97 105 } 98 pmReadout *background = pmFPAfileDefineInternal (config->files, "PSPHOT.BACKGND", image->numCols, image->numRows, PS_TYPE_F32); 106 pmReadout *backgroundRO = pmFPAviewThisReadout(&roView, background->fpa); 107 // pmReadout *backgroundRO = pmFPAfileDefineInternal (config->files, "PSPHOT.BACKGND", image->numCols, image->numRows, PS_TYPE_F32); 108 backgroundRO->image = psImageAlloc(image->numCols, image->numRows, PS_TYPE_F32); 99 109 100 110 // linear interpolation to full-scale 101 if (!psImageUnbin (background ->image, modelRO->image, binning)) {111 if (!psImageUnbin (backgroundRO->image, modelRO->image, binning)) { 102 112 psError (PSPHOT_ERR_PROG, true, "inconsistent sizes for unbinning"); 103 113 psFree(binning); … … 105 115 } 106 116 psFree(binning); 107 psF32 **backData = background ->image->data.F32;117 psF32 **backData = backgroundRO->image->data.F32; 108 118 109 // Do the background subtraction119 // Undo the background subtraction 110 120 int numCols = image->numCols, numRows = image->numRows; // Size of image 111 121 long nancount = 0; … … 137 147 psWarning("%ld infinite pixels found in background %ld pixels were finite\n", nancount, finitecount); 138 148 } 139 pmFPAfileDropInternal(config->files, "PSPHOT.BACKGND");149 // pmFPAfileDropInternal(config->files, "PSPHOT.BACKGND"); 140 150 141 151 // Close chip -
trunk/ppbgrestore/src/ppbgrestoreParseCamera.c
r25972 r26662 23 23 pmFPAfile *outImage = pmFPAfileDefineOutput(config, input->fpa, "PPBGRESTORE.OUTPUT"); 24 24 if (!outImage) { 25 psError(PS_ERR_IO, false, _("Unable to generate output file from PPIMAGE.OUTPUT")); 25 psError(PS_ERR_IO, false, _("Unable to generate output file from PPBGRESTORE.OUTPUT")); 26 psFree(options); 27 return NULL; 28 } 29 pmFPAfile *outBG = pmFPAfileDefineOutput(config, input->fpa, "PPBGRESTORE.BACKGROUND"); 30 if (!outBG) { 31 psError(PS_ERR_IO, false, _("Unable to generate bacgkround file from PPBGRESTORE.BACKGROUND")); 26 32 psFree(options); 27 33 return NULL;
Note:
See TracChangeset
for help on using the changeset viewer.
