Dear Yogesh,
I did the same some time ago, and finally what I did was to load the ASCII data, regrid if you want to the desired grid and save then as netcdf.
define axis/x=1:360:1 long_grid
define axis/y=1:180:1 lat_grid
define grid/x=long_grid/y=lat_grid newgrid
!Open your file as usual
file/var="co2"/format=unformatted/grid=newgrid my_file.txt
!Change the grid if you want
let gridded_co2=co2[gx=long_grid,gy=lat_grid]
!Save as netcdf
save/file=output.cdf gridded_co2
Hope it helps!
De: owner-ferret_users@xxxxxxxx [mailto:owner-ferret_users@xxxxxxxx] En nombre de Yogesh Tiwari
Enviado el: viernes, 19 de junio de 2009 9:08
Para: oar.pmel.ferret_users@xxxxxxxx
Asunto: [ferret_users] ASCII to netcdf
Hello Ferret Users,
I have ASCII data file (attached) contains CO2 values in 360 columns and 180 rows (and has a 1 degree latitude by 1 degree longitude spatial rersolution, with a monthly temporal resolution). The upper left corner of data file centered at 179.5W, 89.5N and the lower right corner at 179.5E, 89.5S.
I would like to produce netcdf file with one variable CO2 and would like to see shade plot.
I tried following but it did"t work
*********
define axis/x=1:360:1 long_grid
define axis/y=1:180:1 lat_grid
define grid/x=long_grid/y=lat_grid newgrid
file/var=co2/grid=newgrid ../CO2_199701.txt
*********
Kindly anyone can help.
Thanks,
Regards,
Yogesh
--
Yogesh K. Tiwari (Dr.rer.nat),
Scientist,
Indian Institute of Tropical Meteorology,
Homi Bhabha Road,
Pashan,
Pune-411008
INDIA
Phone: 0091-99 2273 9513 (Cell)
: 0091-20-25904350 (O)
Fax : 0091-20-258 93 825
Attachment:
plot.gif
Description: GIF image