From 289485ebe8b21eef078135f97a776ed2d7326ae1 Mon Sep 17 00:00:00 2001 From: Michael Diener Date: Fri, 19 Jan 2024 11:22:43 +0100 Subject: [PATCH] Fix for BUFR delayed replication descriptor Addresses the github issue Unidata/netcdf-java#1282 Fixes issues with Meteo France BUFR radar files (available through their Open Data portal) --- .../ucar/nc2/iosp/bufr/DataDescriptorTreeConstructor.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bufr/src/main/java/ucar/nc2/iosp/bufr/DataDescriptorTreeConstructor.java b/bufr/src/main/java/ucar/nc2/iosp/bufr/DataDescriptorTreeConstructor.java index 5d7652a788..2727b8e621 100644 --- a/bufr/src/main/java/ucar/nc2/iosp/bufr/DataDescriptorTreeConstructor.java +++ b/bufr/src/main/java/ucar/nc2/iosp/bufr/DataDescriptorTreeConstructor.java @@ -87,7 +87,13 @@ private List replicate(List keys) { // the next one is the replication count size : does not count in field count (x) DataDescriptor replication = dkIter.next(); - if (replication.y == 0) + + // see https://github.com/Unidata/netcdf-java/issues/1282 + if (replication.x == 31) + dk.replicationCountSize = replication.bitWidth; + // Not sure about the following hard codes values and if the previous condition (replication.x == 31) already + // captures those cases automatically. Ideally need an expert for BUFR to look over these. + else if (replication.y == 0) dk.replicationCountSize = 1; // ?? else if (replication.y == 1) dk.replicationCountSize = 8;