From: Charles س. D. <dou...@ll...> - 2010-03-09 20:08:38
|
Hi Hugo, Simply do: import cdms2, cdutil, os, sys, vcs, vcsaddons filepath = os.path.join(sys.prefix, 'sample_data/clt.nc') cdmsfile = cdms2.open( filepath ) data = cdmsfile('clt', longitude=(-110, -70), latitude = (6, 20)) v = vcs.init() v.portrait() v.plot( data, continents=4, ratio='autot' ) v.gif('centroamerica.gif') raw_input() This will give you the best result If you really care about the 1to1 ratio do import cdms2, cdutil, os, sys, vcs, vcsaddons filepath = os.path.join(sys.prefix, 'sample_data/clt.nc') cdmsfile = cdms2.open( filepath ) data = cdmsfile('clt', longitude=(-110, -70), latitude = (6, 20)) v = vcs.init() v.portrait() v.plot( data, continents=4, ratio='1t' ) v.gif('centroamerica.gif') raw_input() On Mar 9, 2010, at 11:04 AM, Hugo Hidalgo wrote: > Hello, > > I am new to cdat and I would like to produce a map for the Central American region. I noticed that I can define my region using the cdmsfile command. However, the figure is always stretched in the same area of the screen (being landscape or portrait). If I want to keep a constant 1:1 aspect ratio, is it possible to define this so that the continents in the graph are never deformed? > > Also, I would like to increase the resolution of the coast, since the data that is available is too coarse when I display my region. What is the format of this coast data and how do I enter it into cdat. > > I appreciate very much any help you can provide me. > > Best regards, Hugo Hidalgo. > > PS > Here's a copy of my code > > #!/opt/cdat/bin/python > import cdms2, cdutil, os, sys, vcs, vcsaddons > filepath = os.path.join(sys.prefix, 'sample_data/clt.nc') > cdmsfile = cdms2.open( filepath ) > data = cdmsfile('clt', longitude=(-110, -70), latitude = (6, 20)) > v = vcs.init() > v.plot( data, continents=4 ) > v.portrait() > v.gif('centroamerica.gif') > raw_input() > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://*p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Cdat-discussion mailing list > Cda...@li... > https://*lists.sourceforge.net/lists/listinfo/cdat-discussion > |