vgrib2
Version:
[](https://badge.fury.io/js/vgrib2)
103 lines (102 loc) • 3.58 kB
TypeScript
import { Buffer } from 'buffer/';
import { IndicatorSectionValues } from './section-0';
import { IdentificationSectionValues } from './section-1';
export declare type ProductDefinitionSectionValues = ReturnType<typeof parseSection4>;
export declare type ProductDefinitionSection = ReturnType<typeof lookupSection4>;
/**
* Product Definition Section
*
* [Read more...](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect4.shtml)
*/
export declare const parseSection4: (section: Buffer) => {
/** Number of GRIB section */
sectionNumber: number;
/** Name of Grib section */
sectionName: string;
/** Length of GRIB section */
length: number;
/** Section 4 Contents */
contents: {
/** Number of coordinate values after template */
coordinateValues: number;
/** Product definition template number [Table 4.0](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table4-0.shtml) */
productDefinitionTemplate: number;
/** Product definition */
productDefinition: {
parameterCategory: number;
parameterNumber: number;
genProcessType: number;
backgroundGenProcess: number;
forecastGenProcess: number;
hoursAfterRefTime: number;
minAfterRefTime: number;
unitOfTimeRangeIndicator: number;
forecastTimeOffset: number;
surface1Type: number;
surface1Scale: number;
surface1Value: number;
surface2Type: number;
surface2Scale: number;
surface2Value: number;
};
};
};
/**
*
* @param pds Product Definition Section
* @param ins Indicator Section
* @returns Product Definition Section with corresponding string values
*/
export declare const lookupSection4: (pds: ProductDefinitionSectionValues, ins: IndicatorSectionValues, ids: IdentificationSectionValues) => {
contents: {
/** Product definition template */
productDefinitionTemplate: string;
/** Product definition */
productDefinition: {
paramater: {
name: string;
units: string;
abbrev: string;
category: string;
};
genProcessType: string;
forecastGenProcess: string;
unitOfTimeRangeIndicator: string;
forecastTime: Date;
surface1: {
scale: number;
value: number;
name: string;
units: null;
} | {
scale: number;
value: number;
name: string;
units: string;
};
surface2: {
scale: number;
value: number;
name: string;
units: null;
} | {
scale: number;
value: number;
name: string;
units: string;
};
backgroundGenProcess: number;
hoursAfterRefTime: number;
minAfterRefTime: number;
forecastTimeOffset: number;
};
/** Number of coordinate values after template */
coordinateValues: number;
};
/** Number of GRIB section */
sectionNumber: number;
/** Name of Grib section */
sectionName: string;
/** Length of GRIB section */
length: number;
};