Changeset 23719 for branches/pap/ppSub/src/ppSubReadoutJpeg.c
- Timestamp:
- Apr 6, 2009, 6:52:51 PM (17 years ago)
- Location:
- branches/pap/ppSub/src
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ppSubReadoutJpeg.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap/ppSub/src
- Property svn:ignore
-
old new 10 10 stamp-h1 11 11 ppSubKernel 12 ppSubErrorCodes.h 13 ppSubErrorCodes.c
-
- Property svn:ignore
-
branches/pap/ppSub/src/ppSubReadoutJpeg.c
r23711 r23719 9 9 #include "ppSub.h" 10 10 11 bool ppSubReadoutJpeg(pmConfig *config , ppSubData *data, const pmFPAview *view)11 bool ppSubReadoutJpeg(pmConfig *config) 12 12 { 13 13 psAssert(config, "Require configuration"); 14 psAssert(view, "Require view");15 14 16 bool mdok = false; // Status of MD lookup 15 pmFPAview *view = ppSubViewReadout(); // View to readout 16 pmReadout *outRO = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT"); // Readout to jpeg 17 17 18 18 // Look up recipe values 19 psMetadata *recipe = psMetadataLookupMetadata( &mdok, config->recipes, PPSUB_RECIPE); // Recipe for ppSim19 psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSUB_RECIPE); // Recipe for ppSim 20 20 psAssert(recipe, "We checked this earlier, so it should be here."); 21 21 22 22 // Generate binned JPEGs 23 { 24 psImageMaskType maskBad = pmConfigMaskGet("BLANK", config); // Bits to mask for bad pixels 23 psImageMaskType maskBad = pmConfigMaskGet("BLANK", config); // Bits to mask for bad pixels 25 24 26 int bin1 = psMetadataLookupS32(NULL, recipe, "BIN1"); // First binning level27 int bin2 = psMetadataLookupS32(NULL, recipe, "BIN2"); // Second binning level25 int bin1 = psMetadataLookupS32(NULL, recipe, "BIN1"); // First binning level 26 int bin2 = psMetadataLookupS32(NULL, recipe, "BIN2"); // Second binning level 28 27 29 // Target cells 30 pmCell *cell1 = pmFPAfileThisCell(config->files, view, "PPSUB.OUTPUT.JPEG1"); // Rebinned cell once 31 pmCell *cell2 = pmFPAfileThisCell(config->files, view, "PPSUB.OUTPUT.JPEG2"); // Rebinned cell twice 28 // Target cells 29 pmCell *cell1 = pmFPAfileThisCell(config->files, view, "PPSUB.OUTPUT.JPEG1"); // Rebinned cell once 30 pmCell *cell2 = pmFPAfileThisCell(config->files, view, "PPSUB.OUTPUT.JPEG2"); // Rebinned cell twice 31 psFree(view); 32 32 33 pmReadout *ro1 = pmReadoutAlloc(cell1), *ro2 = pmReadoutAlloc(cell2); // Binned readouts 34 if (!pmReadoutRebin(ro1, outRO, maskBad, bin1, bin1)) { 35 psError(PS_ERR_UNKNOWN, false, "Unable to bin output (1st binning)"); 36 psFree(ro1); 37 psFree(ro2); 38 return false; 39 } 40 if (!pmReadoutRebin(ro2, ro1, 0, bin2, bin2)) { 41 psError(PS_ERR_UNKNOWN, false, "Unable to bin output (2nd binning)"); 42 psFree(ro1); 43 psFree(ro2); 44 return false; 45 } 33 pmReadout *ro1 = pmReadoutAlloc(cell1), *ro2 = pmReadoutAlloc(cell2); // Binned readouts 34 if (!pmReadoutRebin(ro1, outRO, maskBad, bin1, bin1)) { 35 psError(PS_ERR_UNKNOWN, false, "Unable to bin output (1st binning)"); 46 36 psFree(ro1); 47 37 psFree(ro2); 38 return false; 48 39 } 40 if (!pmReadoutRebin(ro2, ro1, 0, bin2, bin2)) { 41 psError(PS_ERR_UNKNOWN, false, "Unable to bin output (2nd binning)"); 42 psFree(ro1); 43 psFree(ro2); 44 return false; 45 } 46 psFree(ro1); 47 psFree(ro2); 49 48 50 49 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
