- Timestamp:
- Oct 29, 2021, 8:29:50 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/psModules.20211028/src/imcombine/pmStack.c
r41872 r41873 1533 1533 1534 1534 bool pmStackCombineByPercentile( 1535 pmReadout *combined, 1536 psArray *stackData, 1537 psF64 rejectFraction, 1535 pmReadout *combined, // output stacked readout 1536 pmReadout *expmaps, // output exposure map information 1537 psArray *stackData, // input exposures 1538 psF64 rejectFraction, // outlier fraction of pixels to reject 1538 1539 psF64 maxRange, 1539 1540 psImageMaskType badMaskBits, // treat these bits as 'bad' … … 1562 1563 pmReadoutUpdateSize(combined, minInputCols, minInputRows, xSize, ySize, true, true, blankMaskBits); 1563 1564 1565 psImage *exp = NULL, *expnum = NULL, *expweight = NULL; // Exposure map and exposure number 1566 if (expmaps) { 1567 if (!expmaps->image) { exp = expmaps->image = psImageAlloc(numCols, numRows, PS_TYPE_F32); } 1568 if (!expmaps->mask) { expnum = expmaps->mask = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK); } 1569 if (!expmaps->variance) { expweight = expmaps->variance = psImageAlloc(numCols, numRows, PS_TYPE_F32); } 1570 } 1571 1564 1572 psVector *pixelData = psVectorAlloc(stackData->n, PS_TYPE_F32); 1565 1573 psVector *pixelVariances = psVectorAlloc(stackData->n, PS_TYPE_F32); 1566 1574 psVector *pixelMask = psVectorAlloc(stackData->n, PS_TYPE_VECTOR_MASK); 1575 1576 psVector *expTime = expmask ? psVectorAlloc(stackData->n, PS_TYPE_F32) : NULL; 1577 psVector *expNum = expmask ? psVectorAlloc(stackData->n, PS_TYPE_VECTOR_MASK): NULL; 1567 1578 1568 1579 int nGoodBits[16]; // accumulate the good pixel bits here for fuzzy logic … … 1607 1618 1608 1619 pixelData->data.F32[nGood] = image->data.F32[yIn][xIn]; 1609 if (variance) { 1610 // pixelVariances->data.F32[numGood] = variance->data.F32[yIn][xIn] * addVariance->data.F32[i]; 1611 pixelVariances->data.F32[nGood] = variance->data.F32[yIn][xIn]; 1612 } 1620 if (variance) { pixelVariances->data.F32[nGood] = variance->data.F32[yIn][xIn]; } 1621 if (expmask) { pixelVariances->data.F32[nGood] = variance->data.F32[yIn][xIn]; } 1613 1622 1614 1623 nGood ++; 1615 1624 } 1616 1625 pixelData->n = nGood; 1617 1618 1626 1619 1627 // rather than define a min and max value, … … 1638 1646 combined->variance->data.F32[y][x] = NAN; 1639 1647 combined->mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] = blankMaskBits; // probably not needed since it was set above. 1648 if (expmaps) { 1649 expmaps->image->F32[y][x] = NAN; 1650 expmaps->variance->F32[y][x] = NAN; 1651 expmaps->mask->PS_TYPE_IMAGE_MASK_DATA[y][x] = 0; 1652 } 1640 1653 continue; 1641 1654 }
Note:
See TracChangeset
for help on using the changeset viewer.
