Skip to content

Commit 24c7fcb

Browse files
committed
First find gradient map by product name then channel name
1 parent 647f8ac commit 24c7fcb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/goesproc/handler_goesr.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,14 @@ void GOESRImageHandler::handleImage(GOESRProduct product) {
469469
// combination with the LRIT ImageDataFunction to map
470470
// CMIP grey levels to temperature units (Kelvin), then map
471471
// those temperatures onto the RGB gradient.
472-
auto grad = config_.gradient.find(product.getChannel().nameShort);
472+
const auto& productName = product.getProduct().nameShort;
473+
auto grad = config_.gradient.find(productName);
474+
475+
// For CMIP files we use the channel name to find the gradient.
476+
if (grad == std::end(config_.gradient) && productName == "CMIP") {
477+
grad = config_.gradient.find(product.getChannel().nameShort);
478+
}
479+
473480
auto idf = product.loadImageDataFunction();
474481

475482
// This is stored in an 256x1 RGB matrix for use in Image::remap()

0 commit comments

Comments
 (0)