Welcome to American Weather
Sign in to follow this  
Followers 0
jgf

Complex Packing in GRIB2 files

6 posts in this topic

I want to convert a GRIB2 file with complex packing to either a GRIB1 or GRIB2 file without complex packing.

 

I understand that there are a variety of ways to do this in the unix environment, but I want to do it on a Windows 7 PC.

 

Is this going to be possible?

 

Thanks.

Share this post


Link to post
Share on other sites

I want to convert a GRIB2 file with complex packing to either a GRIB1 or GRIB2 file without complex packing.

 

I understand that there are a variety of ways to do this in the unix environment, but I want to do it on a Windows 7 PC.

 

Is this going to be possible?

 

Thanks.

 

In all seriousness, I'd abandon your dream of converting GRIB between different compression types on Windows 7 unless you're a programmer.  What I'd do, which is easy and quick is install VirtualBox. 

 

https://www.virtualbox.org/

 

It allows you to run Linux (or something else) within Windows by running a virtual machine.  You can install VB, throw a version of Ubuntu Linux in there and open it up by pointing VB at the Ubuntu OS file you downloaded. 

 

I'd say someone with some computer skills could get it going in an hour tops by following the instructions.  Then log into Linux and get the GRIB utility "cnvgrib" and it's helper utilities, which will do all that stuff you need. 

Share this post


Link to post
Share on other sites

Thanks - i will look into this.

 

it looks like cnvgrinb is fortran - wouldn't i have to install a fortran compiler too?

Share this post


Link to post
Share on other sites

Thanks - i will look into this.

 

it looks like cnvgrinb is fortran - wouldn't i have to install a fortran compiler too?

 

Yeah, I didn't think about that.  To cheat, you might try getting a Red Hat EL similar OS, like Fedora, then downloading the NCEP cnvgrib executable and see if it works.  That way, no messing around with installing compliers and (gasp) compiling all the codes yourself. 

 

Fedora ISO:

 

http://download.fedoraproject.org/pub/fedora/linux/releases/20/Live/x86_64/Fedora-Live-Desktop-x86_64-20-1.iso

 

Point your Virtual Box at that, like it's a Linux OS/drive/installation, per the Virtual Box instructions.

 

NCEP cnvgrib:

 

http://www.nco.ncep.noaa.gov/pmb/codes/nwprod/util/exec/cnvgrib

 

Put the executable somewhere on your user's $PATH, like /bin.  Or in a Linux terminal, type:

 

echo $PATH

 

and put it in one of the directories listed. 

 

Make sure it's executable. Type:

 

chmod +x cnvgrib

 

Execute it with no arguments and see if it works.  It should spit out usage instructions.

 

If I remember correctly, cnvgrib is compiled statically so it should be self-contained and work on similar OS'es. 

 

If this quick cheat doesn't work then yes, get the gcc package and install.  Then get the cnvgrib instructions and install all packages then cnvgrib. 

 

http://www.nco.ncep.noaa.gov/pmb/codes/GRIB2/

Share this post


Link to post
Share on other sites

thanks, i only just saw your response.

 

i might try your suggestion, as i haven't found any other solution yet

Share this post


Link to post
Share on other sites

thanks, i only just saw your response.

 

i might try your suggestion, as i haven't found any other solution yet

 

You may also be able to accomplish grib file conversion with the climate data operator program (CDO). It should be something like:

cdo -f grb2 copy file1.grb1 file2.grb2

Under Ubuntu, you can install it with 'sudo apt-get install cdo' and 'yum install cdo' with Fedora.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.