Ranyere,<br><br> As an alternative, here is how you would do his using PyGrADS:<br><br>---------------------------------------------------------------------------------------------------<br>import grads<br>ga = grads.GaNum(Bin='gradsnc',Echo=False,Window=False) # start grads<br>
fh = ga.open("../data/model.nc") # open file<br>ts = ga.exp('ts') # export a variable to python<br>print " Lon Lat Ts"<br>print "-------- -------- --------"<br>
for j in range(fh.ny):<br> for i in range(fh.nx):<br> print "%8.3f %8.3f %8.2f"%(ts.grid.lon[i],ts.grid.lat[j],ts[j,i])<br>----------------------------------------------------------------------------------------------------------<br>
which produces:<br><br> Lon Lat Ts<br>-------- -------- --------<br> 0.000 -90.000 258.49<br> 5.000 -90.000 258.49<br> 10.000 -90.000 258.49<br> 15.000 -90.000 258.49<br> 20.000 -90.000 258.49<br>
25.000 -90.000 258.49<br> ...<br> 230.000 -18.000 300.49<br> 235.000 -18.000 299.99<br> 240.000 -18.000 299.49<br> 245.000 -18.000 298.99<br>...<br><br>An equivalent script using the Perl interface would be very similar, since the methods open() and exp() are also available there.<br>
<br> Arlindo<br><br>-- <br>Arlindo da Silva<br><a href="mailto:dasilva@alum.mit.edu">dasilva@alum.mit.edu</a>