[gradsusr] Gradstoexcel

Rupak Rajbhandari rupak.rajbhandari at gmail.com
Sat Aug 3 22:09:00 EDT 2013


Hi,

Attached is the GrADS script which extract information from 360x180 per
record file (exactly your file size) and writes ASCII file which you can
import into excel very easily.

In the file "ifp" is the input file path where your .nc file is located.
"ofp" is the output file path where you want to put the newly written ASCII
file.
The script writes variable 'tmin' (minimum temperature) and creates a daily
file. The naming convention is "tminYYYYDDMM.dat"

Edit x1 and x2 to 60 & 100 and y1, y2 to 5 & 40, ncol=41 (in your case).
My nc file is "tmin_daily_1965-1965.nc"
I have replaced 1965 or whatever year it is by variable "i' through the
script.

In short, "fprintf" function does what you are looking for. All you have to
do is manage accordingly to your needs.

Hope the script solves your problem and useful to you.

-rupak

++++++++++++++++++++++++++++++++++
Rupak Rajbhandari
Department of Meteorology
TriChandra College
Kathmandu





On Sat, Aug 3, 2013 at 8:46 PM, Sushant Das <sushant_models at yahoo.com>wrote:

>
> Dear GrADS Users,
>
> I need to know how to extract data from .nc format and write it in excel
> gridded format file?
> For eg.
> I have a netcdf file consisting of 180 by 360 data. Now i have to extract
> for the Indian domain say 60-100E and 5-40N
> so total grids would would be 40*35.
> After extracting the data it has to be written in excel sheet having
> format  with varying lat in y axis and varying lon in x axis containing
> 40*35 data cells.
>
> Thanks in advance,
>
> Regards,
>
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------
> SUSHANT DAS,
> CSIR Research Fellow,
> Centre for Atmospheric Sciences,Block VI
> Indian Institute of Technology, Delhi
> New Delhi-110016,
> INDIA
>
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130804/ac52eda3/attachment-0003.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nc2ascDD.gs
Type: application/octet-stream
Size: 1238 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20130804/ac52eda3/attachment-0003.obj 


More information about the gradsusr mailing list