2d cross section from 3d data

From: Nick Guy <nick.guy_at_nyahnyahspammersnyahnyah>
Date: Fri Sep 21 2012 - 09:35:33 MDT

Hello,

I am relatively new to NCL and have run into an issue. I am running NCL 6.0.0.

I would like to pull out a 2D cross section from 3D data variable and eventually plot this. I have attached a plot which shows the "A" and "B" points, which do have data. However, the variable is returned with all missing (-999. in this case) values. Not sure where my mistake lies, any help would be great.

I've pasted the code used below (shortened for brevity, but all variables are defined earlier on):
;===========================================================
; Load the base libraries often needed
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"

Kmax=30
Jmax=150
Imax=150

; Read the .dpw file which is a direct access type
dBZ=fbindirread("0351.dpw",4,(/Kmax,Jmax,Imax/),"float")

; Fill in attributes for each variable
  dBZ@_FillValue=-999.
  dBZ@units="dBZ"
  dBZ@long_name="Reflectivity"
  dBZ!0="Height"
  dBZ&Height=Ht
  dBZ!1="Latitude"
  dBZ&Latitude=YLat
  dBZ!2="Longitude"
  dBZ&Longitude=XLon

; Now pull out the user-defined cross-section
latA=0.43
lonA=79.60
latB=0.15
lonB=79.32

  LatXsec=fspan(latA,latB,100)
  LonXsec=fspan(lonA,lonB,100)
  XYsec=new((/100,2/),float)
  XYsec(:,1)=LatXsec
  XYsec(:,0)=LonXsec

  XsecdBZ=wrf_interp_2d_xy(dBZ,XYsec)
  XsecdBZ!0="Height"
  XsecdBZ&Height=Ht
  XsecdBZ!1="Distance"
  XsecdBZ&Distance=XsecDist
;===========================================================

Thanks,

Nick Guy
nick.guy@noaa.gov

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Fri Sep 21 09:35:58 2012

This archive was generated by hypermail 2.1.8 : Fri Sep 21 2012 - 16:22:29 MDT