You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 21, 2023. It is now read-only.
Copy file name to clipboardexpand all lines: README.md
+14-49
Original file line number
Diff line number
Diff line change
@@ -5,13 +5,18 @@ GribApi.NET is a C# wrapper around the [European Centre for Medium Range Weather
5
5
6
6
GRIB is a format commonly used in meteorology to store weather data. GribApi.NET makes it easy to encode and decode these data by providing access to both GRIB editions through a set of [GRIB API keys](https://software.ecmwf.int/wiki/display/GRIB/GRIB%20API%20keys). GribApi.NET and grib_api are licensed under the friendly [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).
Add **Grib.Api.dll**, **Grib.Api.Native.dll**, and the **ext/grib_api/definitions** directory to your project. By default, GribApi.NET assumes the definitions are in the same directory as the library, but you can change the location by setting `Grib::Api::GribEnvironment::DefinitionsPath` or setting the `GRIB_DEFINITION_PATH` environment variable.
14
+
Add **Grib.Api.dll**, **Grib.Api.Native.dll**, and the **ext/grib_api/definitions** directory to your project.
10
15
11
16
You're ready to go!
12
17
13
18
### Examples
14
-
Getting grid information from a GRIB message:
19
+
#### Getting grid information from a GRIB message:
15
20
```csharp
16
21
using (GribFilefile=newGribFile("mygrib.grb"))
17
22
{
@@ -31,7 +36,7 @@ Getting grid information from a GRIB message:
31
36
}
32
37
```
33
38
34
-
Iterating multiple messages:
39
+
#### Iterating multiple messages:
35
40
```csharp
36
41
using (GribFilefile=newGribFile("mygrib.grb"))
37
42
{
@@ -42,7 +47,7 @@ Iterating multiple messages:
42
47
}
43
48
```
44
49
45
-
Iterating Lat/Lon/Value:
50
+
#### Iterating Lat/Lon/Value:
46
51
```csharp
47
52
48
53
GribMessagemsg=gribFile.First();
@@ -55,7 +60,7 @@ Iterating Lat/Lon/Value:
55
60
}
56
61
```
57
62
58
-
Editing a single message and saving to a new file:
63
+
#### Editing a single message and saving to a new file:
59
64
```csharp
60
65
stringoutPath="out.grb";
61
66
stringreadPath="some.grb";
@@ -70,7 +75,7 @@ Editing a single message and saving to a new file:
70
75
}
71
76
```
72
77
73
-
Appending multiple messages to an existing file:
78
+
#### Appending multiple messages to an existing file:
74
79
```csharp
75
80
using (GribFilereadFile=newGribFile(readPath))
76
81
{
@@ -89,12 +94,12 @@ The current build is only designed for Windows and Visual Studio. I am eager to
89
94
90
95
To build, you can use `build/Grib.Api.Master.sln`. The native projects are set to use the v110 (Visual Studio 2012) Cpp build tools. However, you can change these to match your version of VS in the native projects' `Properties > General > Platform Toolset` field.
91
96
92
-
To run a full release build and package, you'll need `NUnit` and `Nuget` on PATH. Then run:
97
+
To run a full release build, you'll need `NUnit` and `Nuget` on PATH. Then run:
E.g., to build for with Visual Studio 2012 (VS version 11):
102
+
E.g., to build with Visual Studio 2012 (VS version 11):
98
103
```shell
99
104
build/build_gribapi.cmd build 11
100
105
```
@@ -111,44 +116,4 @@ build/run_tests x64 Debug
111
116
or
112
117
```shell
113
118
build/run_tests x86 Debug 1
114
-
```
115
-
116
-
## Concepts
117
-
118
-
### GRIB API Keys
119
-
GribApi.NET treats GRIB messages as a collection of key-value pairs.
120
-
121
-
### Types of Keys
122
-
#### Coded and Computed Keys
123
-
There are two different types of keys: coded and computed. The coded keys are obtained by directly decoding the GRIB file octets. The key names derive from the official WMO documentation on the GRIB 1 and 2 standards. Spaces are removed from the the key description and the words are "camel cased". E.g., the caption `identification of originating generating centre` is transformed to `identificationOfOriginatingGeneratingCentre`. Some aliases are also available. You can find the captions for [most data representations on the WMO's site](http://www.wmo.int/pages/prog/www/WMOCodes/WMO306_vI2/LatestVERSION/LatestVERSION.html).
124
-
125
-
The computed keys are obtained by combining other keys (coded or computed). When their value is set all related keys are updated in a cascade process. These keys synthesize information contained in the GRIB message and are a safe way to set complex attributes such as the type of grid or the type of packing. They also help interpret octets such as the scanning mode whose bits are related to the way of scanning the grid. In this case the computed keys:
126
-
```
127
-
iScansNegatively
128
-
jScansPositively
129
-
jPointsAreConsecutive
130
-
alternativeRowScanning (available only for edition 2)
131
-
```
132
-
will provide access to single bits of the scanning mode octect hiding its structure from the user.
133
-
134
-
#### Read-Only Keys
135
-
The keys can also have some attributes as read only, which means that the key cannot be set (e.g. 7777 at the end of the message), or edition specific that is the attribute of all the keys having different values in the two editions (e.g. longitudeOfFirstGridPoint) or being present in one edition only (e.g. alternativeRowScanning).
136
-
137
-
#### Function Keys
138
-
There are some computed keys that cannot be "get" and can be considered as functions acting on the grib in some way. These keys are always characterised by a predicate in their name (e.g. setDecimalPrecision).
139
-
140
-
#### InDegrees
141
-
All the angle variables are provided in two versions, a native one with the units coded into the GRIB file and an edition independent one in degrees. It is always better to work with the "in degrees" version that is always provided through the key which has the same name of the native version with the suffix InDegrees
**You do not need to use the suffix "InDegrees" explicitly in GribApi.NET. The library converts key values to degrees by default, though you can disable this functionality.**
153
-
154
-
You can read more about GRIB API Keys [here](https://software.ecmwf.int/wiki/display/GRIB/GRIB%20API%20keys).
GribApi.NET treats GRIB messages as a collection of key-value pairs.
6
+
7
+
### Types of Keys
8
+
#### Coded and Computed Keys
9
+
There are two different types of keys: coded and computed. The coded keys are obtained by directly decoding the GRIB file octets. The key names derive from the official WMO documentation on the GRIB 1 and 2 standards. Spaces are removed from the the key description and the words are "camel cased". E.g., the caption `identification of originating generating centre` is transformed to `identificationOfOriginatingGeneratingCentre`. Some aliases are also available. You can find the captions for [most data representations on the WMO's site](http://www.wmo.int/pages/prog/www/WMOCodes/WMO306_vI2/LatestVERSION/LatestVERSION.html).
10
+
11
+
The computed keys are obtained by combining other keys (coded or computed). When their value is set all related keys are updated in a cascade process. These keys synthesize information contained in the GRIB message and are a safe way to set complex attributes such as the type of grid or the type of packing. They also help interpret octets such as the scanning mode whose bits are related to the way of scanning the grid. In this case the computed keys:
12
+
```
13
+
iScansNegatively
14
+
jScansPositively
15
+
jPointsAreConsecutive
16
+
alternativeRowScanning (available only for edition 2)
17
+
```
18
+
will provide access to single bits of the scanning mode octect hiding its structure from the user.
19
+
20
+
#### Read-Only Keys
21
+
The keys can also have some attributes as read only, which means that the key cannot be set (e.g. 7777 at the end of the message), or edition specific that is the attribute of all the keys having different values in the two editions (e.g. longitudeOfFirstGridPoint) or being present in one edition only (e.g. alternativeRowScanning).
22
+
23
+
#### Function Keys
24
+
There are some computed keys that cannot be "get" and can be considered as functions acting on the grib in some way. These keys are always characterised by a predicate in their name (e.g. setDecimalPrecision).
25
+
26
+
#### InDegrees
27
+
All the angle variables are provided in two versions, a native one with the units coded into the GRIB file and an edition independent one in degrees. It is always better to work with the "in degrees" version that is always provided through the key which has the same name of the native version with the suffix InDegrees
**You do not need to use the suffix "InDegrees" explicitly in GribApi.NET. The library converts key values to degrees by default, though you can disable this functionality.**
39
+
40
+
You can read more about GRIB API Keys [here](https://software.ecmwf.int/wiki/display/GRIB/GRIB%20API%20keys).
0 commit comments