Squeeze in HEALPix through the backdoor

This commit is contained in:
Shahram Najm 2023-08-24 16:27:09 +01:00
parent d336cfca4c
commit 7c061545bd
3 changed files with 55 additions and 0 deletions

View File

@ -110,6 +110,7 @@ concept gridType {
"lambert_bf" = { gridDefinitionTemplateNumber=63; PLPresent=0; }
"mercator_bf" = { gridDefinitionTemplateNumber=61; PLPresent=0; }
"polar_stereographic_bf" = { gridDefinitionTemplateNumber=62; PLPresent=0; }
"healpix" = { gridDefinitionTemplateNumber=150; PLPresent=0; }
"ncep_32769" = { centre=7; gridDefinitionTemplateNumber=32769; PLPresent=0; }

View File

@ -0,0 +1,7 @@
# TEMPLATE 3.150 - The HEALPix grid
# See https://healpix.jpl.nasa.gov/pdf/intro.pdf
include "grib2/template.3.shape_of_the_earth.def";
include "grib2/template.3.resolution_flags.def";
include "grib2/template.3.healpix.def";

View File

@ -0,0 +1,47 @@
# (C) Copyright 2005- ECMWF.
# See https://healpix.jpl.nasa.gov/pdf/intro.pdf
constant isGridded = one;
# Number of grid points along one side of one of the 12 base resolution pixels (>=1)
# The number of data points should be = 12 * Nside * Nside
unsigned[4] Nside : edition_specific,dump;
alias N = Nside;
alias numberOfPointsAlongASide = Nside;
alias geography.Nside = Nside;
# Longitude of the centre line of the first rhomboid
unsigned[4] longitudeOfFirstGridPoint : edition_specific,dump;
alias Lo = longitudeOfFirstGridPoint;
alias geography.longitudeOfFirstGridPoint = longitudeOfFirstGridPoint;
# Position of the points. Default = Grid points at centres of shape
codetable[1] gridPointPosition ('3.8.table',masterDir,localDir) = 4 : edition_specific,dump;
alias geography.gridPointPosition = gridPointPosition;
# Ordering convention of points. Default = ring
codetable[1] ordering ('3.12.table',masterDir,localDir) = 0 : edition_specific,dump;
concept orderingConvention(unknown) {
"ring" = { ordering = 0; }
"nested" = { ordering = 1; }
} : dump;
alias geography.pointsOrdering = orderingConvention;
flags[1] scanningMode 'grib2/tables/[tablesVersion]/3.13.table';
flagbit iScansNegatively(scanningMode,7) : dump; # WMO bit 1
flagbit jScansPositively(scanningMode,6) : dump; # WMO bit 2
transient iScansPositively = !iScansNegatively : constraint;
transient jScansNegatively = !jScansPositively : constraint;
iterator healpix(numberOfPoints,missingValue,values,Nside,orderingConvention);
nearest healpix(values,radius,Nx,Ny);
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);
meta gridName sprintf("H%d", N) : no_copy;