vertical crosssection

From: <Oliver.Fuhrer_at_nyahnyahspammersnyahnyah>
Date: Thu, 18 Dec 2008 20:09:59 +0100

Dear ncl-talk,
 
I would like to make a vertical cross-section of potential temperature.
I have three fields which are all two dimensional...
 
 pt(ny,nx) : potential temperature (K)
  z(ny,nx) : geometrical height (m)#
lon(ny,nx) : longitudes

The grid is deformed only in the vertical, so lon(:,1) = lon(:,i) for
all i=1,nx.

Following the example 2 on
http://www.ncl.ucar.edu/Applications/2Dvertcoord.shtml I am able to get
a plot. But using cnFillMode = "CellFill" doesn't give a very nice
looking plot. Now if I switch back to cnFillMode = "AreaFill", the plot
looks perfect, except that the topography is not white anymore, but
filled with a color. An example scripts is below.

How can I convince NCL to leave the mountains white? Setting
cnMissingValFillColor=-1 doesn't seem to help either.

Is trGridType="TriangularMesh" the right transformation for what I want
to do? I tried "Curvilinear", but I could not get it to run using the
gsn_csm routines. Also, is any of the transformations able to plot
vector data correctly on top of a contour?

Cheers,
Oli
 
; ****************** test.ncl **************************

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

begin

 ; example mesh
 lon=new((/60,200/),float)
 do i=0,59
   lon(i,:)=fspan(1.,200.,200)
 end do
 z=new((/60,200/),float)
 do i=0,199
   z(:,i)=20000.0*fspan(0.,1.,60)^3 + \
          4000.0*(1.-fspan(0.,1.,60))*cos(lon(1,i)/32.-3.125)^2
 end do

 ; example data
 pt=290.0*exp(1.0e-5*z)

 ; open graphic port
 wks = gsn_open_wks("pdf","test2")
 gsn_define_colormap(wks,"gui_default")

 ; make example 2 plot
 res = True
 res_at_trGridType = "TriangularMesh"
 res_at_sfXArray = lon
 res_at_sfYArray = z
 res_at_cnFillOn = True
 res_at_cnFillMode = "CellFill"
 res_at_cnLinesOn = False
 res_at_cnLineLabelsOn = False
 res_at_gsnSpreadColors = True
 res_at_gsnMaximize = True
 p = gsn_csm_contour(wks,pt,res)

 delete(res_at_cnFillMode)
 p = gsn_csm_contour(wks,pt,res)

end

; ***************************************************
________________________________________

Oliver Fuhrer
Numerical Models

Federal Departement of Home Affairs FDHA
Federal Office of Meteorology and Climatology MeteoSwiss

Kraehbuehlstrasse 58, P.O. Box 514, CH-8044 Zurich, Switzerland

Tel. +41 44 256 93 59
Fax +41 44 256 92 78
oliver.fuhrer_at_meteoswiss.ch
www.meteoswiss.ch - First-hand information
 

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Dec 18 2008 - 12:09:59 MST

This archive was generated by hypermail 2.2.0 : Sat Dec 20 2008 - 12:36:21 MST