Project

General

Profile

How to convert srv to ieg

Added by Aditya dubey almost 7 years ago

Dear All,

I have srv file and want to convert it into netcdf. Though using cdo it is working, but want your comments is it okay...I am using following commnads

cdo -r -f nc copy I/P.srv O/P.nc

Also when converting other-way round, srv file size is not reducing remains same as netcdf

cdo -r -f srv copy I/P.nc O/P.srv

Missing value is also creating an issue while converting to netcdf.

Pl advice what is wrong/missing and how to handle missing values. I am attaching a sample srv file.

Thanking you,

Best regards,
Aditya

Here is my cdo environment:

[adubey@localhost ~]$ cdo -V
Climate Data Operators version 1.7.2 (http://mpimet.mpg.de/cdo)
Compiled: by adi on localhost.localdomain (x86_64-unknown-linux-gnu) Dec 31 2016 19:01:57
Compiler: gcc -fPIC -fopenmp
version: gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)
Features: DATA PTHREADS OpenMP45 HDF5 NC4/HDF5 SSE2
Libraries: HDF5/1.8.13
Filetypes: srv ext ieg grb grb2 nc nc2 nc4 nc4c
CDI library version : 1.7.2 of Dec 31 2016 19:01:37
CGRIBEX library version : 1.7.5 of Jun 3 2016 14:44:00
GRIB_API library version : 1.14.7
NetCDF library version : 4.4.1.1 of Dec 31 2016 18:41:01 $
HDF5 library version : 1.8.13
SERVICE library version : 1.4.0 of Dec 31 2016 19:01:33
EXTRA library version : 1.4.0 of Dec 31 2016 19:01:31
IEG library version : 1.4.0 of Dec 31 2016 19:01:32
FILE library version : 1.8.2 of Dec 31 2016 19:01:31


Replies (3)

RE: How to convert srv to ieg - Added by Karin Meier-Fleischer almost 7 years ago

Hi Aditya,

you did it well. The conversion from srv to netCDF should be done with

cdo -r -f nc sample.srv sample.nc

And if you compare the two files with

cdo diff sample.srv sample.nc

it shows no difference (cdo version 1.8.0).

But what is your problem with missing values? Please, be more specific.

Bye,
Karin

RE: How to convert srv to ieg - Added by Aditya dubey almost 7 years ago

Hello Karin,

Its ok with me also but when I am converting netcdf to ieg missing value is coming as normal value. I am attaching snapshot of what I am doing with result. Also I am attaching my sample file.

[adubey@localhost netcdf]$ cdo info sample.nc
-1 : Date Time Level Gridsize Miss : Minimum Mean Maximum : Parameter ID
1 : 1951-01-01 00:00:00 0 961 627 : 2.4500 16.769 27.060 : 169
2 : 1951-01-02 00:00:00 0 961 627 : 4.5100 16.576 26.950 : 169
3 : 1951-01-03 00:00:00 0 961 627 : 3.6900 16.479 26.930 : 169
4 : 1951-01-04 00:00:00 0 961 627 : 3.9000 16.661 26.640 : 169
5 : 1951-01-05 00:00:00 0 961 627 : 3.4400 16.996 26.900 : 169
cdo info: Processed 4805 values from 1 variable over 5 timesteps ( 0.00s )
[adubey@localhost netcdf]$ cdo -r -f ieg copy sample.nc sample.ieg
cdo copy: Processed 4805 values from 1 variable over 5 timesteps ( 0.00s )
[adubey@localhost netcdf]$ cdo info sample.ieg
-1 : Date Time Level Gridsize Miss : Minimum Mean Maximum : Parameter ID
1 : 1951-01-01 00:00:00 0 961 0 : -9999.9 -6518.6 27.060 : 169.128
2 : 1951-01-02 00:00:00 0 961 0 : -9999.9 -6518.6 26.950 : 169.128
3 : 1951-01-03 00:00:00 0 961 0 : -9999.9 -6518.7 26.930 : 169.128
4 : 1951-01-04 00:00:00 0 961 0 : -9999.9 -6518.6 26.640 : 169.128
5 : 1951-01-05 00:00:00 0 961 0 : -9999.9 -6518.5 26.900 : 169.128
cdo info: Processed 4805 values from 1 variable over 5 timesteps ( 0.00s )

Please suggest any way to correct it.

Best,
Aditya

RE: How to convert srv to ieg - Added by Karin Meier-Fleischer almost 7 years ago

Hi Aditya,

you have to define the missing value of your srv file to do the right conversion to netCDF to ieg. You didn't attach a new file so I had to do it with the old sample.srv which has missing value -999.0:

cdo -r -f nc -setctomiss,-999.0 sample.srv sample_miss.nc
-1 : Date Time Level Gridsize Miss : Minimum Mean Maximum : Parameter ID
1 : 2015-01-01 00:00:00 0 17415 12451 : 0.0000 2.0796 115.63 : 260
2 : 2015-01-02 00:00:00 0 17415 12451 : 0.0000 3.0660 143.75 : 260
3 : 2015-01-03 00:00:00 0 17415 12451 : 0.0000 2.5568 59.565 : 260
4 : 2015-01-04 00:00:00 0 17415 12451 : 0.0000 2.0281 62.626 : 260
5 : 2015-01-05 00:00:00 0 17415 12451 : 0.0000 0.79011 26.000 : 260

and convert to ieg

cdo -r -f ieg copy sample_miss.nc sample_miss.ieg
-1 : Date Time Level Gridsize Miss : Minimum Mean Maximum : Parameter ID
1 : 2015-01-01 00:00:00 0 17415 12451 : 0.0000 2.0796 115.63 : 260
2 : 2015-01-02 00:00:00 0 17415 12451 : 0.0000 3.0660 143.75 : 260
3 : 2015-01-03 00:00:00 0 17415 12451 : 0.0000 2.5568 59.565 : 260
4 : 2015-01-04 00:00:00 0 17415 12451 : 0.0000 2.0281 62.626 : 260
5 : 2015-01-05 00:00:00 0 17415 12451 : 0.0000 0.79011 26.000 : 260

Bye,
Karin

    (1-3/3)