[netcdf-java] Opening HDF4 datasets may throw WARNING on the console. How to hide them?

Hi list,
I'm using Netcdf java 4.0.41.
When I open a NetCdfDataset on some HDF4 files, I get the following Warning
messages:

WARN [main] (H4header.java:796) - 7570 != 8471 for history
WARN [main] (H4header.java:796) - 8017 != 8471 for chl_oc3_hist.eps
WARN [main] (H4header.java:796) - 7981 != 8471 for K_490_hist.eps

My HDF4 files have been produced by people which uses the Automated
Satellite Data Processing System thus I don't have immediate control on the
process producing the data to check whether something need to be fixed.
Anyway, I would like to avoid WARNING appearing on the console/server log.

Taking a look on the H4Header source code, I have noticed this part:

// apparently the 701 SDdimension tag overrides the VGroup dimensions
    assert dim.shape.length == v.getRank();
    boolean ok = true;
    for (int i=0; i<dim.shape.length; i++)
      if(dim.shape[i] != v.getDimension(i).getLength()) {
        if (warnings) log.warn( dim.shape[i] + " != "+
v.getDimension(i).getLength()+" for "+v.getName());
        ok = false;
      }

Looking for the "warnings" variable checked within the "if" block, I have
noticed that it is defined as:
private static boolean warnings = true; // log messages

Does a way to override this value exist?
I haven't found in that code any check for System Properties, Environment
Variables, Flags or something else.
Can that warning logging be somehow customized? If negative, would a
different version/release of NetCDFJava Library allow for this?

Thank you very much.
Best Regards,
Daniele

-- 
-------------------------------------------------------
Eng. Daniele Romagnoli
Software Engineer

GeoSolutions S.A.S.
Via Carignoni 51
55041 Camaiore (LU)
Italy

phone: +39 0584983027
fax:     +39 0584983027
mob:   +39 328 0559267


http://www.geo-solutions.it

-------------------------------------------------------
  • 2009 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: