2020-01-28 14:32:34 +00:00
|
|
|
# (C) Copyright 2005- ECMWF.
|
2013-03-25 12:04:10 +00:00
|
|
|
|
2015-08-13 14:04:31 +00:00
|
|
|
# GRID DEFINITION Mercator projection
|
2013-03-25 12:04:10 +00:00
|
|
|
# grib 1 -> 2
|
|
|
|
constant gridDefinitionTemplateNumber = 20;
|
|
|
|
|
|
|
|
signed[2] Ni : dump;
|
2020-06-08 13:30:17 +00:00
|
|
|
alias numberOfPointsAlongAParallel=Ni;
|
|
|
|
alias Nx=Ni;
|
2013-03-25 12:04:10 +00:00
|
|
|
alias geography.Ni=Ni;
|
2020-06-08 13:30:17 +00:00
|
|
|
alias numberOfPointsAlongXAxis=Ni;
|
2013-03-25 12:04:10 +00:00
|
|
|
|
|
|
|
signed[2] Nj : dump;
|
|
|
|
alias numberOfPointsAlongAMeridian=Nj;
|
2023-08-16 10:34:37 +00:00
|
|
|
alias Ny=Nj;
|
2013-03-25 12:04:10 +00:00
|
|
|
alias geography.Nj=Nj;
|
2020-06-08 13:30:17 +00:00
|
|
|
alias numberOfPointsAlongYAxis=Nj;
|
2013-03-25 12:04:10 +00:00
|
|
|
|
2015-07-28 09:50:26 +00:00
|
|
|
include "grib1/grid_first_last_resandcomp.def";
|
2013-03-25 12:04:10 +00:00
|
|
|
|
|
|
|
signed[3] Latin : edition_specific,no_copy;
|
|
|
|
meta geography.LaDInDegrees scale(Latin,oneConstant,grib1divider,truncateDegrees) : dump;
|
|
|
|
|
|
|
|
pad padding_grid1_1(1);
|
|
|
|
|
|
|
|
# for change_scanning_direction
|
|
|
|
alias yFirst=latitudeOfFirstGridPointInDegrees;
|
|
|
|
alias yLast=latitudeOfLastGridPointInDegrees;
|
|
|
|
alias xFirst=longitudeOfFirstGridPointInDegrees;
|
|
|
|
alias xLast=longitudeOfLastGridPointInDegrees;
|
|
|
|
|
2015-07-28 09:50:26 +00:00
|
|
|
include "grib1/scanning_mode.def";
|
2013-03-25 12:04:10 +00:00
|
|
|
|
2020-06-08 13:30:17 +00:00
|
|
|
signed[3] DiInMetres: dump;
|
2013-03-25 12:04:10 +00:00
|
|
|
alias longitudinalDirectionGridLength=DiInMetres;
|
|
|
|
alias Di=DiInMetres;
|
|
|
|
alias geography.DiInMetres=DiInMetres;
|
2020-06-08 13:30:17 +00:00
|
|
|
alias DxInMetres = DiInMetres;
|
2013-03-25 12:04:10 +00:00
|
|
|
|
2020-06-08 13:30:17 +00:00
|
|
|
signed[3] DjInMetres: dump;
|
2013-03-25 12:04:10 +00:00
|
|
|
alias latitudinalDirectionGridLength=DjInMetres;
|
|
|
|
alias Dj=DjInMetres;
|
|
|
|
alias geography.DjInMetres=DjInMetres;
|
2020-06-08 13:30:17 +00:00
|
|
|
alias DyInMetres = DjInMetres;
|
2013-03-25 12:04:10 +00:00
|
|
|
|
|
|
|
constant orientationOfTheGridInDegrees=0;
|
|
|
|
|
|
|
|
pad padding_grid1_2(8);
|
|
|
|
|
|
|
|
meta numberOfDataPoints number_of_points(Ni,Nj) : dump;
|
|
|
|
alias numberOfPoints=numberOfDataPoints;
|
|
|
|
meta numberOfValues number_of_values(values,bitsPerValue,numberOfDataPoints,bitmapPresent,bitmap,numberOfCodedValues) : dump;
|
|
|
|
#alias ls.valuesCount=numberOfValues;
|
2020-05-08 22:45:06 +00:00
|
|
|
|
|
|
|
iterator mercator(numberOfPoints,missingValue,values,
|
|
|
|
radius,Ni,Nj,
|
|
|
|
latitudeOfFirstGridPointInDegrees, longitudeOfFirstGridPointInDegrees,
|
|
|
|
LaDInDegrees,
|
|
|
|
latitudeOfLastGridPointInDegrees, longitudeOfLastGridPointInDegrees,
|
|
|
|
orientationOfTheGridInDegrees,
|
|
|
|
DiInMetres,DjInMetres,
|
|
|
|
iScansNegatively,
|
|
|
|
jScansPositively,
|
|
|
|
jPointsAreConsecutive,
|
|
|
|
alternativeRowScanning);
|
2020-05-16 11:54:03 +00:00
|
|
|
|
2020-06-12 20:44:04 +00:00
|
|
|
nearest mercator(values,radius,Nx,Ny);
|
|
|
|
|
2020-05-16 11:54:03 +00:00
|
|
|
meta latLonValues latlonvalues(values);
|
|
|
|
alias latitudeLongitudeValues=latLonValues;
|
|
|
|
meta latitudes latitudes(values,0);
|
|
|
|
meta longitudes longitudes(values,0);
|
|
|
|
meta distinctLatitudes latitudes(values,1);
|
|
|
|
meta distinctLongitudes longitudes(values,1);
|