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

[netCDF #LWQ-650096]: Request help with NetCDf file read and export



Hello Charles,

There is not an easy way to convert from netCDF to .xlsx or .csv; the netCDF 
format was created to manage high-dimensional scientific data, which does not 
lend itself to flat-file or traditional database storage.   I can provide some 
help for querying the If you have the netCDF libraries installed on your 
system, you should also have the netCDF utilities 'nccopy', 'ncdump', and 
'ncgen' available to you from the command line.  At the simplest, you can use 
'ncdump' on the command line to extract the raw data and massage into a format 
you can massage into a .csv file.  You might also be able to use the netcdf 
operator (NCO) tools, but I'm afraid I can't provide much help as we don't 
maintain those tools ourselves.  The NCO project page is here: 
http://nco.sourceforge.net/.

To answer your question, you do not need to register as a netcdf user.  I do 
not use Numpy myself, but it may be easiest to see if there is a function or 
utility as part of Numpy that will make conversion to a .csv file easier.

I'm sorry I can't provide a more immediately helpful answer, but hopefully this 
will get you headed in the right direction.

-Ward

Ward Fisher
address@hidden
UCAR/Unidata - Software Engineer


> Hello,  I'm a first-time user of NetCDF files and I would like to read a 
> series of 20 .nc files and export them to either to an .xlsx or csv format in 
> order to analyze them statistically. They are NetCDF3.  I know next to 
> nothing about the attributes (raster or vector?) and neither does the 
> supplier of the files. Could you help me? Do I have to register as a netcdf 
> user?.  
> 
> For what it's worth, As a beginner programmer in Numpy I was able to import 
> one successfully  but the output was only header information (this may be 
> useful to you in interpreting what kind of .nc file it is):  See attached  
> with the code and output.  Thank you very much
> Charles Fisk
> 
> 


Ticket Details
===================
Ticket ID: LWQ-650096
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.