Re: GRIB Lambert proj errors

From: Jamie Lahowetz <jlahowe2_at_nyahnyahspammersnyahnyah>
Date: Wed, 13 Aug 2008 11:41:56 -0500

my bad. I changed the proj from 'ps' to 'x11'.

Another question is how can I zoom into an area to get a better idea of the
values?

On Wed, Aug 13, 2008 at 11:28 AM, Jamie Lahowetz <jlahowe2_at_bigred.unl.edu>wrote:

> Thanks for the help. I did a ncl_filedump and fixed the error:
> res_at_mpProjection = "LAMBERTCONFORMAL"
> res_at_mpLambertParallel1F = lon2d_at_Latin1
> res_at_mpLambertParallel2F = lon2d_at_Latin2
>
> Now, nothing is plotted.
>
>
>
>
> On Wed, Aug 13, 2008 at 10:20 AM, Mary Haley <haley_at_ucar.edu> wrote:
>
>>
>> On Wed, 13 Aug 2008, Jamie Lahowetz wrote:
>>
>> I could use some help on getting a GRIB to project over a Lambert
>>> Conformal.
>>> I get these errors:
>>> warning:Attempt to reference attribute (Latin1) which is undefined
>>> warning:Attempt to reference attribute (Latin2) which is undefined
>>> warning:GKS:GSVP: --RECTANGLE DEFINITION IS INVALID
>>> fatal:MapSetTrans: error initializing map: MAPINT/MDPINT/GKS ERROR
>>> REPORTED
>>> FROM libhlu.a(Error.o)
>>> warning:GKS:GSVP: --RECTANGLE DEFINITION IS INVALID
>>> fatal:MapSetTrans: error initializing map: MAPINT/MDPINT/GKS ERROR
>>> REPORTED
>>> FROM libhlu.a(Error.o)
>>> warning:["SetValues.c":474]:SetValuesChild never occurred on
>>> map.PlotManager: Error in mapPlotClass
>>> warning:tiMainString is not a valid resource in map at this time
>>> Segmentation fault
>>>
>>> I'm not sure what all these errors mean since I'm new to the language.
>>> Here
>>> is the code:
>>>
>>
>> Jamie,
>>
>> The main problem is that you are trying to reference a couple of
>> attributes that don't exist:
>>
>> res_at_mpLambertParallel1F = lat2d_at_Latin1
>> res_at_mpLambertParallel2F = lat2d_at_Latin2
>>
>> This code is trying to reference attributes "Latin1" and "Latin2" attached
>> to the variable "lat2d".
>>
>> I think this was an original example where the "lat2d" variable did
>> indeed have these attributes, because they were originally on the
>> file. However, you are using your own file, and it looks like
>> f->gridlat_221 does not have "Latin1" or "Latin2" attached to it.
>>
>> What you need to do is first print the contents of your file, either
>> by adding a "print(f)" after the "addfile" call, or by doing an
>> ncl_filedump on the UNIX command line:
>>
>> ncl_filedump
>> /home/jlahowet/THOR/test/wind/narr-a_221_20070314_0000_000.grb
>>
>> Check the output closely to see if there's anything that looks like it
>> might be related to the map projection of your data, and especially,
>> that might give you the two lambert parallel values that you need.
>>
>> For example, in one NARR example that we have, the two parallels are
>> attached to a variable called "Lambert_Conformal" and are stored in an
>> array called "standard_parallel" that has two elements:
>>
>> res_at_mpLambertParallel1F = f->Lambert_Conformal_at_standard_parallel(0)
>> res_at_mpLambertParallel2F = f->Lambert_Conformal_at_standard_parallel(1)
>>
>> Hopefully this will help you get started.
>>
>> --Mary
>>
>>
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>>> begin
>>>
>>> fili = "/home/jlahowet/THOR/test/wind/narr-a_221_20070314_0000_000.grb"
>>> f = addfile (fili, "r")
>>>
>>> names = getfilevarnames(f)
>>> print(names)
>>>
>>> atts = getfilevaratts(f,names(0))
>>> dims = getfilevardims(f,names(0))
>>> print(atts)
>>> print(dims)
>>>
>>> vpt = f->VSTM_221_HTGY
>>> lat2d = f->gridlat_221
>>> lon2d = f->gridlon_221
>>>
>>> wks = gsn_open_wks("ps","lcnative")
>>> gsn_define_colormap(wks,"gui_default")
>>>
>>> res = True
>>> res_at_tiMainString = "Native Lambert Conformal"
>>>
>>> res_at_mpLimitMode = "Corners"
>>> res_at_mpLeftCornerLatF = lat2d_at_corners(0)
>>> res_at_mpLeftCornerLonF = lon2d_at_corners(0)
>>> res_at_mpRightCornerLatF = lat2d_at_corners(2)
>>> res_at_mpRightCornerLonF = lon2d_at_corners(2)
>>>
>>> res_at_mpProjection = "LambertConformal"
>>> res_at_mpLambertParallel1F = lat2d_at_Latin1
>>> res_at_mpLambertParallel2F = lat2d_at_Latin2
>>> res_at_mpLambertMeridianF = lat2d_at_Lov
>>>
>>> res_at_pmTickMarkDisplayMode = "Always"
>>> res_at_mpFillOn = False
>>> res_at_mpOutlineDrawOrder = "PostDraw"
>>> res_at_mpOutlineBoundarySets = "GeophysicalAndUSStates"
>>>
>>> res_at_tfDoNDCOverlay = True
>>>
>>> res_at_cnFillOn = True
>>> res_at_cnLinesOn = False
>>> res_at_gsnSpreadColors = True
>>> res_at_gsnAddCyclic = False
>>>
>>> plot = gsn_csm_contour_map(wks,vpt,res)
>>> end
>>>
>>> Thanks
>>>
>>> --
>>> Jamie Ryan Lahowetz
>>> University of Nebraska - Lincoln
>>> Graduate Student - Geosciences
>>> 402.304.0766
>>> jlahowe2_at_bigred.unl.edu
>>>
>>>
>
>
> --
> Jamie Ryan Lahowetz
> University of Nebraska - Lincoln
> Graduate Student - Geosciences
> 402.304.0766
> jlahowe2_at_bigred.unl.edu
>

-- 
Jamie Ryan Lahowetz
University of Nebraska - Lincoln
Graduate Student - Geosciences
402.304.0766
jlahowe2_at_bigred.unl.edu
Received on Wed Aug 13 2008 - 10:41:56 MDT

This archive was generated by hypermail 2.2.0 : Thu Aug 14 2008 - 08:32:16 MDT