Giter VIP home page Giter VIP logo

Comments (3)

madry avatar madry commented on July 20, 2024

Hi Thomas,

I agree that adding a .trim() is a good precaution to avoid the issue
you've highlighted. By chance, do you have a sample file that has a
faulty header like this one? I'd like to put it in our bank of failing
unit tests.

Thanks,
Lansing Madry
Unidata
Boulder, Colorado

On 12/19/2013 8:40 AM, Thomas Storm wrote:

When trying to open an erroneous HDF file where a numerical attribute
is given by the number and a trailing space, a NumberFormatException
is thrown. See below for an excerpt of an header, and note the
trailing space in line 10.
erroneuos_hdf_header
https://f.cloud.github.com/assets/213119/1783398/8b057008-68c2-11e3-8d87-331690edf915.png
The API could easily be more tolerant here by adding a trim() in line
258 in ucar.nc2.iosp.hdf4.HdfEos:

|String sizeS = elem.getChild("Size").getText();
|

would become

|String sizeS = elem.getChild("Size").getText().trim();
|


Reply to this email directly or view it on GitHub
#42.

from thredds.

thomasstorm avatar thomasstorm commented on July 20, 2024

Hi Lansing,

sorry for taking that much time. I have uploaded a sample file to
https://dl.dropboxusercontent.com/u/13070637/sample.hdf

Many thanks and best regards,
Thomas

from thredds.

dopplershift avatar dopplershift commented on July 20, 2024

Fixed in commit 312a472.

from thredds.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.