Class GribDatasetProcessor
Pipeline processor for GRIB2 wind and wave grids (NOAA GFS and GFS-Wave, ECMWF open data), read by GribWeatherDataset and drawn, sampled and picked by WeatherGridProcessorBase. Weather model data isn't an S-100 product and isn't for navigation.
public sealed class GribDatasetProcessor : WeatherGridProcessorBase, IDatasetProcessor, ICoveragePortrayalSource, IHeadlessImageRenderer, ITimeAwareDatasetProcessor, ICoverageSampler, ILoadedDatasetProjection, IDisposable
- Inheritance
-
GribDatasetProcessor
- Implements
- Inherited Members
- Extension Methods
Remarks
The processor reports GRIB2/2.0.0. The file stays open and each
field is decoded only when its step is first drawn or sampled, so dispose
the processor to close it.
A file can hold many messages, or be several files appended (what the NOMADS GRIB filter returns for several forecast hours). Fields the decoder can't read (CCSDS, a projected grid), fields of an older run or on another grid, and parameters the weather table doesn't know are listed in Contents with why, and not drawn.
A file the reader can't use fails at construction: a GribFormatException (not GRIB2, truncated), an UnsupportedGribException (GRIB edition 1, or no field it can decode, naming the templates) or an UnsupportedWeatherGridException (a regional grid across the antimeridian). Each message starts with the file name.
Constructors
GribDatasetProcessor(IAssetSource, string, ICrsTransformFactory)
Opens the GRIB2 file relativePath in source.
public GribDatasetProcessor(IAssetSource source, string relativePath, ICrsTransformFactory crsTransformFactory)
Parameters
sourceIAssetSourceThe asset source holding the file.
relativePathstringThe file's source-relative path.
crsTransformFactoryICrsTransformFactoryCreates the transforms the headless compositor needs.
Remarks
A folder in a FileSystemAssetSource is read as one run (GribRunFolder, #1075).
GribDatasetProcessor(string, ICrsTransformFactory)
Opens the GRIB2 file at path, or, when it's a folder,
the run its GRIB2 files hold (GribRunFolder, #1075): the
files appended in name order, read as one dataset.
public GribDatasetProcessor(string path, ICrsTransformFactory crsTransformFactory)
Parameters
pathstringThe file's or folder's path.
crsTransformFactoryICrsTransformFactoryCreates the transforms the headless compositor needs.
Fields
SpecName
The spec name GRIB2 files are registered under.
public const string SpecName = "GRIB2"
Field Value
Properties
Dataset
The GRIB2 file read as weather data.
public GribWeatherDataset Dataset { get; }
Property Value
Grib2Spec
The spec every GRIB2 file reports: GRIB2/2.0.0.
public static SpecRef Grib2Spec { get; }
Property Value
Methods
DescribeContents()
Lists Contents. The default lists the grid set's parameters, unknown ones as not in the weather parameter table; readers add what they left out.
protected override IEnumerable<WeatherDatasetContent> DescribeContents()
Returns
Remarks
Adds why each unknown parameter isn't used (not in the table, a level the table doesn't use, a less preferred code, another swell partition) and the fields left out of the grid set.
Dispose(bool)
Releases the reader's file. Called once, from Dispose().
protected override void Dispose(bool disposing)
Parameters
ReadMetadata(string)
Reads the dataset metadata of the GRIB2 file at path
(spec, extent, CRS and time coverage) without decoding any field.
public static DatasetMetadata ReadMetadata(string path)
Parameters
pathstringThe file's path.