copyFlagSourceImages();
BandMathsOp bandArithmeticOp = BandMathsOp.createBooleanExpressionBand("l1_flags.INVALID", sourceProduct);
</BUG>
invalidBand = bandArithmeticOp.getTargetProduct().getBandAt(0);
<BUG>}
private void copyFlagSourceImages() {
final Band[] bands = targetProduct.getBands();
for (Band band : bands) {
if (band.isFlagBand()) {
final MultiLevelImage sourceFlagImage = sourceProduct.getBand(band.getName()).getSourceImage();
band.setSourceImage(sourceFlagImage);
}
}</BUG>
}

ProductUtils.copySpectralBandProperties(radianceBand, toaReflBand);
toaReflBand.setNoDataValueUsed(true);
toaReflBand.setNoDataValue(NO_DATA_VALUE);
bandMap.put(toaReflBand, radianceBand);
}
ProductUtils.copyFlagBands(sourceProduct, targetProduct, true);
BandMathsOp bandArithmeticOp = BandMathsHelper.createBooleanExpressionBand("l1_flags.INVALID", sourceProduct);
invalidBand = bandArithmeticOp.getTargetProduct().getBandAt(0);
}
