Commit d7da08cf authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Docu update.

parent ffbbfe39
......@@ -121,6 +121,7 @@ Operator catalog:
-------------------------------------------------------------
Modification
-------------------------------------------------------------
Setattributes setattribute Set attributes
Setpartab setpartabp Set parameter table
Setpartab setpartabn Set parameter table
Set setcodetab Set parameter code table
......@@ -153,7 +154,6 @@ Operator catalog:
Setgrid setgridarea Set grid cell area
Setzaxis setzaxis Set z-axis
Setzaxis genlevelbounds Generate level bounds
Setattributes setattribute Set attributes
Invert invertlat Invert latitudes
Invertlev invertlev Invert levels
Shiftxy shiftx Shift x
......
......@@ -24,13 +24,13 @@ Condc Conditional selection
MapReduce Conditional selection
Comp Comparison
Compc Comparison
Setattributes Modification
Setpartab Modification
Set Modification
Settime Modification
Change Modification
Setgrid Modification
Setzaxis Modification
Setattributes Modification
Invert Modification
Invertlev Modification
Shiftxy Modification
......
......@@ -35,6 +35,9 @@ The value of @bold{att_nm} is the name of the attribute you want to set.
The value of @bold{att_val} is the contents of the attribute @bold{att_nm}. @bold{att_val} may be a single value
or one-dimensional array of elements. The type of the attribute value will be detected
automaticly from the contents of the value.
A special meaning has the attribute name @bold{FILE}. If this is the 1st attribute then all attributes
are read from a file specified in the value of @bold{att_val}.
@EndDescription
@EndModule
......
......@@ -141,7 +141,7 @@ void set_attributes(list_t *kvlist, int vlistID)
for ( int idx = 0; idx < nv; ++idx )
{
int varID = varIDs[idx];
if ( cdoVerbose ) printf("varID, cdiID, attname %d %d %s %d\n", varID, cdiID, attname, (int)strlen(attname));
// if ( cdoVerbose ) printf("varID, cdiID, attname %d %d %s %d\n", varID, cdiID, attname, (int)strlen(attname));
if ( dtype == CDI_DATATYPE_INT8 || dtype == CDI_DATATYPE_INT16 || dtype == CDI_DATATYPE_INT32 )
{
int *ivals = (int*) Malloc(nvalues*sizeof(int));
......@@ -196,8 +196,9 @@ void *Setattribute(void *argument)
if ( natts == 1 )
{
keyValues_t *kv = *(keyValues_t **)kvlist->head->data;
if ( STR_IS_EQ(kv->key, "file") )
if ( STR_IS_EQ(kv->key, "FILE") )
{
if ( cdoVerbose ) cdoPrint("Reading attributes from: %s", kv->values[0]);
const char *filename = parameter2word(kv->values[0]);
FILE *fp = fopen(filename, "r");
if ( fp == NULL ) cdoAbort("Open failed on: %s\n", filename);
......
......@@ -849,6 +849,41 @@ static const char *CompcHelp[] = {
NULL
};
static const char *SetattributeHelp[] = {
"NAME",
" setattribute - Set attributes",
"",
"SYNOPSIS",
" setattribute,attributes infile outfile",
"",
"DESCRIPTION",
" This operator sets attributes of a dataset. Each attribute has the following structure:",
" ",
" [var_nm@]att_nm=att_val",
" ",
" var_nm Variable name (optional). Example: pressure",
" att_nm Attribute name. Example: units",
" att_val Comma separated list of attribute values. Example: pascal",
" ",
" The value of var_nm is the name of the variable containing the attribute (named att_nm) that",
" you want to set. Use wildcards to set the attribute att_nm to more than one variable.",
" A value of var_nm of '*' will set the attribute att_nm to all data variables.",
" If var_nm is missing then att_nm refers to a global attribute.",
" ",
" The value of att_nm is the name of the attribute you want to set.",
" ",
" The value of att_val is the contents of the attribute att_nm. att_val may be a single value",
" or one-dimensional array of elements. The type of the attribute value will be detected",
" automaticly from the contents of the value.",
" ",
" A special meaning has the attribute name FILE. If this is the 1st attribute then all attributes",
" are read from a file specified in the value of att_val.",
"",
"PARAMETER",
" attributes STRING Comma separated list of attributes. ",
NULL
};
static const char *SetpartabHelp[] = {
"NAME",
" setpartabp, setpartabn - Set parameter table",
......@@ -1114,38 +1149,6 @@ static const char *SetzaxisHelp[] = {
NULL
};
static const char *SetattributeHelp[] = {
"NAME",
" setattribute - Set attributes",
"",
"SYNOPSIS",
" setattribute,attributes infile outfile",
"",
"DESCRIPTION",
" This operator sets attributes of a dataset. Each attribute has the following structure:",
" ",
" [var_nm@]att_nm=att_val",
" ",
" var_nm Variable name (optional). Example: pressure",
" att_nm Attribute name. Example: units",
" att_val Comma separated list of attribute values. Example: pascal",
" ",
" The value of var_nm is the name of the variable containing the attribute (named att_nm) that",
" you want to set. Use wildcards to set the attribute att_nm to more than one variable.",
" A value of var_nm of '*' will set the attribute att_nm to all data variables.",
" If var_nm is missing then att_nm refers to a global attribute.",
" ",
" The value of att_nm is the name of the attribute you want to set.",
" ",
" The value of att_val is the contents of the attribute att_nm. att_val may be a single value",
" or one-dimensional array of elements. The type of the attribute value will be detected",
" automaticly from the contents of the value.",
"",
"PARAMETER",
" attributes STRING Comma separated list of attributes. ",
NULL
};
static const char *InvertHelp[] = {
"NAME",
" invertlat - Invert latitudes",
......
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