[ncl-talk] Extract wrf variable at specific latitude and longitude

Alyce alsalte at gmail.com
Fri Oct 9 08:57:07 MDT 2020


Hi again, 

Just to be more specific, this is for a timeseries analysis, so will need all hours of data from the wrfout file, at a specific lat and long.

Regards
Alyce 

Sent from my iPhone

> On 9 Oct 2020, at 10:12 pm, Alyce Sala Tenna <alsalte at gmail.com> wrote:
> 
> Hello,
> 
> I would like to extract temperature at a specific latitude and longitude.
> 
> I’m new to python and I’m not confident with loops. 
> 
> 
> times = wrf.getvar(f, "times")
> t2 = wrf.getvar(f, "td2")
> nl = wrf.extract_dim(f, 'Time')
> len = nl-1            
> 
> # Find the closest point to the site in WRF grids
> x_y = wrf.ll_to_xy(f, stn_lat, stn_lon,True)
> 
> for i in range(len):
>    temp_sub = t2[0:i,x_y[0],x_y[1]]
> 
> I know I’m only pulling one slice of data vertically - how do I draw it from a specific lat and long?
> 
> Thanks in advance,
> Ayce


More information about the ncl-talk mailing list