[pyngl-talk] isccp grid with Pyngl
xiaoni.wang at obspm.fr
Mon Oct 24 06:50:08 MDT 2016
I tried to install Pyngl on my computer in order to draw 2D figures with ISCCP grids. Before this, I had used condo to install python2 and other python tools in /obs/xxwang/anaconda2/.
1) To install Pyngl, I followed the suggestion on your website:
conda create --name pyn_test python=2
source activate pyn_test
conda install --channel ncar --channel khallock pynio pyngl
Then I modified my .bashrc by add the new path : export PATH="/obs/xxw/anaconda2/bin:/obs/xxw/anaconda2/envs/pyn_test/bin:$PATH »
I can see the environments:
pyn_test * /obs/xxw/anaconda2/envs/pyn_test
Then I tried to import Nio, but I have an error: ImportError: No module named Nio
Could you help me to figure out why ?
2) I have another question about using the Pyngl for plotting data on ISCCP grids. Maybe this question would be (too) simple….
I have my data on ISCCP equal area grids (0.25 degree in latitude, and varying espace in longitude, with more grids near equator and less grids near pole). My data are global data. In my test:
ISCCP latitude : lat_isccp, 1D, (256915,) ),
ISCCP longitude: lon_isccp, (1D, (256915,))
data: emis (1D , (256915,)).
I would like to plot emis data on 2D map. I do not know if I should define resources.mpProjection ? how to show figure on screen, or how to save this figure ? or If I have several parameters to plot, I guess that I can use these configurations for all the figures (except resources.tiMainString )?
In the below is my example code for plotting one parameter ‘emis’ . I adapted from your SEAM example.
wks_type = "ps"
wks = Ngl.open_wks(wks_type, "isccp")
resources = Ngl.Resources()
resources.sfXArray = lon_isccp
resources.sfYArray = lat_isccp
resources.nglSpreadColorStart = 176
resources.nglSpreadColorEnd = 2
resources.cnFillOn = True
resources.cnFillMode = "AreaFill"
resources.cnFillPalette = "BlAqGrYeOrReVi200"
resources.cnLinesOn = False
resources.cnLineLabelsOn = False
resources.lbBoxLinesOn = False
resources.lbLabelFontHeightF = 0.015
resources.tiMainString = "Emis"
resources.nglDraw = False
resources.nglFrame = False
zt = np.transpose(emis)
contour = Ngl.contour(wks,zt,resources)
Thank you very much for your help in advance !!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the pyngl-talk