Commit 202f3638 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

New operator samplegrid: resample grid (patch from Michal Koutek, KMNI).

parent df24740b
2017-02-20 Uwe Schulzweida
* New operator samplegrid: resample grid (patch from Michal Koutek, KMNI)
* setgridtype,curvilinear: bug fix for source gridtype GRID_LCC
2017-02-16 Uwe Schulzweida
......
......@@ -94,6 +94,7 @@ Operator catalog:
Seltime selsmon Select single month
Selbox sellonlatbox Select a longitude/latitude box
Selbox selindexbox Select an index box
Samplegrid samplegrid Resample grid
-------------------------------------------------------------
Conditional selection
-------------------------------------------------------------
......
......@@ -18,6 +18,7 @@ Select Selection
Selvar Selection
Seltime Selection
Selbox Selection
Samplegrid Selection
Cond Conditional selection
Cond2 Conditional selection
Condc Conditional selection
......
......@@ -14,9 +14,9 @@
@Parameter = nx [ny]
@BeginDescription
This operator distributes a dataset into smaller pieces. Each output file contains a different region of the horizontal
source grid. A target grid region contains a structured longitude/latitude box of the source grid. Only rectilinear and
curvilinear source grids are supported by this operator.
This operator distributes a dataset into smaller pieces. Each output file contains a different region of the
horizontal source grid. A target grid region contains a structured longitude/latitude box of the source grid.
Only rectilinear and curvilinear source grids are supported by this operator.
The number of different regions can be specified with the parameter @var{nx} and @var{ny}. The output files will be named
<obase><xxx><suffix> where suffix is the filename extension derived from the file format. xxx will have five digits with
the number of the target region.
......
@BeginModule
@NewPage
@Name = Samplegrid
@Title = Resample grid
@Section = Selection
@Class = Selection
@Arguments = infile outfile
@Operators = samplegrid
@BeginDescription
This is a special operator for resampling the horizontal grid.
No interpolation takes place. Factor=2 mean every second grid point is removed.
Only rectilinear and curvilinear source grids are supported by this operator.
@EndDescription
@EndModule
@BeginOperator_samplegrid
@Title = Resample grid
@Parameter = resamplefactor
@EndOperator
@BeginParameter
@Item = resamplefactor
FLOAT typically 2, which will half the resolution
@EndParameter
......@@ -8,7 +8,7 @@
@Operators = sellonlatbox selindexbox
@BeginDescription
Selects a box of the rectangularly understood field. All input fields need to have the same horizontal grid.
Selects a box of the rectangularly understood field.
@EndDescription
@EndModule
......
......@@ -300,7 +300,7 @@ cdo_SOURCES += Adisit.c \
Rotuv.c \
Runpctl.c \
Runstat.c \
SampleGrid.c \
Samplegrid.c \
Seascount.c \
Seaspctl.c \
Seasstat.c \
......
......@@ -215,7 +215,7 @@ am_cdo_OBJECTS = cdo-cdo.$(OBJEXT) cdo-Adisit.$(OBJEXT) \
cdo-Remap.$(OBJEXT) cdo-Remapeta.$(OBJEXT) \
cdo-Replace.$(OBJEXT) cdo-Replacevalues.$(OBJEXT) \
cdo-Rhopot.$(OBJEXT) cdo-Rotuv.$(OBJEXT) cdo-Runpctl.$(OBJEXT) \
cdo-Runstat.$(OBJEXT) cdo-SampleGrid.$(OBJEXT) \
cdo-Runstat.$(OBJEXT) cdo-Samplegrid.$(OBJEXT) \
cdo-Seascount.$(OBJEXT) cdo-Seaspctl.$(OBJEXT) \
cdo-Seasstat.$(OBJEXT) cdo-Selbox.$(OBJEXT) \
cdo-Selindex.$(OBJEXT) cdo-Select.$(OBJEXT) \
......@@ -581,7 +581,7 @@ cdo_SOURCES = cdo.c Adisit.c Afterburner.c Arith.c Arithc.c \
Mrotuv.c Mrotuvb.c Ninfo.c Nmldump.c Output.c Outputgmt.c \
Pack.c Pardup.c Pinfo.c Pressure.c Regres.c Remap.c Remapeta.c \
Replace.c Replacevalues.c Rhopot.c Rotuv.c Runpctl.c Runstat.c \
SampleGrid.c Seascount.c Seaspctl.c Seasstat.c Selbox.c \
Samplegrid.c Seascount.c Seaspctl.c Seasstat.c Selbox.c \
Selindex.c Select.c Selmulti.c Seloperator.c Selrec.c \
Seltime.c Selvar.c Set.c Setattribute.c Setbox.c Setgatt.c \
Setgrid.c Sethalo.c Setmiss.c Setpartab.c Setrcaname.c \
......@@ -918,7 +918,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Rotuv.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Runpctl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Runstat.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-SampleGrid.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Samplegrid.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Seascount.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Seaspctl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Seasstat.Po@am__quote@
......@@ -3405,19 +3405,19 @@ cdo-Runstat.obj: Runstat.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Runstat.obj `if test -f 'Runstat.c'; then $(CYGPATH_W) 'Runstat.c'; else $(CYGPATH_W) '$(srcdir)/Runstat.c'; fi`
 
cdo-SampleGrid.o: SampleGrid.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-SampleGrid.o -MD -MP -MF $(DEPDIR)/cdo-SampleGrid.Tpo -c -o cdo-SampleGrid.o `test -f 'SampleGrid.c' || echo '$(srcdir)/'`SampleGrid.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cdo-SampleGrid.Tpo $(DEPDIR)/cdo-SampleGrid.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='SampleGrid.c' object='cdo-SampleGrid.o' libtool=no @AMDEPBACKSLASH@
cdo-Samplegrid.o: Samplegrid.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Samplegrid.o -MD -MP -MF $(DEPDIR)/cdo-Samplegrid.Tpo -c -o cdo-Samplegrid.o `test -f 'Samplegrid.c' || echo '$(srcdir)/'`Samplegrid.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cdo-Samplegrid.Tpo $(DEPDIR)/cdo-Samplegrid.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Samplegrid.c' object='cdo-Samplegrid.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-SampleGrid.o `test -f 'SampleGrid.c' || echo '$(srcdir)/'`SampleGrid.c
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Samplegrid.o `test -f 'Samplegrid.c' || echo '$(srcdir)/'`Samplegrid.c
 
cdo-SampleGrid.obj: SampleGrid.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-SampleGrid.obj -MD -MP -MF $(DEPDIR)/cdo-SampleGrid.Tpo -c -o cdo-SampleGrid.obj `if test -f 'SampleGrid.c'; then $(CYGPATH_W) 'SampleGrid.c'; else $(CYGPATH_W) '$(srcdir)/SampleGrid.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cdo-SampleGrid.Tpo $(DEPDIR)/cdo-SampleGrid.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='SampleGrid.c' object='cdo-SampleGrid.obj' libtool=no @AMDEPBACKSLASH@
cdo-Samplegrid.obj: Samplegrid.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Samplegrid.obj -MD -MP -MF $(DEPDIR)/cdo-Samplegrid.Tpo -c -o cdo-Samplegrid.obj `if test -f 'Samplegrid.c'; then $(CYGPATH_W) 'Samplegrid.c'; else $(CYGPATH_W) '$(srcdir)/Samplegrid.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cdo-Samplegrid.Tpo $(DEPDIR)/cdo-Samplegrid.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Samplegrid.c' object='cdo-Samplegrid.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-SampleGrid.obj `if test -f 'SampleGrid.c'; then $(CYGPATH_W) 'SampleGrid.c'; else $(CYGPATH_W) '$(srcdir)/SampleGrid.c'; fi`
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Samplegrid.obj `if test -f 'Samplegrid.c'; then $(CYGPATH_W) 'Samplegrid.c'; else $(CYGPATH_W) '$(srcdir)/Samplegrid.c'; fi`
 
cdo-Seascount.o: Seascount.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Seascount.o -MD -MP -MF $(DEPDIR)/cdo-Seascount.Tpo -c -o cdo-Seascount.o `test -f 'Seascount.c' || echo '$(srcdir)/'`Seascount.c
......
......@@ -52,7 +52,7 @@ void cropData(double *array1, int gridID1, double *array2, int gridID2, int subI
}
void *SampleGrid(void *argument)
void *Samplegrid(void *argument)
{
int nrecs;
int varID, levelID;
......
......@@ -282,7 +282,7 @@ void *Maggraph(void *argument);
// HIRLAM_EXTENSIONS
void *Selmulti(void *argument); // "selmulti", "delmulti"
void *WindTrans(void *argument); // "uvDestag", "rotuvN", "rotuvNorth", "projuvLatLon"
void *SampleGrid(void *argument); // "samplegrid", "subgrid"
void *Samplegrid(void *argument); // "samplegrid", "subgrid"
#define AdisitOperators {"adisit", "adipot"}
......@@ -570,7 +570,7 @@ void *SampleGrid(void *argument); // "samplegrid", "subgrid"
// HIRLAM_EXTENSIONS
#define SelmultiOperators {"selmulti", "delmulti", "changemulti"}
#define WindTransOperators {"uvDestag", "rotuvN","rotuvNorth", "projuvLatLon"}
#define SampleGridOperators {"samplegrid", "subgrid"}
#define SamplegridOperators {"samplegrid", "subgrid"}
static modules_t Modules[] =
......@@ -843,7 +843,7 @@ static modules_t Modules[] =
{ Magvector, MagvectorHelp, MagvectorOperators, 1, CDI_REAL, 1, 1 },
{ Maggraph, MaggraphHelp, MaggraphOperators, 1, CDI_REAL, -1, 1 },
// HIRLAM_EXTENSIONS
{ SampleGrid, NULL, SampleGridOperators, 1, CDI_REAL, 1, 1 },
{ Samplegrid, SamplegridHelp, SamplegridOperators, 1, CDI_REAL, 1, 1 },
{ Selmulti, NULL, SelmultiOperators, 1, CDI_REAL, 1, 1 },
{ WindTrans, NULL, WindTransOperators, 1, CDI_REAL, 1, 1 },
};
......
......@@ -426,9 +426,9 @@ static const char *DistgridHelp[] = {
" distgrid,nx[,ny] infile obase",
"",
"DESCRIPTION",
" This operator distributes a dataset into smaller pieces. Each output file contains a different region of the horizontal ",
" source grid. A target grid region contains a structured longitude/latitude box of the source grid. Only rectilinear and",
" curvilinear source grids are supported by this operator.",
" This operator distributes a dataset into smaller pieces. Each output file contains a different region of the",
" horizontal source grid. A target grid region contains a structured longitude/latitude box of the source grid.",
" Only rectilinear and curvilinear source grids are supported by this operator.",
" The number of different regions can be specified with the parameter nx and ny. The output files will be named ",
" <obase><xxx><suffix> where suffix is the filename extension derived from the file format. xxx will have five digits with ",
" the number of the target region.",
......@@ -645,7 +645,7 @@ static const char *SelboxHelp[] = {
" selindexbox,idx1,idx2,idy1,idy2 infile outfile",
"",
"DESCRIPTION",
" Selects a box of the rectangularly understood field. All input fields need to have the same horizontal grid.",
" Selects a box of the rectangularly understood field.",
"",
"OPERATORS",
" sellonlatbox Select a longitude/latitude box",
......@@ -668,6 +668,23 @@ static const char *SelboxHelp[] = {
NULL
};
static const char *SamplegridHelp[] = {
"NAME",
" samplegrid - Resample grid",
"",
"SYNOPSIS",
" samplegrid,resamplefactor infile outfile",
"",
"DESCRIPTION",
" This is a special operator for resampling the horizontal grid.",
" No interpolation takes place. Factor=2 mean every second grid point is removed.",
" Only rectilinear and curvilinear source grids are supported by this operator.",
"",
"PARAMETER",
" resamplefactor FLOAT typically 2, which will half the resolution",
NULL
};
static const char *CondHelp[] = {
"NAME",
" ifthen, ifnotthen - Conditional select one field",
......
Markdown is supported
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