Commit 5f98297a authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Pack: added docu.

parent 0a0fc0a8
......@@ -16,6 +16,7 @@ Version 1.9.9 (29 October 2020):
* Yearly arithmetic: yearadd, yearsub, yearmul, yeardiv
* apply: Apply an operator on each input file
* gh2hl: Interpolate 3D geometric height to height levels
* pack: Pack data (NetCDF attribute add_offset/scale_factor)
* verifygrid: Verify grid coordinates
* addtrend: Add trend
* isosurface: Extract isosurface
......
......@@ -46,6 +46,7 @@ Operator catalog:
Copy copy Copy datasets
Copy cat Concatenate datasets
Tee tee Duplicate a data stream
Pack pack Pack data
Replace replace Replace variables
Duplicate duplicate Duplicates a dataset
Mergegrid mergegrid Merge grid
......
......@@ -8,6 +8,7 @@ Filedes Information
Apply File operations
Copy File operations
Tee File operations
Pack File operations
Replace File operations
Duplicate File operations
Mergegrid File operations
......
......@@ -123,7 +123,7 @@ Pack(void *process)
tsID++;
}
const int nts = tsID;
const auto nts = tsID;
if (CdoDefault::DataType != CDI_UNDEFID)
{
......
......@@ -114,7 +114,7 @@ static const module_t module_Nmldump = {Nmldump , {}
static const module_t module_Output = {Output , OutputHelp , OutputOperators , EXPOSED , CDI_BOTH , -1 , 0 , NoRestriction };
static const module_t module_Outputtab = {Output , OutputtabHelp , OutputtabOperators , EXPOSED , CDI_REAL , -1 , 0 , NoRestriction };
static const module_t module_Outputgmt = {Outputgmt , OutputgmtHelp , OutputgmtOperators , EXPOSED , CDI_REAL , 1 , 0 , NoRestriction };
static const module_t module_Pack = {Pack , {} , PackOperators , EXPOSED , CDI_REAL , 1 , 1 , NoRestriction };
static const module_t module_Pack = {Pack , PackHelp , PackOperators , EXPOSED , CDI_REAL , 1 , 1 , NoRestriction };
static const module_t module_Pardup = {Pardup , {} , PardupOperators , EXPOSED , CDI_REAL , 1 , 1 , NoRestriction };
static const module_t module_Pinfo = {Pinfo , {} , PinfoOperators , EXPOSED , CDI_REAL , 1 , 1 , NoRestriction };
static const module_t module_Pressure = {Pressure , {} , PressureOperators , EXPOSED , CDI_REAL , 1 , 1 , NoRestriction };
......
......@@ -291,6 +291,23 @@ static const char *TeeHelp[] = {
nullptr
};
static const char *PackHelp[] = {
"NAME",
" pack - Pack data",
"",
"SYNOPSIS",
" pack infile outfile",
"",
"DESCRIPTION",
" Packing reduces the data volume by reducing the precision of the stored numbers.",
" It is implemented using the NetCDF attributes add_offset and scale_factor.",
" The operator pack calculates the attributes add_offset and scale_factor for all variables.",
" The default data type for all variables is automatically changed to 16-bit integer.",
" Use the CDO option -b to change the data type to a different integer precision, if needed.",
" Missing values are automatically transformed to the current data type.",
nullptr
};
static const char *ReplaceHelp[] = {
"NAME",
" replace - Replace variables",
......
......@@ -21,15 +21,9 @@
bool
fileExists(const char *restrict filename)
{
bool status = false;
struct stat buf;
if (stat(filename, &buf) == 0)
{
if (S_ISREG(buf.st_mode) && buf.st_size > 0) status = true;
}
return status;
const auto status = stat(filename, &buf);
return (status == 0) && (S_ISREG(buf.st_mode) && buf.st_size > 0);
}
bool
......
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