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

Added support for CDI_COMPRESS_AEC.

parent bafaf21f
......@@ -226,10 +226,11 @@ void *Sinfo(void *argument)
set_text_color(stdout, RESET, BLUE);
fprintf(stdout, " %-3s", pstr);
if ( vlistInqVarCompType(vlistID, varID) == CDI_COMPRESS_NONE )
int comptype = vlistInqVarCompType(vlistID, varID);
if ( comptype == CDI_COMPRESS_NONE )
fprintf(stdout, " ");
else
fprintf(stdout, "z ");
fprintf(stdout, "%c ", (int)comp_name(comptype)[0]);
reset_text_color(stdout);
......
......@@ -301,8 +301,8 @@ void cdo_usage(void)
fprintf(stderr, " -v, --verbose Print extra details for some operators\n");
fprintf(stderr, " -W Print extra warning messages\n");
fprintf(stderr, " -z szip SZIP compression of GRIB1 records\n");
fprintf(stderr, " aec AEC compression of GRIB2 records\n");
fprintf(stderr, " jpeg JPEG compression of GRIB2 records\n");
fprintf(stderr, " ccsds CCSDS compression of GRIB2 records\n");
fprintf(stderr, " zip[_1-9] Deflate compression of NetCDF4 variables\n");
#ifdef HIRLAM_EXTENSIONS
fprintf(stderr, " --Dkext <debLev> Setting debugLevel for extensions\n");
......@@ -658,9 +658,9 @@ void defineCompress(const char *arg)
cdoCompType = CDI_COMPRESS_SZIP;
cdoCompLevel = 0;
}
else if ( strncmp(arg, "ccsds", len) == 0 )
else if ( strncmp(arg, "aec", len) == 0 )
{
cdoCompType = CDI_COMPRESS_SZIP;
cdoCompType = CDI_COMPRESS_AEC;
cdoCompLevel = 0;
}
else if ( strncmp(arg, "jpeg", len) == 0 )
......@@ -668,11 +668,6 @@ void defineCompress(const char *arg)
cdoCompType = CDI_COMPRESS_JPEG;
cdoCompLevel = 0;
}
else if ( strncmp(arg, "gzip", len) == 0 )
{
cdoCompType = CDI_COMPRESS_GZIP;
cdoCompLevel = 6;
}
else if ( strncmp(arg, "zip", 3) == 0 )
{
cdoCompType = CDI_COMPRESS_ZIP;
......
......@@ -58,6 +58,16 @@ void time2str(int time, char *timestr, int maxlen)
}
const char *comp_name(int comptype)
{
if ( comptype == CDI_COMPRESS_SZIP ) return "szip";
if ( comptype == CDI_COMPRESS_ZIP ) return "zip";
if ( comptype == CDI_COMPRESS_JPEG ) return "jpeg";
if ( comptype == CDI_COMPRESS_AEC ) return "aec";
return " ";
}
void printFiletype(int streamID, int vlistID)
{
int filetype = streamInqFiletype(streamID);
......@@ -89,36 +99,22 @@ void printFiletype(int streamID, int vlistID)
}
// clang-format on
if ( filetype == CDI_FILETYPE_GRB || filetype == CDI_FILETYPE_NC4 || filetype == CDI_FILETYPE_NC4C )
{
int nvars = vlistNvars(vlistID);
for ( int varID = 0; varID < nvars; varID++ )
{
int comptype = vlistInqVarCompType(vlistID, varID);
if ( comptype )
{
if ( comptype == CDI_COMPRESS_SZIP ) printf(" szip");
else if ( comptype == CDI_COMPRESS_ZIP ) printf(" zip");
break;
}
}
}
if ( filetype == CDI_FILETYPE_GRB2 )
{
int nvars = vlistNvars(vlistID);
for ( int varID = 0; varID < nvars; varID++ )
{
int comptype = vlistInqVarCompType(vlistID, varID);
if ( comptype )
{
if ( comptype == CDI_COMPRESS_JPEG ) printf(" jpeg");
else if ( comptype == CDI_COMPRESS_SZIP ) printf(" ccsds");
break;
}
}
}
int nvars = vlistNvars(vlistID);
int comps[] = {CDI_COMPRESS_ZIP, CDI_COMPRESS_JPEG, CDI_COMPRESS_SZIP, CDI_COMPRESS_AEC};
unsigned kk = 0;
for ( unsigned k = 0; k < sizeof(comps)/sizeof(int); ++k )
for ( int varID = 0; varID < nvars; varID++ )
{
int comptype = vlistInqVarCompType(vlistID, varID);
if ( comptype == comps[k] )
{
if ( kk++ == 0 ) printf(" ");
else printf("/");
printf("%s", comp_name(comptype));
break;
}
}
printf("\n");
}
......
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