Re: Lambert Conformal Grid

From: Agnes Lim Huei Ni <alim_at_nyahnyahspammersnyahnyah>
Date: Wed Aug 28 2013 - 17:15:01 MDT

Hi David,

Thanks for clarifying what the purpose of the masking option is for.

I have set my resource options to what you suggested but coordinates
still does not look right.
I have placed the figure at
ftp.ssec.wisc.edu/pub/alim/T_test.pdf

Please advise.

Thanks
Agnes

PS The following is the code segment for the plotting.

      res@gsnSpreadColors = True
      res@mpLandFillColor = -1 ; set land to be transperant
      res@mpOutlineOn = True
      res@mpOutlineBoundarySets = "AllBoundaries"
      res@mpProjection = "LambertConformal"
      res@mpLambertParallel1F = lat2d@Latin1 ; ncl adds from
grib file
      res@mpLambertParallel2F = lat2d@Latin2 ; ncl adds from
grib file
      res@mpLambertMeridianF = lat2d@Lov ; ncl adds from
grib file
      res@mpLimitMode = "corners"
      res@mpLeftCornerLonF = lon2d@corners(0) ; (-168.719)
      res@mpLeftCornerLatF = lat2d@corners(0) ; (-8.035)
      res@mpRightCornerLonF = lon2d@corners(2) ; (-45.67911)
      res@mpRightCornerLatF = lat2d@corners(2) ; (42.22018)
      res@tfDoNDCOverlay = True
      res@cnFillOn = True
      res@cnLinesOn = False
      res@cnLineLabelsOn = False
      res@lbBoxLinesOn = True

      res@gsnAddCyclic = False
      res@gsnDraw=False
      res@gsnFrame=False
      res@mpEllipticalBoundary = False
      res@tmXBLabelFontHeightF = 0.01 ; resize tick labels
      res@tmYLLabelFontHeightF = 0.01
      res@pmTickMarkDisplayMode = "Always"
      res@lbLabelAutoStride = True
      res@lbLabelBarOn = False
      res@lbLabelFontHeightF=0.012
      res@cnLevelSelectionMode = "ExplicitLevels"
      res@cnLevels=(/-2.0, -1.5, -1.0, -0.5, 0.5, 1, 1.5, 2.0/)

      plot(0)=gsn_csm_contour_map(wks,inc(97,:,:), res)
      plot(1)=gsn_csm_contour_map(wks,inc(94,:,:), res)
      plot(2)=gsn_csm_contour_map(wks,inc(91,:,:), res)
      plot(3)=gsn_csm_contour_map(wks,inc(88,:,:), res)
      plot(4)=gsn_csm_contour_map(wks,inc(85,:,:), res)
      plot(5)=gsn_csm_contour_map(wks,inc(82,:,:), res)

      resP=True
      resPgsnPanelFigureStngsPerimOn=False
      resP@gsnPanelLabelBar = False
      resP@lbLabelFontHeightF=0.012
      resP@pmLabelBarOrthogonalPosF = -0.05
      resP@lbLabelStride = 1
      resP@gsnPanelFigureStrings= (/"a)","b)","c)","d)","e)","f)"/)
      gsn_panel(wks, plot, (/3,2/), resP)
      gsnMaximize = True

On 8/28/13 4:53 PM, David Brown wrote:
> Agnes (and Rick):
> Well the model this GRIB is associated with is the "North Pacific
> Hurricane Wave Model" so it seems natural that it is centered over the
> Pacific. I am attaching a plot of the area covered by the data as
> specified in the GRIB lat/lon coordinate attributes. As the message
> indicates, the error stems from attempting to mask the conformal
> projection. The masking routine expects the plot to lie solely in the
> Northern or Southern
> hemisphere. That is because its purpose is to remove the "hole" in the
> projection that occurs wrapping around the pole. See the two frames of
> the first plot in the masked LC example page if this is not clear
> (http://www.ncl.ucar.edu/Applications/lcmask.shtml).
>
> For a regional LC projection that does not include the polar area,
> there is no need to mask the projection.
> So the first suggestion is to remove:
> res@gsnMaskLambertConformal = True
>
> Second if you set up the projection based on the lat/lon variable
> attributes in the GRIB file you can do a "native" projection, which is
> faster and presents the data as the GRIB producer output it.
> The projection resources you would use are:
>
> res@mpProjection = "lambertconforma
> res@mpLambertParallel1F = lat2d@Latin1 ; (36.228)
> res@mpLambertParallel2F = lat2d@Latin2 ; (36.228)
> res@mpLambertMeridianF" : lat2d@Lov ; (-122.246)
> res@mpLimitMode = "corners"
> res@mpLeftCornerLonF = lon2d@corners(0) ; (-168.719)
> res@mpLeftCornerLatF = lat2d@corners(0) ; (-8.035)
> res@mpRightCornerLonF = lon2d@corners(2) : (-45.67911)
> res@mpRightCornerLatF = lat2d@corners(2) ; (42.22018)
>
> Additionally set
>
> res@tfDoNDCOverlay = True
>
> and don't use the lat2d, lon2d coordinate attributes.
>
> However, you can use any projection for this data if you don't set
> tfDoNDCOverlay and do use the lat2d, lon2d coordinates.
>
> Hope this helps.
> -dave
>
>
>
>
>
> On Aug 28, 2013, at 1:31 PM, Rick Brownrigg <brownrig@ucar.edu
> <mailto:brownrig@ucar.edu>> wrote:
>
>> Hi,
>>
>> I don't know about the source of the error message, but what strikes
>> me is the value for mpLambertMeridianF is somewhat unusual for a map
>> of CONUS: a value of -125 puts the center of projection off the
>> coast of California. A value of -98 would be more typical.
>>
>> Just FWIW
>> Rick
>>
>> On Aug 28, 2013, at 1:21 PM, Agnes Lim Huei Ni <alim@ssec.wisc.edu
>> <mailto:alim@ssec.wisc.edu>> wrote:
>>
>>> Hi,
>>>
>>> I have a grb file that contains temperature covering CONUS and part
>>> south america.
>>> I had set the following resources to plot it on a lambert conformal grid
>>> res@mpProjection = "LambertConformal"
>>> res@mpLambertParallel1F = 20.000
>>> res@mpLambertParallel2F = 40.000
>>> res@mpLambertMeridianF = -125.000
>>> res@gsnMaskLambertConformal = True
>>>
>>> The following errors appear
>>> (0) mask_lambert_conformal: warning: you are not authorized to
>>> specify.
>>> (0) a maxlat that is above the equator and a minlat that is below
>>> (0) the equator. No masking will take place.
>>>
>>> The information in the grb file for T, latitude and longitude in the
>>> data file are listed belowe.
>>>
>>> Please advice.
>>>
>>> Thanks
>>> Agnes
>>>
>>> Variable: anal_T
>>> Type: float
>>> Total Size: 479364732 bytes
>>> 119841183 values
>>> Number of Dimensions: 3
>>> Dimensions and sizes: [lv_HYBL0 | 99] x [g3_x_1 | 869] x [g3_y_2
>>> | 1393]
>>> Coordinates:
>>> lv_HYBL0: [1..99]
>>> Number Of Attributes: 13
>>> center : US National Weather Service - NCEP (WMC)
>>> long_name : Temperature
>>> units : K
>>> _FillValue : 1e+20
>>> coordinates : g3_lat_1 g3_lon_2
>>> level_indicator : 109
>>> gds_grid_type : 3
>>> parameter_table_version : 2
>>> parameter_number : 11
>>> model : North Pacific Hurricane Wave Model
>>> forecast_time : 0
>>> forecast_time_units : hours
>>> initial_time : 05/24/2008 (00:00)
>>>
>>> Variable: lat2d
>>> Type: float
>>> Total Size: 4842068 bytes
>>> 1210517 values
>>> Number of Dimensions: 2
>>> Dimensions and sizes: [g3_x_1 | 869] x [g3_y_2 | 1393]
>>> Coordinates:
>>> Number Of Attributes: 11
>>> corners : ( -8.035, -5.586509, 42.22018, 36.89176 )
>>> long_name : latitude
>>> GridType : Lambert Conformal Secant or Tangent, Conical or bipolar
>>> units : degrees_north
>>> Latin2 : 36.228
>>> Latin1 : 36.228
>>> Dy : 7920
>>> Dx : 8774
>>> Lov : -122.246
>>> Lo1 : -168.719
>>> La1 : -8.035
>>>
>>> Variable: lon2d
>>> Type: float
>>> Total Size: 4842068 bytes
>>> 1210517 values
>>> Number of Dimensions: 2
>>> Dimensions and sizes: [g3_x_1 | 869] x [g3_y_2 | 1393]
>>> Coordinates:
>>> Number Of Attributes: 11
>>> corners : ( -168.719, -80.83456, -45.67911, 154.7749 )
>>> long_name : longitude
>>> GridType : Lambert Conformal Secant or Tangent, Conical or bipolar
>>> units : degrees_east
>>> Latin2 : 36.228
>>> Latin1 : 36.228
>>> Dy : 7920
>>> Dx : 8774
>>> Lov : -122.246
>>> Lo1 : -168.719
>>> La1 : -8.035
>>>
>>> _______________________________________________
>>> 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
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Aug 28 17:15:16 2013

This archive was generated by hypermail 2.1.8 : Fri Aug 30 2013 - 14:04:57 MDT