private void addSpecifiedBandOfGivenProduct(String nodeName, Product product) {
if (isProductCompatible(product, nodeName)) {
final RasterDataNode raster = product.getRasterDataNode(nodeName);
TimeCoding rasterTimeCoding = GridTimeCoding.create(product);
final ProductData.UTC rasterStartTime = rasterTimeCoding.getStartTime();
final ProductData.UTC rasterEndTime = rasterTimeCoding.getEndTime();
Guardian.assertNotNull("rasterStartTime", rasterStartTime);
final String bandName = variableToRasterName(nodeName, rasterTimeCoding);
if (!tsProduct.containsBand(bandName)) {
if (isAutoAdjustingTimeCoding() || !isTimeCodingSet()) {
autoAdjustTimeInformation(rasterStartTime, rasterEndTime);
}
if (getTimeCoding().contains(rasterTimeCoding)) {
final Band addedBand = addBand(raster, rasterTimeCoding, bandName);
final List<Band> bandsForVariable = getBandsForVariable(nodeName);
if (!bandsForVariable.isEmpty()) {
final ImageInfo imageInfo = bandsForVariable.get(0).getImageInfo(ProgressMonitor.NULL);
addedBand.setImageInfo(imageInfo.createDeepCopy());
}
}
}
}
}