Hello,<br><br>I&#39;m working with the NetcdfImageReader. I know it&#39;s a work in progress at the time but as a beginner is hard to know if my problems are due to my lack of understanding or to incomplete API functionalities ;-)<br>
<br>I&#39;ve got some conceptual questions and problems working with a sample grib file. To describe the data I&#39;ve used the NetCDF API to display some information about it. After I present my GEOTK code and my questions.<br>
<br><br>NetCDF API CODE:<br>NetcdfFile f = NetcdfFile.open(&quot;~/myfile.grb&quot;);<br>List&lt;Variable&gt; variables = ds.getReferencedFile().getVariables();<br><br>[...Loop List&lt;Variable&gt; displaying the following info:...]<br>
<br>// the name and datatype<br>System.out.print(variables.get(i).getName());<br>System.out.print(&quot;, &quot;);<br>System.out.print(variables.get(i).getDataType());<br>System.out.print(&quot;: &quot;);<br><br>// the variable ranges of the grid<br>
System.out.print(variables.get(i).getRanges());<br>System.out.print(&quot; &quot;);<br>// the unit<br><br>System.out.println(variables.get(i).getUnitsString());<br><br>OUTPUT:<br>Precipitation_rate, float: [0:0, 0:0, 0:468, 0:564] kg m-2 s-1<br>
Low_cloud_cover, float: [0:0, 0:0, 0:468, 0:564] %<br>U_component_of_wind, float: [0:0, 0:5, 0:468, 0:564] m s-1<br>...<br><br>GEOTK API CODE:<br>NetcdfImageReader netcdfReader = new NetcdfImageReader(null);<br>netcdfReader.setInput(&quot;~/myfile.grb&quot;);<br>
<br>ImageCoverageReader reader = new ImageCoverageReader();<br>reader.setInput(netcdfReader);<br><br>GridCoverage2D uwindcoverage = reader.read(2, null);<br>System.out.println(uwindcoverage.toString());<br><br>OUTPUT:<br>
GridCoverage2D[&quot;U_component_of_wind&quot;, BOX4D(-706.2221645900614 -586.2304882997278 NaN NaN, 706.2778354099386 586.2695117002722 NaN NaN), NetcdfCRS.Compound[&quot;time height_above_ground y x&quot;]]<br>│   RenderedSampleDimension(&quot;U_component_of_wind&quot;:[])<br>
│       GeophysicsCategory(“No data”:[NaN(-9999…-9999)])<br>└ Image=WritableRenderedImageAdapter[] as views [NATIVE, PACKED, RENDERED, GEOPHYSICS, PHOTOGRAPHIC]<br><br><br>QUESTIONS:<br>1.- How ImageCoverageReader decides which of the 6 xy planes it selects? (this variable has 6 z values)<br>
<br>2.- uwindcoverage.evaluate(new Point2D.Float(X, Y), values) returns values as &quot;[F@10d0eae&quot; when I expect [float] according to NetCDF variable descriptor. How should I read this values?<br><br>3.- Does it makes sense that: uwindcoverage.getDimension() = 4, if its defined as 2D?<br>
<br>4.- Do you consider convenient to define new methods for GridCoverage2D as: .getMaxValue(), .getMinValue(), .getAverageValue(), .getUnit(), etc to get information similar to the one contained in the original grib file? I think they could be very helpful for application development...<br>
<br>Thanks for your help,<br><br>Pablo Rozas<br>