[gradsusr] Writing GrADS netCDF files with IDL

Hyacinth Nnamchi hyacinth.1 at hotmail.com
Tue Sep 13 15:09:05 EDT 2011


Richard,

Like you said that you have already created gridded binary. All you need do is to create  a .ctl file to read the binary and then write out netCDF in GrADS.

Say your .ctl is exactly like the one on the link you referred to at http://grads.iges.org/grads/gadoc/aboutgriddeddata.html, and you want to write the variable slp to netCDF. After you open the file, all you need do is something like:

->  set lon 0 360
-> set lat 90 90
-> set t 1 last
-> slp = slp
-> set sdfwrite gridded_data_sample.nc           
-> sdfwrite slp


This will create a new netCDF file named sdfwrite gridded_data_sample.nc . You read more about "sdfwrite"  by looking it up on the GrADS documentation: http://www.iges.org/grads/gadoc/gadocindex.html. 
******In case you have several variables in one file, I'm not so GrADS can handle them at once. You may have to write them to netCDF one-after-another and then use cdo or nco to concatenate the netCDF files to one.************

Best,

Hyacinth 


> Date: Tue, 13 Sep 2011 15:49:33 +0000
> From: "Bantges, Richard J" <r.bantges at imperial.ac.uk>
> Subject: [gradsusr] Writing GrADS netCDF files with IDL
> To: "gradsusr at gradsusr.org" <gradsusr at gradsusr.org>
> Message-ID:
> 	<DE4EEC0FA6E54A41A1891FD83EFF85AB0AAF3F62 at icexch-m6.ic.ac.uk>
> Content-Type: text/plain; charset="us-ascii"
> 
> Hi there,
> 
> I'm trying to write a GrADS compatible netCDF file using ITT's IDL software, that can then be read in using GrADS's sdfopen command. Does anyone have an example IDL procedure that does this please?
> 
> I've managed to write out data in a gridded binary data file that is described here http://grads.iges.org/grads/gadoc/aboutgriddeddata.html but ideally I'd like to write these in netCDF format. The main problem is writing the netCDF so that the associated control file accurately describes the netCDF file content.
> 
> So, if anyone has a very simple IDL procedure that writes out a netCDF file that can be directly read by GrADS using the sdfopen command that would be fantastic.
> 
> Rich
> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110913/96e5969c/attachment.html 
> 
> ------------------------------
> 
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
> 
> 
> End of gradsusr Digest, Vol 19, Issue 21
> ****************************************
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110914/8c52da84/attachment-0003.html 


More information about the gradsusr mailing list