Re: lat/lon coordinates

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Wed Sep 19 2012 - 16:13:18 MDT

in = addfile("./AGCM_RESTART39.nc","r")

   theta = in->theta_agcm
   printVarSummary(theta)

   wks = gsn_open_wks("x11","contour_plot")

   res = True
   res@cnFillOn = True
   res@gsnSpreadColors = True
   res@gsnAddCyclic = False

plot = gsn_csm_contour_map(wks,theta(0,0,:,:),res)

On 9/19/12 4:07 PM, Adam Phillips wrote:
> Hi Matt,
> (Welcome to NCL!)
> It should not matter whether the longitudes go from -180:180 or 0:360;
> either way should work.
>
> Can you put the following in your script:
> printVarSummary(theta)
> right before this line:
>
> plot = gsn_csm_contour_map(wks,theta(0,0,:,:),res)
>
> and send ncl-talk the results? I am curious to see what the coordinate
> variables look like. Also, are you getting any error messages? Adam
>
>
> Can you do a print
> On 09/19/2012 03:26 PM, Matt Masarik wrote:
>> Hello All,
>>
>> I am new to learning NCL and am having some trouble producing a plot
>> from a netCDF file. When I run a script based on a contour example
>> I get a map and a color bar, but no field contours. I suspect that
>> the problem is with the coordinates: the longitude runs from
>> -180 to 180, vs. 0 to 360.
>>
>> Would this longitude description cause a problem?
>> Any suggestions on which method to use to re-grid?
>>
>> Thank you, Matt
>>
>>
>> I included the script used below.
>>
>> -------------------------------------------------------------------------------------------
>>
>> 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
>>
>> in = addfile("./AGCM_RESTART39.nc","r")
>>
>> lon = in->longitude
>> lat = in->latitude
>> sigma = in->sigma
>> time = in->agcm_time
>>
>> theta = in->theta_agcm
>>
>> theta!0 = "time"
>> theta!1 = "sigma"
>> theta!2 = "lat"
>> theta!3 = "lon"
>> theta&lat@units="degrees_north"
>> theta&lon@units="degrees_east"
>>
>> wks = gsn_open_wks("x11","contour_plot")
>>
>> res = True
>> res@cnFillOn = True
>> res@gsnSpreadColors = True
>> res@gsnAddCyclic = False
>>
>> plot = gsn_csm_contour_map(wks,theta(0,0,:,:),res)
>>
>> end
>>
>> ----------------------------------------------------------------------------------------------------
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Sep 19 16:13:27 2012

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