[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #RJB-156641]: hgt.mon.mean.nc and nc2text


> I think I understand what the problem is, now that the data is in a
> compressed format and I need to either uncompress it or change something in
> my netCDF programs.
> I have preciously followed these instructions from a friend;
> "Set up a directory to muck around in, download
> ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/win32/netcdf-3.6.1-beta1-win32dll.zip
> and ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/fan-2.0.3.win32bin.zip and
> extract netcdf.dll, ncdump.exe, ncmeta.exe and nc2text.exe. Place your
> NetCDF (.nc) file in the directory as well. Open a command prompt and change
> to the directory you created by typing something like 'cd
> \Users\amiskelly\Desktop\netcdf'."
> I was then able to run the nc2text command to extract the data. eg
> nc2text hgt.mon.mean.nc hgt[,0,35,1]>Text0\N035-1.txt
> nc2text hgt.mon.mean.nc hgt[,2,35,1]>Text2\N235-1.txt
> nc2text hgt.mon.mean.nc hgt[,5,35,1]>Text5\N535-1.txt
> What I need from you is also an exact set of instructions what to do so that
> I can continue to extract the data into text form. I need the exact step by
> step instrcutions to set up a working version of netCDF on my computer. I do
> not know how to compile files etc. Can you please provide those
> instructions. I have tried reading the various links but just do not know
> what to do. All I need to do is to achieve what I was doing before.

I can provide instructions for how to download and install a pre-compiled
netCDF-4 library for Windows from this web page, under the section "Latest 
Stable Release (netCDF-C 4.3.2)":


However, you will have to decide whether to download the 32-bit or 64-bit
configuration, that is one of the files netCDF4.3.2-NC4-32.exe or
netCDF4.3.2-NC4-64.exe. If you don't know which one to use, try the 32-bit
one first.

I can't tell you how to get a version of nc2text.exe that is linked with
the new library without compiling it from source.  nc2text is not Unidata
software, so we don't maintain or support it.  The original developer,
Harvey Davies, retired from the Australian research organization that
employed him some years ago, and we have no current contact information 
for him.

However, the source for nc2text is freely available from our collection
of third-party software, as part of fan.tar.Z from:


and you might be able to find instructions for building it or get a
pre-built version from someone else, either by asking about it on 
StackOverflow.com or on the address@hidden mailing list.
Beware of just downloading a pre-compiled package from a Google
search of nc2text.exe, as most of those seem to be linked with a
netCDF-3 library, and hence unable to handle compression.

> ----- Original Message -----
> From: "Unidata netCDF Support" <address@hidden>
> To: <address@hidden>
> Cc: <address@hidden>
> Sent: Friday, November 07, 2014 6:05 AM
> Subject: [netCDF #RJB-156641]: hgt.mon.mean.nc and nc2text
> > Hi Michal,
> >
> >> I have been using the command "nc2text" to extract data from the "Link to
> >> files" data set in the link below that extracts the netCDF file "
> >> hgt.mon.mean.nc". This is or has always been a netCDF file and has worked
> >> for me over the past couple of years, yet this month for the first time
> >> the
> >> program is telling me "Not a netCDF file" and does not work. The file
> >> size
> >> of the file "hgt.mon.mean.nc" looks to be about 1/2 of what it should be
> >> compared to last month so I susspect the upload to the ftp server has
> >> failed. But I do not know if NOAA changed the format or if its corrupt
> >> just
> >> this month. If the format has changed then has there been an update to
> >> "nc2text"?. I have no idea currently.
> >>
> >> http://www.esrl.noaa.gov/psd/cgi-bin/db_search/DBSearch.pl?Dataset=CDC+Derived+NCEP+Reanalysis+Products+Pressure+Level&Variable=Geopotential+height&Statistic=Mean&group=0&submit=Search
> >
> > NOAA changed to use netCDF-4 classic model format instead of
> > netCDF classic format.  The data is still in a netCDF format
> > that can be read by any previous netCDF program, as long as
> > the program is relinked to the netCDF-4 library. You are
> > probably using nc2text linked with the older netCDF-3 library
> > that did not support lossless compression of data.  This is
> > a feature of netCDF-4 that many organizations are making use
> > of, because it results in significantly smaller data files
> > that can be accessed more quickly across a network.
> >
> > More information about the netCDF-4 classic model format is
> > available from the links below:
> >
> >  http://www.unidata.ucar.edu/netcdf/docs/faq.html#formats-and-versions
> >  http://www.unidata.ucar.edu/netcdf/workshops/2012/performance/
> >  http://www.unidata.ucar.edu/presentations/Rew/netcdf-intro-2014.pdf
> >
> > If you compiled nc2text from source, you shouldn't have to change anything
> > in
> > the program.  Instead, you need to download a more recent version of
> > netCDF-4,
> > build and install it, then compile and link nc2text to use the newly
> > installed
> > netCDF C library.  You can get the new version and instructions for
> > building
> > it from here:
> >
> >  http://www.unidata.ucar.edu/netcdf/docs/
> >
> > --Russ
> >
> >
> > Russ Rew                                         UCAR Unidata Program
> > address@hidden                      http://www.unidata.ucar.edu
> >
> >
> >
> > Ticket Details
> > ===================
> > Ticket ID: RJB-156641
> > Department: Support netCDF
> > Priority: Normal
> > Status: Closed
> >
Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu

Ticket Details
Ticket ID: RJB-156641
Department: Support netCDF
Priority: Normal
Status: Closed

NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.