[ncl-talk] Visualization of WRF Output: Superimposition and Zooming

Gurer, Kemal@ARB kemal.gurer at arb.ca.gov
Tue Apr 8 08:14:48 MDT 2025


Hi Ehsan,

In this case, you need to overlay (or underlay grid points on the top of wind vectors. Here is an example script that plots grid points on the top of contours:

https://www.ncl.ucar.edu/Applications/Scripts/shapefiles_16.ncl

from the main location of other similar scripts that plot contours, data points as well as grid points, grid boxes, etc:

https://www.ncl.ucar.edu/Applications/datagrid.shtml

>From the script, you can take the portion below to add onto the script that I gave you:

;---Add dots at the lat/lon grid locations
  mkres                 = True
  mkres at gsMarkerIndex   = 16         ; Filled dots
  mkres at gsMarkerSizeF   = 0.001      ; Make them small
  mkres at gsMarkerColor   = "darkorchid4"
  mkres at gsnCoordsAttach = True

  gsn_coordinates(wks,plot_orig_coarse,data_coarse,mkres)
  gsn_coordinates(wks,plot_mask_coarse,data_mask_coarse,mkres)

  gsn_coordinates(wks,plot_orig_dense,data_dense,mkres)
  gsn_coordinates(wks,plot_mask_dense,data_mask_dense,mkres)

Kemal.

From: Ehsan Taghizadeh <ehsantaghizadeh at yahoo.com>
Sent: Monday, April 7, 2025 5:09 PM
To: Gurer, Kemal at ARB <kemal.gurer at arb.ca.gov>; Ncl-talk <ncl-talk at ucar.edu>
Subject: Re: [ncl-talk] Visualization of WRF Output: Superimposition and Zooming

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
Hi Kemal (and all),

Thank you so much for your kind help. Your guidance has been incredibly helpful to me.

For more clarification, I'd like to elaborate on a couple of points. Regarding zooming in and plotting wind vectors at every 5th grid point, my goal is to obtain a better resolution to analyze wind direction in more detail. By selecting every 5th grid point as a sample, I aim to control the density of wind vectors on the plot to achieve the most effective visualization.
Additionally, I'd like to plot wind vectors for every 5th grid point as an example, while still including all grid points of the WRF domain on the plot. This approach would help balance clarity and detail in the visualization.

When I refer to "zooming in," I don't mean simply isolating a portion of the map or plot. Rather, I'm looking to enhance resolution to reveal finer details, increase the grid points displayed, and present more specific variable information.

I tried to illustrate more clearly in the following hypothetical image what I mean by plotting every grid point while plotting wind vectors for every 5th grid point.
Any assistance would be appreciated.

[Inline image]
-----------------------------------------------------------------------------
Best regards,
Ehsan Taghizadeh


On Monday, April 7, 2025 at 11:11:28 AM PDT, Gurer, Kemal at ARB <kemal.gurer at arb.ca.gov<mailto:kemal.gurer at arb.ca.gov>> wrote:



I forgot to address one specific question that you had asked, which is you want to plot 10m wind vectors at every 5th grid points. In ncl, you can specify that via, for example,



  U = u10(it,::5,::5)



where the dimensions of u are:



  [Time x [south_north]  x [west_east]



and 5 is the incremental value that you want to plot every 5th grid points.



Kemal.



From: ncl-talk <ncl-talk-bounces at mailman.ucar.edu<mailto:ncl-talk-bounces at mailman.ucar.edu>> On Behalf Of Gurer, Kemal at ARB via ncl-talk
Sent: Monday, April 7, 2025 10:26 AM
To: Ehsan Taghizadeh <ehsantaghizadeh at yahoo.com<mailto:ehsantaghizadeh at yahoo.com>>; Ncl-talk <ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>>
Subject: Re: [ncl-talk] Visualization of WRF Output: Superimposition and Zooming



CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Hi Ehsan,



There is a transition from ncl to python usage to plot variables from WRF outputs and, for example, you can get the routine from here:



https://github.com/NCAR/wrf-python



I have certainly experimented with python to plot WRF outputs. However, since I have been using ncl for quite some time, I feel comfortable tweaking the ncl scripts to get the plots that I want. In the ncl script that I gave you, you set the lat/lon values of the corners of your plot area using the following variables for all variables:



      vecres1 at mpLeftCornerLatF  = xlatmin

      vecres1 at mpRightCornerLatF = xlatmax

      vecres1 at mpLeftCornerLonF  = xlonmin

      vecres1 at mpRightCornerLonF = xlonmax



to zoom into the area that you want to focus on. Experiment with the script and the rest will be a breeze for you.



Kemal.



From: Ehsan Taghizadeh <ehsantaghizadeh at yahoo.com<mailto:ehsantaghizadeh at yahoo.com>>
Sent: Sunday, April 6, 2025 7:42 PM
To: Ncl-talk <ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>>; Gurer, Kemal at ARB <kemal.gurer at arb.ca.gov<mailto:kemal.gurer at arb.ca.gov>>
Subject: Re: [ncl-talk] Visualization of WRF Output: Superimposition and Zooming



CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Hi Kemal,



Thank you so much for sharing your script! It looks great and very well-commented, making it easier to understand its functionality. I truly appreciate the effort you've put into creating and providing this.

I'm planning to use your script to plot WRF data for my research.



Just to clarify, my main challenge involves zooming in on a specific region, superimposing three variables, and plotting the wind vector for a specific interval of grid points.

I hope it's okay to ask for a bit more guidance-specifically on how to modify the dataonmap_zoom_10.ncl<https://www.ncl.ucar.edu/Applications/Scripts/dataonmap_zoom_10.ncl> script to meet these requirements. If anyone has any insights on achieving this or can suggest adjustments, that would be incredibly helpful.

Additionally, if any GeoCAT or Python scripts might suit these needs, I'd greatly appreciate your recommendations.



Any further assistance would mean a lot to me.



-----------------------------------------------------------------------------

Best regards,

Ehsan Taghizadeh





On Wednesday, April 2, 2025 at 08:06:35 PM PDT, Gurer, Kemal at ARB <kemal.gurer at arb.ca.gov<mailto:kemal.gurer at arb.ca.gov>> wrote:





Hi Ehsan,



Try the attached ncl script to plot horizontal cross sections of several variables from your WRF output. Just read the command lines and posted comments to understand how the script operates and disregard the warnings that ncl issues. You can plot other variables by looking at the examples given in the script.



Kemal.



From: ncl-talk <ncl-talk-bounces at mailman.ucar.edu<mailto:ncl-talk-bounces at mailman.ucar.edu>> On Behalf Of Ehsan Taghizadeh via ncl-talk
Sent: Tuesday, April 1, 2025 10:50 PM
To: Ncl-talk <ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>>
Subject: [ncl-talk] Visualization of WRF Output: Superimposition and Zooming



CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Dear NCL team,



I would like to plot 10 m wind vectors, 2 m temperature as contours, and topography as shaded from a WRF output file. Additionally, I need to zoom in on a domain approximately 1 × 1 degree. For instance, I would like to display one wind vector for every five grid points.

I reviewed the provided page (https://www.ncl.ucar.edu/Applications/wrfzoom.shtml) and tried the attached script. While it is relatively clean, it has some issues-particularly with the labels on the axes, as shown.

Any assistance in creating such a script would be greatly appreciated.



-----------------------------------------------------------------------------

Best regards,

Ehsan Taghizadeh

Ph.D. Student in Natural Resources & Environmental Studies (NRES),

    University of Northern British Columbia (UNBC)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20250408/b4c5423d/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 9916 bytes
Desc: image001.png
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20250408/b4c5423d/attachment.png>


More information about the ncl-talk mailing list