Re: Simple line plot -need help

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue Jan 25 2011 - 10:28:51 MST

Use wgt_areaave_Wrap rather than wgt_areaave.
The _Wrap preserves the meta data

http://www.ncl.ucar.edu/Document/Functions/Contributed/wgt_areaave_Wrap.shtml

---
TsoiAve_clat = wgt_areaave(tsoi_all, clat, 1.0, 1)
printVarSummary(TsoiAve_clat)
you will see that there is no meta data
Using
TsoiAve_clat = wgt_areaave_Wrap(tsoi_all, clat, 1.0, 1)
printVarSummary(TsoiAve_clat)
====
The coordinates TsoiAve_clat will be (say) (time,depth)
Do you wish the plot the global average at each level???
or
Do you wish the plot the global average of all levels
where there is only one coordinate (time):
If the latter ...
http://www.ncl.ucar.edu/Document/Functions/Built-in/wgt_volave.shtml
glAve = wgt_volave(tsoi_all, depth, clat, 1.0, 0)   ; glAve(ktime)
glAve!0 = "time"
glAve&time = tsoi_all&time
printVarSummary(glAve)
=====
Also, There is no need to explicitly read "time" to memory.
time=fall[:]->time
You can use the coordinate associated with the variable you are trying 
to plot eg ...
plot = gsn_csm_xy(wks1,glAve&time,glAve,res)
On 1/25/11 10:14 AM, Madeleine Patterson wrote:
> Hi,
>
> I am trying to plot weighted global area averaged soil temperature over
> time (10 layers of soil temps) over 30 years of monthly values.
>
> However I am getting a long list of  TsoiAve_clat =  1e+36 at different
> coords when I run the script and a bunch of warnings and error messages
> at the end
>
> (0)     gsn_csm_xy: Fatal: X and Y must have the same dimensions sizes,
> or one must be one-dimensional and both have the same rightmost dimension.
>
> warning:["CoordArrays.c":591]:No Valid values in Array, unable to
> compute Min or Max
> warning:LegendInitialize: lgItemTypes exceeds maximum number of
> elements, 256: ignoring
> warning:LegendInitialize: lgDashIndexes exceeds maximum number of
> elements, 256: ignoring
> warning:LegendInitialize: lgMarkerIndexes exceeds maximum number of
> elements, 256: ignoring
> warning:LegendInitialize: lgLineLabelStrings exceeds maximum number of
> elements, 256: ignoring
> warning:LegendInitialize: lgLineColors exceeds maximum number of
> elements, 256: ignoring
> warning:LegendInitialize: lgMarkerColors exceeds maximum number of
> elements, 256: ignoring
> warning:LegendInitialize: lgLineDashSegLens exceeds maximum number of
> elements, 256: ignoring
> warning:LegendInitialize: lgLineThicknesses exceeds maximum number of
> elements, 256: ignoring
> warning:LegendInitialize: lgMarkerThicknesses exceeds maximum number of
> elements, 256: ignoring
> warning:LegendInitialize: lgLineLabelFontHeights exceeds maximum number
> of elements, 256: ignoring
> warning:LegendInitialize: lgMarkerSizes exceeds maximum number of
> elements, 256: ignoring
> warning:LegendInitialize: lgLabelStrings exceeds maximum number of
> elements, 256: ignoring
> warning:LegendInitialize: lgLineLabelFontColors exceeds maximum number
> of elements, 256: ignoring
> warning:LegendInitialize: lgItemTypes exceeds maximum number of
> elements, 256: ignoring
> warning:LegendInitialize: lgDashIndexes exceeds maximum number of
> elements, 256: ignoring
> warning:LegendInitialize: lgMarkerIndexes exceeds maximum number of
> elements, 256: ignoring
> warning:LegendInitialize: lgLineLabelStrings exceeds maximum number of
> elements, 256: ignoring
> warning:LegendInitialize: lgLineColors exceeds maximum number of
> elements, 256: ignoring
> warning:LegendInitialize: lgMarkerColors exceeds maximum number of
> elements, 256: ignoring
> warning:LegendInitialize: lgLineDashSegLens exceeds maximum number of
> elements, 256: ignoring
> warning:LegendInitialize: lgLineThicknesses exceeds maximum number of
> elements, 256: ignoring
> warning:LegendInitialize: lgMarkerThicknesses exceeds maximum number of
> elements, 256: ignoring
> warning:LegendInitialize: lgLineLabelFontHeights exceeds maximum number
> of elements, 256: ignoring
> warning:LegendInitialize: lgMarkerSizes exceeds maximum number of
> elements, 256: ignoring
> warning:LegendInitialize: lgLabelStrings exceeds maximum number of
> elements, 256: ignoring
> warning:LegendInitialize: lgLineLabelFontColors exceeds maximum number
> of elements, 256: ignoring
> warning:LegendSetValues: lgItemTypes exceeds maximum number of elements,
> 2::56: ignoring
> warning:LegendSetValues: lgDashIndexes exceeds maximum number of
> elements, 256: ignoring
> warning:LegendSetValues: lgMarkerIndexes exceeds maximum number of
> elements, 256: ignoring
> warning:LegendSetValues: lgLineLabelStrings exceeds maximum number of
> elements, 256: ignoring
> warning:LegendSetValues: lgLineColors exceeds maximum number of
> elements, 256: ignoring
> warning:LegendSetValues: lgMarkerColors exceeds maximum number of
> elements, 256: ignoring
> warning:LegendSetValues: lgLineDashSegLens exceeds maximum number of
> elements, 256: ignoring
> warning:LegendSetValues: lgLineThicknesses exceeds maximum number of
> elements, 256: ignoring
> warning:LegendSetValues: lgMarkerThicknesses exceeds maximum number of
> elements, 256: ignoring
> warning:LegendSetValues: lgLineLabelFontHeights exceeds maximum number
> of elements, 256: ignoring
> warning:LegendSetValues: lgMarkerSizes exceeds maximum number of
> elements, 256: ignoring
> warning:LegendSetValues: lgLabelStrings exceeds maximum number of
> elements, 256: ignoring
> warning:LegendSetValues: lgLineLabelFontColors exceeds maximum number of
> elements, 256: ignoring
> warning:LegendSetValues: lgItemTypes exceeds maximum number of elements,
> 256: ignoring
> warning:LegendSetValues: lgDashIndexes exceeds maximum number of
> elements, 256: ignoring
>
> My various print commands reveal that tsoi_all has 4 dims and TsoiAvg
> has 2, and I'm not really sure why this would be (or if its the cause of
> my problem).
>
> Can anyone point to where my script goes wrong?
>
> Thanks
>
> Maddy
>
> *************************************
>
> My script:
>
> begin
>
> 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"
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
>
> setfileoption("nc","SuppressClose",False)
>
> all_files = systemfunc("ls model-output2000.*")
>
> fall = addfiles(all_files,"r")
> ListSetType(fall,"cat")
> tsoi_all = fall[:]->TSOI
> printVarSummary(tsoi_all)
>
> lon = fall[1] ->lon
> lat = fall[1] ->lat
>
> rad = 4.0*atan(1.0)/180.0
>
> ; use the cosine of the latitudes to calc weighted global avg
>
> clat = cos(lat*rad)
>
> TsoiAve_clat = wgt_areaave(tsoi_all, clat, 1.0, 1)
>
> print("  TsoiAve_clat = " + TsoiAve_clat)
>
> TsoiAvg= TsoiAve_clat
>
> printVarSummary(TsoiAvg)
>
> time=fall[:]->time
>
> wks = gsn_open_wks("pdf","tsoi'")
> wks1= gsn_open_wks("x11","tsoi") ;open two types of workstations
>
> res=True
> res@tiMainString = "Soil Temperature (1970-2000)"
>
> plot = gsn_csm_xy(wks1,time,TsoiAvg,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 Tue Jan 25 10:28:57 2011

This archive was generated by hypermail 2.1.8 : Tue Jan 25 2011 - 14:22:15 MST