Пример #1
0
        /// <summary>
        /// Read the records grid value.
        /// </summary>
        /// <param name="record">The record to read.</param>
        /// <param name="hasBitmapSection">Indicates whether the Bit-map section was used by the GRIB file producer.</param>
        /// <returns>The record grid points and the corresponding values.</returns>
        public IEnumerable <KeyValuePair <Coordinate, float> > ReadRecordValues(Grib1Record record, bool hasBitmapSection = false)
        {
            var rawData = ReadRecordRawData(record, hasBitmapSection);

            return(record.GridDefinitionSection.EnumerateGridPoints()
                   .Zip(rawData, (c, v) => new KeyValuePair <Coordinate, float>(c, v)));
        }
Пример #2
0
 /// <summary>
 /// Read the data set floating point values.
 /// </summary>
 /// <param name="record">The record to read.</param>
 /// <param name="hasBitmapSection">Indicates whether the Bit-map section was used by the GRIB file producer.</param>
 /// <returns>The data set point values.</returns>
 public float[] ReadRecordRawData(Grib1Record record, bool hasBitmapSection = false) => data.getData(record.DataOffset, record.ProductDefinitionSection.DecimalScale, false);