netcdf-java icon indicating copy to clipboard operation
netcdf-java copied to clipboard

Error opening NIDS storm track product

Open dopplershift opened this issue 5 years ago • 3 comments

This NIDS product yields:

IOException sending File java.lang.ArrayIndexOutOfBoundsException: 250

when opened on thredds-test.

dopplershift avatar Sep 30 '20 19:09 dopplershift

So we're blowing an array that has a hardcoded size, specifically the arrays that track the offsets and size of the special symbol packets:

https://github.com/Unidata/netcdf-java/blob/0fe2acf0eb246a147a45452948106db5c089d3e2/cdm/radial/src/main/java/ucar/nc2/iosp/nids/Nidsheader.java#L602-L617

From what I can understand, in this specific case we're assuming that we won't have more than 250 past locations per cell? I see a lot of hardcoded array sizes for similar tracking arrays throughout the symbology block parser, either 250, 550, or 1000.

lesserwhirls avatar Oct 08 '20 17:10 lesserwhirls

It looks like the current limit is 250 locations in total for all storm tracks, not per storm track, and this file has 302.

lesserwhirls avatar Oct 08 '20 18:10 lesserwhirls

I'm not aware of any hard limits in the spec. Would probably be best to use a proper dynamic data structure rather than allocating arrays of fixed size.

dopplershift avatar Oct 08 '20 19:10 dopplershift