Re: global data on satellite projection

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Thu, 17 Apr 2008 12:39:52 -0600

Hi Brian,
You are setting the coordinates more or less to index values when you
set up
the scalar field as:

tfield = create "ScalarField" scalarFieldClass appid
     "sfDataArray" : tvar
     "sfXCStartV" : 0
     "sfYCStartV" : ydim
     "sfXCEndV" : xdim
     "sfYCEndV" : 0
     "sfMissingValueV" : -999.0
end create

If the coordinates are evenly spaced you could do this:

lat = grb_file->lat_4
lon = grb_file->lon_4
tfield = create "ScalarField" scalarFieldClass appid
     "sfDataArray" : tvar
     "sfXCStartV" : lon(0)
     "sfYCStartV" : lat(0)
     "sfXCEndV" : lon(nx -1)
     "sfYCEndV" : lat(ny - 1)
     "sfMissingValueV" : -999.0
end create

Or however the coordinates are spaced (as long as they are 1D) you
can do this:

tfield = create "ScalarField" scalarFieldClass appid
     "sfDataArray" : tvar
     "sfXArray" : lon
     "sfYArray" : lat
     "sfMissingValueV" : -999.0
end create

Hope this helps.
  -dave
On Apr 17, 2008, at 12:24 PM, Brian Jamison wrote:

> Hello!
>
> I am trying to plot some 0.5 degree lat/lon global data on the
> satellite
> projection, but after trying a number of things, I can only get
> data to
> plot over half the globe, and the data are not plotted/overlaid
> correctly.
>
> Latitude and longitude are one dimensional variables.
>
> I use the object oriented code. Here are the relevant portions of the
> code:
>
> ---------------------------------
>
> ny = filevardimsizes(grb_file,"lat_4")
> nx = filevardimsizes(grb_file,"lon_4")
> xdim = nx - 1
> ydim = ny - 1
> ;
> tvar = grb_file->T_4_SFC(:,:) - 273.15
> tvar = tvar * 9/5 + 32 ; Convert to F
> ;
> mpid = create "mapplot" mapPlotClass wid
> ;
> "mpProjection" : "Satellite"
> "mpLimitMode" : "MaximalArea"
> "mpCenterLatF" : 0.
> "mpCenterLonF" : 180.
> "mpOutlineBoundarySets" : "Geophysical"
> "mpNationalLineColor" : "foreground"
> "mpGridAndLimbOn" : False
> "mpGeophysicalLineColor" : "foreground"
> "vpXF" : 0.06
> "vpYF" : 0.720306
> "vpWidthF" : 0.88
> "vpHeightF" : 0.440612
> ;
> end create
> ;
> tfield = create "ScalarField" scalarFieldClass appid
> "sfDataArray" : tvar
> "sfXCStartV" : 0
> "sfYCStartV" : ydim
> "sfXCEndV" : xdim
> "sfYCEndV" : 0
> "sfMissingValueV" : -999.0
> end create
> ;
> cnid = create "contourplot" contourPlotClass wid
> "cnScalarFieldData": tfield
> "cnFillColors" : (/
> 8,9,10,11,20,12,13,2,3,4,5,6,7,8,9,10,11,12,13 /)
> "cnLevelSelectionMode" : "ManualLevels"
> "cnMinLevelValF" : -60
> "cnMaxLevelValF" : 120
> "cnLevelSpacingF" : 10
> "cnFillOn" : True
> "cnLinesOn" : False
> "cnLineLabelsOn" : False
> "cnInfoLabelOn" : False
> "cnGridBoundPerimOn" : True
> "cnRasterModeOn" : True
> "pmTickMarkDisplayMode" : "NoCreate"
> "pmLabelBarDisplayMode" : "ALWAYS"
> "pmLabelBarHeightF" : .05
> "pmLabelBarWidthF" : 0.9
> "pmLabelBarSide" : "bottom"
> "pmLabelBarOrthogonalPosF" : 0.0
> "pmLabelBarParallelPosF" : 0.5
> "lbAutoManage" : False
> "lbOrientation" : "horizontal"
> "lbTitleFont" : 22
> "lbPerimOn" : False
> "lbBoxLinesOn" : 0
> "lbLabelStride" : 2
> "lbLabelFontHeightF" : 0.015
> "tiMainString" : "Sfc Temp (F)"
> "tiMainFont" : 22
> "tiMainFontHeightF" : .02
> "tiMainFontColor" : 1
> "tiMainJust" : "CenterLeft"
> "tiMainOffsetXF" : 0.275
> "tiMainOffsetYF" : -0.015
> "vpXF" : 0.06
> "vpYF" : 0.720306
> "vpWidthF" : 0.88
> "vpHeightF" : 0.440612
> end create
> ;
> overlay(mpid,cnid)
> draw(mpid)
> frame(wid)
>
> --------------------------------
>
> Any help is greatly appreciated!!
>
> Brian Jamison
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Apr 17 2008 - 12:39:52 MDT

This archive was generated by hypermail 2.2.0 : Sun Apr 20 2008 - 07:42:42 MDT