Skip to content

Commit

Permalink
Merge pull request #26 from nmangue/fix/issue-23
Browse files Browse the repository at this point in the history
Rewrite Complex packing and spatial differencing Grid Data Representation
  • Loading branch information
nmangue authored Dec 22, 2024
2 parents d34b937 + f200723 commit 4e963c0
Show file tree
Hide file tree
Showing 8 changed files with 224,292 additions and 365 deletions.
15 changes: 15 additions & 0 deletions src/NGrib/BufferedBinaryReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,21 @@ public int ReadUIntN(int nbBit)
}
}

public void ReadUIntN(int nbBit, int[] buffer, int nbValues, int skip = 0)
{
NextUIntN();

if (skip > 0)
{
ReadUIntN(skip);
}

for (int i = 0; i < nbValues; i++)
{
buffer[i] = ReadUIntN(nbBit);
}
}

public int ReadIntN(int nbBit)
{
var result = ReadUIntN(nbBit);
Expand Down
5 changes: 5 additions & 0 deletions src/NGrib/Grib2/CodeTables/5_6_SpatialDifferencingOrder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ namespace NGrib.Grib2.CodeTables
/// </summary>
public enum SpatialDifferencingOrder
{
/// <summary>
/// No spatial differencing.
/// </summary>
None = 0,

/// <summary>
/// First-order spatial differencing.
/// </summary>
Expand Down
Loading

0 comments on commit 4e963c0

Please sign in to comment.