# [ncl-talk] Time Vs Lat/Lon

Mon Oct 29 15:16:47 MDT 2018

```Hi Kunal,
If I understand correctly what you are after, you'd like to plot the time
(at each grid point) where the maximum (or minimum) value occurs.
This will likely take some trial and error on your part. Here's what I
think you need to do:
1) Use dim_minind and dim_maxind to isolate the index where the grid point
value is at its min/max.
https://www.ncl.ucar.edu/Document/Functions/Contributed/dim_maxind.shtml
https://www.ncl.ucar.edu/Document/Functions/Contributed/dim_minind.shtml

This will result in a 2-D array (dimensioned lat x lon) containing the
minimum indices, and the same type of array containing the maximum indices.

2)  There might be a more elegant way to map the indexes onto the correct
times, but the following double do loop over the lat/lon dimensions will
work:

; time is an array of your times
time_min = arr_min    ; arr_min contains the indices that were the minimum
at each lat/lon point
time_max = arr_max
do gg = 0,dimsizes(arr_min&lat)-1
do hh = 0,dimsizes(arr_min&lon)-1
time_min(gg,hh) = time(arr_min(gg,hh))
time_max(gg,hh) = time(arr_max(gg,hh))
end do
end do

You will want to make sure that your time array is in a format that is
conducive to being plotted. (18:30 doesn't work for instance, but 1830
would.)
I think that's it. Try starting with the above suggestions and see if you

On Mon, Oct 29, 2018 at 6:57 AM Kunal Bali <kunal.bali9 at gmail.com> wrote:

> Dear NCL users,
>
> I have one file (2000-2017) with time, latitude, longitude and  variable.
> The time is given in hours(00:30 to 18:30). I need to plot a spatial map of
> hours values at each grid cells, the contour map of hours values should
> correspond to the variable values. So that I can see which hour has high
> and low-value on the map. Some examples are given for time vs latitude and
> time vs longitude, I don't need that.  I need to plot time vs latitude
> longitude.
>
> I hope you got my point.
> Any information on that?
>
> Thank You
> ---
> Kunal Bali
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

--