[ncl-talk] 回复: used the funtion " ind_resolve", "maxind" and"wrf_user_ij_to_ll" to find out the lat and lon location of the max data, butthe output data are not correspond to the plots

Mary Haley haley at ucar.edu
Wed Sep 28 13:44:18 MDT 2016


Grace,

Bill is correct that you need to subtract one from the wrf_user_ll_to_ij
result.  You said "add 1" in your previous email, which is not correct.

You are calling wrf_user_ll_to_ij, but then hard-coding the values for
x_start, x_end, y_start, y_end.  This is dangerous. You should use the
calculated values:

   loc1=wrf_user_ll_to_ij(a,105.0,32.0,tes)
   ;print("X/Y location is: "+ loc1)

   loc2=wrf_user_ll_to_ij(a,112.0,38.0,tes)

   loc1 = loc1 - 1  ; wrf_user_ll_to_ij returns 1..n, NCL
   loc2 = loc2 - 1  ;    needs 0 to n-1

  ; print("X/Y location is: "+ loc2)
  res at Xstart = loc1(0)    ; Set the zoom in coordinates
  res at Xend   = loc1(1)
  res at Ystart = loc2(0)
  res at Yend   = loc2(1)
;   x_start = 15
;   x_end   = 227
;   y_start = 71
;   y_end   = 274

--Mary


On Tue, Sep 27, 2016 at 6:50 PM, grace <313695096 at qq.com> wrote:

>  I have add 1 to the i,j ,but the output data are not correspond to the
> plots too.The distance between the location of output data and the location
> of the plot I already drawed is more than ten kilometers ,it is not just
> one or two grid.
>
> _______________________________________________
> 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/20160928/d96dd10c/attachment.html 


More information about the ncl-talk mailing list