Commit 33f07080 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

gridToCurvilinear: added support for CDI_PROJ_RLL.

parent e5297f5f
......@@ -873,10 +873,19 @@ int gridToCurvilinear(int gridID1, int lbounds)
{
long index;
int gridtype = gridInqType(gridID1);
size_t gridsize = (size_t) gridInqSize(gridID1);
int gridID2 = gridCreate(GRID_CURVILINEAR, (int) gridsize);
int gridID2 = gridCreate(GRID_CURVILINEAR, (int) gridsize);
bool lrotated = false;
if ( gridtype == GRID_PROJECTION && gridInqProjType(gridID1) == CDI_PROJ_RLL )
{
gridtype = GRID_LONLAT;
lrotated = true;
}
gridDefPrec(gridID2, DATATYPE_FLT32);
switch (gridtype)
{
case GRID_LONLAT:
......@@ -957,12 +966,22 @@ int gridToCurvilinear(int gridID1, int lbounds)
else
for ( int i = 0; i < ny; ++i ) yvals[i] = 0;
if ( gridIsRotated(gridID1) )
{
double xpole = gridInqXpole(gridID1);
double ypole = gridInqYpole(gridID1);
double angle = gridInqAngle(gridID1);
if ( gridIsRotated(gridID1) || lrotated )
{
double xpole = 0, ypole = 0, angle = 0;
if ( lrotated )
{
gridInqProjParamRLL(gridID1, &xpole, &ypole, &angle);
gridDefProj(gridID2, gridID1);
}
else
{
xpole = gridInqXpole(gridID1);
ypole = gridInqYpole(gridID1);
angle = gridInqAngle(gridID1);
}
for ( int j = 0; j < ny; j++ )
for ( int i = 0; i < nx; i++ )
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment