[ncl-talk] Help Again With Plotting NARR Data

Alexander Schaefer aschae11 at uncc.edu
Tue Aug 2 16:20:54 MDT 2016


Kerwyn,

NARR data is 32 km grid spacing.  You are plotting 1 degrees by 0.65 degrees.  1 degree is about 111 km so you would only expect to have 4x3 or less wind barbs plotted. 

If you change the contour interval on the temps(0.25 plotted here) then you don’t have a single value covering the plot.  This is the same issue with the heights.  I set it to 5 for the spacing a height line fits within your plot space.

You can see the wind barbs you had, with 1 geopotential line and some colored contours for your temps.

Plotting such a small area of interest with coarse data what is making the plot difficult.

I hope that offers some insight,
-Alex




> On Aug 2, 2016, at 5:43 PM, Kerwyn Texeira <ktish86 at gmail.com> wrote:
> 
> Hi ncl-talk,
> 
> I have made changes to my NARR script but it is still not plotting a zoomed in overlay plot.  I tried several times playing around with the script by commenting and adding stuff but I'm not seeing much of any progress.  
> 
> When I commented out  all the tfDoNDCOverlay and left lat2d and lon2d uncommented, I got the entire USA plotted with both temp, geopotential height and winds overlayed.
> 
> When I commented out lat2d and lon2d and left tfDoNDCOverlay uncommented, I got mainly a plain figure with one or two wind barbs. (temp_narr) figure attached.
> 
> Kindly help, please.  I do appreciate the help that I'm getting but I'm just not quite reach my ultimate goal which is a zoomed in overlay plot of temps, winds, and geopotential height.  
> 
> Thanks
> 
> Some outputs:
> 
> Variable: temp
> Type: float
> Total Size: 386692 bytes
>             96673 values
> Number of Dimensions: 2
> Dimensions and sizes:   [gridx_221 | 277] x [gridy_221 | 349]
> Coordinates:
> Number Of Attributes: 15
>   lv_ISBL3 :    600
>   sub_center :  The North American Regional Reanalysis (NARR) Project
>   center :      US National Weather Service - NCEP (WMC)
>   long_name :   Temperature
>   units :       K
>   _FillValue :  1e+20
>   coordinates : gridlat_221 gridlon_221
>   level_indicator :     100
>   grid_number : 221
>   parameter_table_version :     131
>   parameter_number :    11
>   model :       North American Regional Reanalysis (NARR)
>   forecast_time :       0
>   forecast_time_units : hours
>   initial_time :        01/28/2014 (00:00)
> 
> Variable: u_wind
> Type: float
> Total Size: 386692 bytes
>             96673 values
> Number of Dimensions: 2
> Dimensions and sizes:   [gridx_221 | 277] x [gridy_221 | 349]
> Coordinates:
> Number Of Attributes: 15
>   lv_ISBL3 :    600
>   sub_center :  The North American Regional Reanalysis (NARR) Project
>   center :      US National Weather Service - NCEP (WMC)
>   long_name :   u-component of wind
>   units :       m/s
>   _FillValue :  1e+20
>   coordinates : gridlat_221 gridlon_221
>   level_indicator :     100
>   grid_number : 221
>   parameter_table_version :     131
>   parameter_number :    33
>   model :       North American Regional Reanalysis (NARR)
>   forecast_time :       0
>   forecast_time_units : hours
>   initial_time :        01/28/2014 (00:00)
> 
> Variable: v_wind
> Type: float
> Total Size: 386692 bytes
>             96673 values
> Number of Dimensions: 2
> Dimensions and sizes:   [gridx_221 | 277] x [gridy_221 | 349]
> Coordinates:
> Number Of Attributes: 15
>   lv_ISBL3 :    600
>   sub_center :  The North American Regional Reanalysis (NARR) Project
>   center :      US National Weather Service - NCEP (WMC)
>   long_name :   v-component of wind
>   units :       m/s
>   _FillValue :  1e+20
>   coordinates : gridlat_221 gridlon_221
>   level_indicator :     100
>   grid_number : 221
>   parameter_table_version :     131
>   parameter_number :    34
>   model :       North American Regional Reanalysis (NARR)
>   forecast_time :       0
>   forecast_time_units : hours
>   initial_time :        01/28/2014 (00:00)
> 
> Variable: hgt
> Type: float
> Total Size: 386692 bytes
>             96673 values
> Number of Dimensions: 2
> Dimensions and sizes:   [gridx_221 | 277] x [gridy_221 | 349]
> Coordinates:
> Number Of Attributes: 15
>   lv_ISBL3 :    600
>   sub_center :  The North American Regional Reanalysis (NARR) Project
>   center :      US National Weather Service - NCEP (WMC)
>   long_name :   Geopotential height
>   units :       gpm
>   _FillValue :  1e+20
>   coordinates : gridlat_221 gridlon_221
>   level_indicator :     100
>   grid_number : 221
>   parameter_table_version :     131
>   parameter_number :    7
>   model :       North American Regional Reanalysis (NARR)
>   forecast_time :       0
>   forecast_time_units : hours
>   initial_time :        01/28/2014 (00:00)
> 
> My Script:
> 
> 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
> a = addfile("./narr-a_221_20140128_0000_000.grb", "r")
> 
> wks_type = "png"
> wks_type at wkWidth = 2500
> wks_type at wkHeight = 2500
> 
> wks= gsn_open_wks(wks_type, "temp_narr")
> gsn_define_colormap(wks,"matlab_jet")
> 
> lat2d = a->gridlat_221
> lon2d = a->gridlon_221
> hgt = a->HGT_221_ISBL({600},:,:)
> temp = a->TMP_221_ISBL({600},:,:)
> pres = a->PRES_221_HYBL
> u_wind = a->U_GRD_221_ISBL({600},:,:)
> v_wind = a->V_GRD_221_ISBL({600},:,:)
> lev    = a->lv_ISBL3            ; 29 levels
> 
> printVarSummary(temp)
> printVarSummary(u_wind)
> printVarSummary(v_wind)
> printVarSummary(hgt)
> 
> spd = (u_wind*u_wind + v_wind*v_wind)^(0.5) ; m/s
> 
> pres = pres*0.01  ; converts to hpa
> 
> u_wind = u_wind*1.94384449
> v_wind = v_wind*1.94384449
> 
> temp1 = temp - 273
> 
> temp1 at lat2d = lat2d
> temp1 at lon2d = lon2d
> 
> hgt at lat2d = lat2d
> hgt at lon2d = lon2d
> 
> ;pres at lon2d = lon2d
> ;pres at lat2d = lat2d
> 
> u_wind at lon2d = lon2d
> u_wind at lat2d = lat2d
> 
> spd = spd*1.94384449
> 
> spd at lon2d = lon2d
> spd at lat2d = lat2d
> 
> 
> res = True
> res at gsnDraw = False
> res at gsnFrame = False
> res at cnLineLabelsOn = False
> res at cnFillOn = True
> res at tiMainString = "Temperature (C) at 600hpa on Jan 28 at 00:00UTC"
> res at tiMainFont = "helvetica"
> res at tiMainFontHeightF = 0.02
> res at pmTickMarkDisplayMode = "Always"
> res at mpProjection = "CylindricalEquidistant"
> res at mpDataBaseVersion = "MediumRes"
> res at mpOutlineOn = "True"
> res at lbOrientation = "Vertical"
> res at tiMainOffsetYF = -0.03
> res at mpFillOn  = False
> res at mpOutlineOn = True
> ;res at tfDoNDCOverlay = True
> res at mpMinLatF = 37.85
> res at mpMaxLatF = 38.50
> res at mpMinLonF = -120.0
> res at mpMaxLonF = -119.0
> res at gsnLeftString = "Geopotential Height (m) and Winds (kts)"
> res at gsnStringFontHeightF = 0.020
> res at gsnRightString = ""
> res at gsnMaximize = True
> res at mpShapeMode = "FreeAspect"
> res at lbTitleString = "Temperature (C)"
> res at lbTitleDirection = "Across"
> res at lbTitleAngleF = 90
> res at lbTitlePosition = "Right"
> res at lbTitleFontHeightF = 0.020
> res at gsnAddCyclic = False
> ;res at cnLevelSelectionMode = "ManualLevels"
> ;res at cnMinLevelValF = 
> ;res at cnMaxLevelValF =
> ;res at cnLevelSpacingF =
> 
> res1 = True
> res1 at gsnDraw = False
> res1 at gsnFrame = False
> res1 at vcWindBarbLineThicknessF = 7.0
> res1 at vcRefLengthF =0.018
> res1 at vcRefMagnitudeF = 10
> ;res1 at tfDoNDCOverlay = True
> res1 at vcMinDistanceF = 0.017
> res1 at vcGlyphStyle = "WindBarb"
> res1 at gsnRightString =""
> res1 at gsnLeftString = ""
> res1 at vcRefAnnoOn = False
> res1 at gsnAddCyclic = False
> 
> res2 = True
> res2 at gsnDraw = False
> res2 at gsnFrame = False
> res2 at cnLineColor = "Black"
> res2 at gsnContourLineThicknessesScale = 5.0
> res2 at gsnAddCyclic = False
> ;res2 at tfDoNDCOverlay = True
> res2 at gsnLeftString = ""
> res2 at gsnRightString = ""
> res2 at cnInfoLabelOn = False
> ;res2 at cnLevelSpacingF = 2
> res2 at cnLineLabelBackgroundColor = "white"
> res2 at cnLineLabelDensityF = 1
> 
> geo = gsn_csm_contour(wks, hgt, res2)
> 
> t600 = gsn_csm_contour_map(wks, temp1, res)
> 
> vector = gsn_csm_vector(wks, u_wind, v_wind, res1)
> 
> overlay(t600, geo)
> overlay(t600, vector)
> 
> draw(t600)
> frame(wks)
> 
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>  
> end
> 
> 
> 
> <temp_narr.png>_______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160802/e5002c16/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: temp_narr.png
Type: image/png
Size: 351871 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160802/e5002c16/attachment-0001.png 


More information about the ncl-talk mailing list