Hi Igaratza,
Greeat thanks for help,
Following script works and I can shade CO2 variable, BUT
The magnitude of variable in the plot is too low, at three decimal place, whereas in the data file its in the range of two digits,
kindly can you suggest, what I am doing wrong in following script:
(here I attached shade plot created from following script)
***********************
define axis/x=-180:180:1 long_grid
define axis/y=-90:90:1 lat_grid!Open file as usual
define grid/x=long_grid/y=lat_grid newgrid
file/var="co2"/format=unformatted/grid=newgrid "./temp/CO2_199710.txt"save/file=CO2_199710.cdf gridded_co2
!Change the grid if you want
let gridded_co2=co2[gx=long_grid,gy=lat_grid]
!Save as netcdf
shade gridded_co2
*******************
Thanks,
YogeshOn Fri, Jun 19, at 3:36 PM, Igaratza Fraile <ifraile@xxxxxxx> wrote:
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
--
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