Zooming in on map and calculating

From: Chris Klich <cak10c_at_nyahnyahspammersnyahnyah>
Date: Thu Aug 30 2012 - 09:30:00 MDT

Hi all,

I am currently plotting variables and calculations using WRF model output,
however, I am using normal NCL functions. I am plotting 3 separate
domains, however, I am plotting them zoomed in, so they all cover the same
exact area. For example, for domains 1, 2, and 3, I have the following in
the resources:

opts@mpLimitMode = "LatLon"
opts@mpMinLatF = 40.
opts@mpMaxLatF = 56.
opts@mpMinLonF = 117.
opts@mpMaxLonF = 137.

This zooms in fine. However, I would like to calculate a variable
specifically within this zoomed region. It does not have to be exact, but
I've tried every combination of lat/lon and i/j starting and ending points,
and can't seem to get a "box" that fits almost perfectly within the zoomed
area. I used wrf_user_ll_to_ij to try and convert the zoomed in lats and
lons to i,j locations for whichever domain I am using, in order to try and
get the area I want. However, when I plot a "box" to see if it is roughly
the size of the plot, it is not very close at all. The bulk of my script
is the following:

           i_start = 69
           i_end = 100

           j_start = 52
           j_end = 94

           lon_ll = xlon(j_start,i_start)
           lat_ll = xlat(j_start,i_start)
           lon_lr = xlon(j_start,i_end)
           lat_lr = xlat(j_start,i_end)
           lon_ur = xlon(j_end,i_end)
           lat_ur = xlat(j_end,i_end)
           lon_ul = xlon(j_end,i_start)
           lat_ul = xlat(j_end,i_start)

           print("Lower Left: " + lon_ll + ", " + lat_ll)
           print("Lower Right: " + lon_lr + ", " + lat_lr)
           print("Upper Right: " + lon_ur + ", " + lat_ur)
           print("Upper Left: " + lon_ul + ", " + lat_ul)

           lnres = True
           lnres@gsLineThicknessF = 3.0
           lnres@gsLineColor = "Black"
           xbox = (/ lon_ll, lon_lr, lon_ur, lon_ul, lon_ll /)
           ybox = (/ lat_ll, lat_lr, lat_ur, lat_ul, lat_ll /)
           gsn_polyline(wks, plot, xbox, ybox, lnres)

This may seem like a roundabout way of doing this, but in the end, I would
like to be able to draw a box, and calculate values specifically within
that box. The "box" and plot that results is the following:
http://fuelberg.met.fsu.edu/pub/cklich/ . I understand the zoom-in portion
of the script just plots the min and max lat/lon, I am just unsure how to
get the exact i,j locations of the 4 corners of the area.

Thank you,
Chris

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Aug 30 09:30:10 2012

This archive was generated by hypermail 2.1.8 : Tue Sep 11 2012 - 15:30:42 MDT