/// <summary> Reads the Grib data /// /// </summary> /// <param name="offset"> offset into file. /// </param> /// <param name="DecimalScale"> /// </param> /// <param name="bmsExists"> /// </param> /// <throws> NotSupportedException </throws> /// <returns> float[] /// </returns> public float[] getData(long offset, int DecimalScale, bool bmsExists) { long start = (System.DateTime.Now.Ticks - 621355968000000000) / 10000; raf.Seek(offset, System.IO.SeekOrigin.Begin); //System.out.println( "raf.Position=" + raf.Position ); // Need section 3 and 4 to read/interpet the data, section 5 // as a check that all data read and sections are correct Grib1BitMapSection bms = null; if (bmsExists) { // read Bit Mapped Section 3 bms = new Grib1BitMapSection(raf); } // read Binary Data Section 4 Grib1BinaryDataSection bds = new Grib1BinaryDataSection(raf, DecimalScale, bms); return(bds.Values); } // end getData
/// <summary> Reads the Grib data /// /// </summary> /// <param name="offset"> offset into file. /// </param> /// <param name="DecimalScale"> /// </param> /// <param name="bmsExists"> /// </param> /// <throws> NotSupportedException </throws> /// <returns> float[] /// </returns> public float[] getData(long offset, int DecimalScale, bool bmsExists) { long start = (System.DateTime.Now.Ticks - 621355968000000000) / 10000; raf.Seek(offset, System.IO.SeekOrigin.Begin); //System.out.println( "raf.Position=" + raf.Position ); // Need section 3 and 4 to read/interpet the data, section 5 // as a check that all data read and sections are correct Grib1BitMapSection bms = null; if (bmsExists) // read Bit Mapped Section 3 bms = new Grib1BitMapSection(raf); // read Binary Data Section 4 Grib1BinaryDataSection bds = new Grib1BinaryDataSection(raf, DecimalScale, bms); return bds.Values; }