vgrib2
Version:
[](https://badge.fury.io/js/vgrib2)
59 lines (58 loc) • 2.3 kB
TypeScript
import { Buffer } from 'buffer/';
export declare type DataRepresentationSectionValues = ReturnType<typeof parseSection5>;
export declare type DataRepresentationSection = ReturnType<typeof lookupSection5>;
/**
* Data Representation Section
*
* [Read more...](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect5.shtml)
*/
export declare const parseSection5: (section: Buffer) => {
/** Number of GRIB section */
sectionNumber: number;
/** Name of Grib section */
sectionName: string;
/** Length of GRIB section */
length: number;
/** Section 5 Contents */
contents: {
/** Number of data points where one or more values are specified in Section 7 when a bit map is present, total number of data points when a bit map is absent. */
numberOfDataPoints: number;
/** Data representation template number (See [Table 5.0](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table5-0.shtml)) */
dataRepresentationTemplate: number;
/** Data representation */
dataRepresentation: {
referenceValue: number;
binaryScaleFactor: number;
decimalScaleFactor: number;
numberOfBits: number;
originalType: number;
};
};
};
/**
*
* @param drs Data Representation Section
* @returns Data Representation Section with corresponding string values
*/
export declare const lookupSection5: (drs: DataRepresentationSectionValues) => {
contents: {
/** Data representation template */
dataRepresentationTemplate: string;
/** Data representation */
dataRepresentation: {
originalType: string;
referenceValue: number;
binaryScaleFactor: number;
decimalScaleFactor: number;
numberOfBits: number;
};
/** Number of data points where one or more values are specified in Section 7 when a bit map is present, total number of data points when a bit map is absent. */
numberOfDataPoints: number;
};
/** Number of GRIB section */
sectionNumber: number;
/** Name of Grib section */
sectionName: string;
/** Length of GRIB section */
length: number;
};