Definitions: Cleanup

This commit is contained in:
Shahram Najm 2023-12-02 13:34:19 +00:00
parent 3cb3de6468
commit c2bcd4e43a
18 changed files with 281 additions and 275 deletions

View File

@ -19,16 +19,15 @@ alias Nj = Ny;
# La1 - latitude of first grid point
signed[4] latitudeOfFirstGridPoint: edition_specific;
alias La1 = latitudeOfFirstGridPoint;
meta geography.latitudeOfFirstGridPointInDegrees scale(latitudeOfFirstGridPoint,
one,grib2divider,truncateDegrees) : dump;
meta geography.latitudeOfFirstGridPointInDegrees scale(
latitudeOfFirstGridPoint, one,grib2divider,truncateDegrees) : dump;
#meta latitudeOfFirstGridPointInMicrodegrees times(latitudeOfFirstGridPoint,mAngleMultiplier,angleDivisor): no_copy;
# Lo1 - longitude of first grid point
signed[4] longitudeOfFirstGridPoint: edition_specific ;
alias La1 = longitudeOfFirstGridPoint;
meta geography.longitudeOfFirstGridPointInDegrees scale(longitudeOfFirstGridPoint,
one,grib2divider,truncateDegrees) : dump;
#meta longitudeOfFirstGridPointInMicrodegrees times(longitudeOfFirstGridPoint,mAngleMultiplier,angleDivisor) : no_copy;
meta geography.longitudeOfFirstGridPointInDegrees scale(
longitudeOfFirstGridPoint,one,grib2divider,truncateDegrees) : dump;
signed[4] standardParallelInMicrodegrees : dump;
alias standardParallel=standardParallelInMicrodegrees;
@ -55,13 +54,14 @@ alias DyInMetres = yDirectionGridLengthInMetres;
include "grib2/template.3.scanning_mode.def";
iterator lambert_azimuthal_equal_area(numberOfPoints,missingValue,values,
radius,Nx,Ny,
latitudeOfFirstGridPointInDegrees,longitudeOfFirstGridPointInDegrees,
standardParallelInDegrees,centralLongitudeInDegrees,
Dx,Dy,
iScansNegatively, jScansPositively,
jPointsAreConsecutive, alternativeRowScanning);
iterator lambert_azimuthal_equal_area(
numberOfPoints,missingValue,values,
radius,Nx,Ny,
latitudeOfFirstGridPointInDegrees,longitudeOfFirstGridPointInDegrees,
standardParallelInDegrees,centralLongitudeInDegrees,
Dx,Dy,
iScansNegatively, jScansPositively,
jPointsAreConsecutive, alternativeRowScanning);
nearest lambert_azimuthal_equal_area(values,radius,Nx,Ny);

View File

@ -24,22 +24,24 @@ meta g2grid g2grid(
null,
basicAngleOfTheInitialProductionDomain,
subdivisionsOfBasicAngle
);
);
meta geography.latitudeOfFirstGridPointInDegrees g2latlon(g2grid,0) : dump;
meta geography.longitudeOfFirstGridPointInDegrees g2latlon(g2grid,1) : dump;
meta geography.latitudeOfLastGridPointInDegrees g2latlon(g2grid,2) : dump;
meta geography.longitudeOfLastGridPointInDegrees g2latlon(g2grid,3) : dump;
meta geography.iDirectionIncrementInDegrees g2latlon(g2grid,4,iDirectionIncrementGiven) : can_be_missing,dump;
meta geography.latitudeOfFirstGridPointInDegrees g2latlon(g2grid,0) : dump;
meta geography.longitudeOfFirstGridPointInDegrees g2latlon(g2grid,1) : dump;
meta geography.latitudeOfLastGridPointInDegrees g2latlon(g2grid,2) : dump;
meta geography.longitudeOfLastGridPointInDegrees g2latlon(g2grid,3) : dump;
meta geography.iDirectionIncrementInDegrees g2latlon(g2grid,4,iDirectionIncrementGiven) : can_be_missing,dump;
meta global global_gaussian(N,Ni,iDirectionIncrement,
latitudeOfFirstGridPoint,
longitudeOfFirstGridPoint,
latitudeOfLastGridPoint,
longitudeOfLastGridPoint,
PLPresent, pl,
basicAngleOfTheInitialProductionDomain,
subdivisionsOfBasicAngle) = 0 : dump;
meta global global_gaussian(
N,Ni,iDirectionIncrement,
latitudeOfFirstGridPoint,
longitudeOfFirstGridPoint,
latitudeOfLastGridPoint,
longitudeOfLastGridPoint,
PLPresent, pl,
basicAngleOfTheInitialProductionDomain,
subdivisionsOfBasicAngle
) = 0 : dump;
alias xFirst=longitudeOfFirstGridPointInDegrees;
alias yFirst=latitudeOfFirstGridPointInDegrees;
@ -52,22 +54,22 @@ alias latitudeLastInDegrees = latitudeOfLastGridPointInDegrees;
alias longitudeLastInDegrees = longitudeOfLastGridPointInDegrees;
alias DiInDegrees = iDirectionIncrementInDegrees;
if(missing(Ni) && PLPresent == 1){
if (missing(Ni) && PLPresent == 1) {
iterator gaussian_reduced(numberOfPoints,missingValue,values,
latitudeOfFirstGridPointInDegrees,longitudeOfFirstGridPointInDegrees,
latitudeOfLastGridPointInDegrees,longitudeOfLastGridPointInDegrees,
N,pl,Nj);
latitudeOfFirstGridPointInDegrees,longitudeOfFirstGridPointInDegrees,
latitudeOfLastGridPointInDegrees,longitudeOfLastGridPointInDegrees,
N,pl,Nj);
nearest reduced(values,radius,Nj,pl);
#meta sumPlArray sum(pl);
#meta dataGlobal evaluate( sumPlArray == (numberOfValues+numberOfMissing) );
} else {
iterator gaussian(numberOfPoints,missingValue,values,
longitudeFirstInDegrees,DiInDegrees ,
Ni,Nj,iScansNegatively,
latitudeFirstInDegrees, latitudeLastInDegrees,
N,jScansPositively);
nearest regular(values,radius,Ni,Nj);
iterator gaussian(numberOfPoints,missingValue,values,
longitudeFirstInDegrees,DiInDegrees,
Ni,Nj,iScansNegatively,
latitudeFirstInDegrees, latitudeLastInDegrees,
N,jScansPositively);
nearest regular(values,radius,Ni,Nj);
}
meta latLonValues latlonvalues(values);
alias latitudeLongitudeValues=latLonValues;

View File

@ -23,7 +23,7 @@ meta g2grid g2grid(
jDirectionIncrement,
basicAngleOfTheInitialProductionDomain,
subdivisionsOfBasicAngle
);
);
meta geography.latitudeOfFirstGridPointInDegrees g2latlon(g2grid,0) : dump;
meta geography.longitudeOfFirstGridPointInDegrees g2latlon(g2grid,1) : dump;
@ -59,12 +59,12 @@ _if ( missing(Ni) && PLPresent == 1 ) {
} else {
transient iteratorDisableUnrotate = 0 : hidden; # ECC-808
iterator latlon(numberOfPoints,missingValue,values,
longitudeFirstInDegrees,DiInDegrees ,
Ni,Nj,iScansNegatively,
latitudeFirstInDegrees, DjInDegrees,
jScansPositively, jPointsAreConsecutive,
isRotatedGrid, angleOfRotation,
latitudeOfSouthernPoleInDegrees,longitudeOfSouthernPoleInDegrees);
longitudeFirstInDegrees,DiInDegrees ,
Ni,Nj,iScansNegatively,
latitudeFirstInDegrees, DjInDegrees,
jScansPositively, jPointsAreConsecutive,
isRotatedGrid, angleOfRotation,
latitudeOfSouthernPoleInDegrees,longitudeOfSouthernPoleInDegrees);
nearest regular(values,radius,Ni,Nj);
}
meta latLonValues latlonvalues(values);

View File

@ -28,14 +28,16 @@ flagbit scanningMode6(scanningMode,2) = 0: read_only;
flagbit scanningMode7(scanningMode,1) = 0: read_only;
flagbit scanningMode8(scanningMode,0) = 0: read_only;
meta swapScanningX change_scanning_direction( values,Ni,Nj,
iScansNegatively,jScansPositively,
xFirst,xLast,x) : edition_specific,hidden,no_copy;
meta swapScanningX change_scanning_direction(
values,Ni,Nj,
iScansNegatively,jScansPositively,
xFirst,xLast,x) : edition_specific,hidden,no_copy;
alias swapScanningLon = swapScanningX;
meta swapScanningY change_scanning_direction( values,Ni,Nj,
iScansNegatively,jScansPositively,
yFirst,yLast,y) : edition_specific,hidden,no_copy;
meta swapScanningY change_scanning_direction(
values,Ni,Nj,
iScansNegatively,jScansPositively,
yFirst,yLast,y) : edition_specific,hidden,no_copy;
alias swapScanningLat = swapScanningY;
meta swapScanningAlternativeRows change_alternative_row_scanning(

View File

@ -3,26 +3,28 @@
# TEMPLATE 7.0, Grid point data - simple packing
meta codedValues data_g2simple_packing(
section7Length,
offsetBeforeData,
offsetSection7,
unitsFactor,
unitsBias,
changingPrecision,
numberOfValues,
bitsPerValue,
referenceValue,
binaryScaleFactor,
decimalScaleFactor,
optimizeScaleFactor
section7Length,
offsetBeforeData,
offsetSection7,
unitsFactor,
unitsBias,
changingPrecision,
numberOfValues,
bitsPerValue,
referenceValue,
binaryScaleFactor,
decimalScaleFactor,
optimizeScaleFactor
): read_only;
meta values data_apply_bitmap(codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues) : dump;
meta values data_apply_bitmap(
codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues
) : dump;
meta packingError simple_packing_error(bitsPerValue,binaryScaleFactor,decimalScaleFactor,referenceValue,ieee) : no_copy;
meta unpackedError simple_packing_error(zero,binaryScaleFactor,decimalScaleFactor,referenceValue,ieee) : no_copy;

View File

@ -3,26 +3,28 @@
# TEMPLATE 7.1, Matrix values at grid point -simple packing
meta codedValues data_g2simple_packing(
section7Length,
offsetBeforeData,
offsetSection7,
unitsFactor,
unitsBias,
changingPrecision,
numberOfValues,
bitsPerValue,
referenceValue,
binaryScaleFactor,
decimalScaleFactor,
optimizeScaleFactor
section7Length,
offsetBeforeData,
offsetSection7,
unitsFactor,
unitsBias,
changingPrecision,
numberOfValues,
bitsPerValue,
referenceValue,
binaryScaleFactor,
decimalScaleFactor,
optimizeScaleFactor
): read_only;
meta values data_apply_bitmap(codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues) : dump;
meta values data_apply_bitmap(
codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues
) : dump;
meta packingError simple_packing_error(bitsPerValue,binaryScaleFactor,decimalScaleFactor,referenceValue,ieee) : no_copy;
meta unpackedError simple_packing_error(zero,binaryScaleFactor,decimalScaleFactor,referenceValue,ieee) : no_copy;

View File

@ -19,29 +19,30 @@ meta codedValues data_g22order_packing(
decimalScaleFactor,
optimizeScaleFactor,
typeOfOriginalFieldValues ,
typeOfOriginalFieldValues,
groupSplittingMethodUsed,
missingValueManagementUsed ,
primaryMissingValueSubstitute ,
secondaryMissingValueSubstitute ,
numberOfGroupsOfDataValues ,
referenceForGroupWidths ,
numberOfBitsUsedForTheGroupWidths ,
referenceForGroupLengths ,
missingValueManagementUsed,
primaryMissingValueSubstitute,
secondaryMissingValueSubstitute,
numberOfGroupsOfDataValues,
referenceForGroupWidths,
numberOfBitsUsedForTheGroupWidths,
referenceForGroupLengths,
lengthIncrementForTheGroupLengths,
trueLengthOfLastGroup ,
trueLengthOfLastGroup,
numberOfBitsForScaledGroupLengths,
orderOfSpatialDifferencing,
numberOfOctetsExtraDescriptors
): read_only;
meta values data_apply_bitmap(codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues) : dump;
meta values data_apply_bitmap(
codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues
) : dump;
alias data.packedValues = codedValues;

View File

@ -14,12 +14,14 @@ meta codedValues data_run_length_packing(
levelValues
): read_only;
meta values data_apply_bitmap(codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues) : dump;
meta values data_apply_bitmap(
codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues
) : dump;
alias data.packedValues = codedValues;

View File

@ -16,29 +16,30 @@ meta codedValues data_g22order_packing(
decimalScaleFactor,
optimizeScaleFactor,
typeOfOriginalFieldValues ,
typeOfOriginalFieldValues,
groupSplittingMethodUsed,
missingValueManagementUsed ,
primaryMissingValueSubstitute ,
secondaryMissingValueSubstitute ,
numberOfGroupsOfDataValues ,
referenceForGroupWidths ,
numberOfBitsUsedForTheGroupWidths ,
referenceForGroupLengths ,
missingValueManagementUsed,
primaryMissingValueSubstitute,
secondaryMissingValueSubstitute,
numberOfGroupsOfDataValues,
referenceForGroupWidths,
numberOfBitsUsedForTheGroupWidths,
referenceForGroupLengths,
lengthIncrementForTheGroupLengths,
trueLengthOfLastGroup ,
trueLengthOfLastGroup,
numberOfBitsForScaledGroupLengths,
orderOfSpatialDifferencing,
numberOfOctetsExtraDescriptors
): read_only;
meta values data_apply_bitmap(codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues) : dump;
meta values data_apply_bitmap(
codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues
) : dump;
alias data.packedValues=codedValues;

View File

@ -3,19 +3,21 @@
# TEMPLATE 7.4, Grid point data - IEEE floating point data
meta codedValues data_raw_packing(
section7Length,
offsetBeforeData,
offsetSection7,
numberOfValues,
precision
): read_only;
section7Length,
offsetBeforeData,
offsetSection7,
numberOfValues,
precision
): read_only;
meta values data_apply_bitmap(codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues) : dump;
meta values data_apply_bitmap(
codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues
) : dump;
alias data.packedValues = codedValues;

View File

@ -3,44 +3,43 @@
# TEMPLATE 7.40, Grid point data - JPEG2000
meta codedValues data_jpeg2000_packing(
section7Length,
offsetBeforeData,
offsetSection7,
section7Length,
offsetBeforeData,
offsetSection7,
unitsFactor,
unitsBias,
changingPrecision,
numberOfCodedValues,
bitsPerValue,
referenceValue,
binaryScaleFactor,
decimalScaleFactor,
optimizeScaleFactor,
unitsFactor,
unitsBias,
changingPrecision,
numberOfCodedValues,
bitsPerValue,
referenceValue,
binaryScaleFactor,
decimalScaleFactor,
optimizeScaleFactor,
#numberOfValues,
#referenceValue,
#binaryScaleFactor,
#decimalScaleFactor,
#bitsPerValue,
#numberOfValues,
#referenceValue,
#binaryScaleFactor,
#decimalScaleFactor,
#bitsPerValue,
# For encoding
typeOfCompressionUsed,
targetCompressionRatio,
Nx,
Ny,
interpretationOfNumberOfPoints,
numberOfDataPoints,
scanningMode
): read_only;
# For encoding
typeOfCompressionUsed,
targetCompressionRatio,
Nx,
Ny,
interpretationOfNumberOfPoints,
numberOfDataPoints,
scanningMode
): read_only;
meta values data_apply_bitmap(codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues) : dump;
meta values data_apply_bitmap(
codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues) : dump;
alias data.packedValues = codedValues;

View File

@ -3,28 +3,29 @@
# TEMPLATE 7.41, Grid point data - PNG
meta codedValues data_png_packing(
section7Length,
offsetBeforeData,
offsetSection7,
numberOfValues,
referenceValue,
binaryScaleFactor,
decimalScaleFactor,
bitsPerValue,
# For encoding
Nx,
Ny,
interpretationOfNumberOfPoints,
numberOfDataPoints,
scanningMode
): read_only;
section7Length,
offsetBeforeData,
offsetSection7,
numberOfValues,
referenceValue,
binaryScaleFactor,
decimalScaleFactor,
bitsPerValue,
# For encoding
Nx,
Ny,
interpretationOfNumberOfPoints,
numberOfDataPoints,
scanningMode
): read_only;
meta values data_apply_bitmap(codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues) : dump;
meta values data_apply_bitmap(
codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues) : dump;
alias data.packedValues = codedValues;

View File

@ -3,27 +3,28 @@
# TEMPLATE 7.42, Grid point data - CCSDS
meta codedValues data_ccsds_packing(
section7Length,
offsetBeforeData,
offsetSection7,
numberOfValues,
referenceValue,
binaryScaleFactor,
decimalScaleFactor,
optimizeScaleFactor,
bitsPerValue,
numberOfDataPoints,
ccsdsFlags,
ccsdsBlockSize,
ccsdsRsi
): read_only;
section7Length,
offsetBeforeData,
offsetSection7,
numberOfValues,
referenceValue,
binaryScaleFactor,
decimalScaleFactor,
optimizeScaleFactor,
bitsPerValue,
numberOfDataPoints,
ccsdsFlags,
ccsdsBlockSize,
ccsdsRsi
): read_only;
meta values data_apply_bitmap(codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues) : dump;
meta values data_apply_bitmap(
codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues) : dump;
# See ECC-711
meta packingError simple_packing_error(bitsPerValue,binaryScaleFactor,decimalScaleFactor,referenceValue,ieee) : no_copy;

View File

@ -9,24 +9,24 @@ transient numberOfValues = ( J + 1 ) * ( J + 2 ) : no_copy ;
transient numberOfPackedValues = numberOfValues - 1 : no_copy;
meta codedValues data_g2simple_packing(
section7Length,
offsetBeforeData,
offsetSection7,
unitsFactor,
unitsBias,
changingPrecision,
numberOfPackedValues,
bitsPerValue,
referenceValue,
binaryScaleFactor,
decimalScaleFactor,
optimizeScaleFactor) : read_only;
section7Length,
offsetBeforeData,
offsetSection7,
unitsFactor,
unitsBias,
changingPrecision,
numberOfPackedValues,
bitsPerValue,
referenceValue,
binaryScaleFactor,
decimalScaleFactor,
optimizeScaleFactor) : read_only;
meta values data_g2shsimple_packing(
codedValues,
realPartOf00,
numberOfValues,
numberOfDataPoints);
codedValues,
realPartOf00,
numberOfValues,
numberOfDataPoints);
meta packingError simple_packing_error(bitsPerValue,binaryScaleFactor,decimalScaleFactor,referenceValue,ieee) : no_copy;
meta unpackedError simple_packing_error(zero,binaryScaleFactor,decimalScaleFactor,referenceValue,ieee) : no_copy;

View File

@ -12,7 +12,7 @@ meta codedValues data_g2complex_packing(
offsetSection7,
unitsFactor,
unitsBias,
unitsBias,
changingPrecision,
numberOfValues,
bitsPerValue,
@ -27,13 +27,8 @@ meta codedValues data_g2complex_packing(
laplacianOperatorIsSet,
laplacianOperator,
J,
K,
M,
J,
J,
J,
J, K, M,
J, J, J,
numberOfValues
): read_only;
@ -58,13 +53,8 @@ meta data.packedValues data_sh_packed(
laplacianOperatorIsSet,
laplacianOperator,
J,
K,
M,
J,
J,
J
J,K, M,
J, J, J
) : read_only;
meta data.unpackedValues data_sh_unpacked(
@ -88,22 +78,20 @@ meta data.unpackedValues data_sh_unpacked(
laplacianOperatorIsSet,
laplacianOperator,
J,
K,
M,
J,
K,
M
J, K, M,
J, K, M
) : read_only;
meta packingError simple_packing_error(bitsPerValue,binaryScaleFactor,decimalScaleFactor,referenceValue,ieee) : no_copy;
meta unpackedError simple_packing_error(zero,binaryScaleFactor,decimalScaleFactor,referenceValue,ieee) : no_copy;
meta values data_apply_bitmap(codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues) : dump;
meta values data_apply_bitmap(
codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues
) : dump;
template statistics "common/statistics_spectral.def";

View File

@ -101,11 +101,12 @@ meta data.unpackedValues data_sh_unpacked(
meta packingError simple_packing_error(bitsPerValue,binaryScaleFactor,decimalScaleFactor,referenceValue,ieee) : no_copy;
meta unpackedError simple_packing_error(zero,binaryScaleFactor,decimalScaleFactor,referenceValue,ieee) : no_copy;
meta values data_apply_bitmap(codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues) : dump;
meta values data_apply_bitmap(
codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues) : dump;
template statistics "common/statistics_spectral.def";

View File

@ -5,8 +5,6 @@
# Note from WMO document:
# This template is experimental, was not validated at the time of publication and should be used only for bilateral previously agreed tests
# Octets 6-nn : Binary data values - binary string, with each (scaled)
meta codedValues data_g2simple_packing_with_preprocessing(
section7Length,
offsetBeforeData,
@ -24,12 +22,14 @@ meta codedValues data_g2simple_packing_with_preprocessing(
preProcessingParameter
): read_only;
meta values data_apply_bitmap(codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues) : dump;
meta values data_apply_bitmap(
codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues
) : dump;
alias data.packedValues = codedValues;

View File

@ -11,7 +11,7 @@ meta codedValues data_g2second_order_packing(
section7Length,
offsetBeforeData,
offsetSection7,
unitsFactor,
unitsFactor,
unitsBias,
changingPrecision,
numberOfCodedValues,
@ -19,7 +19,7 @@ meta codedValues data_g2second_order_packing(
referenceValue,
binaryScaleFactor,
decimalScaleFactor,
#g2second_order_packing
# g2second_order_packing
halfByte,
packingType,
grid_ieee,
@ -43,12 +43,14 @@ meta codedValues data_g2second_order_packing(
numberOfPoints
): read_only;
meta values data_apply_bitmap(codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues) : dump;
meta values data_apply_bitmap(
codedValues,
bitmap,
missingValue,
binaryScaleFactor,
numberOfDataPoints,
numberOfValues
) : dump;
alias data.packedValues = codedValues;