Closed berzinastella closed 6 months ago
Sorry, figured it out on my own. For anyone looking for zonal means:
zonal_mean = pd.DataFrame(columns=["lat", "mean_amplitude"])
lat_bins=np.arange(-85,85,1)
for i in range(len(lat_bins)):
x0, x1, y0, y1 = 0, 360, lat_bins[i], lat_bins[i+1]
area = dict(llcrnrlon=x0, llcrnrlat=y0, urcrnrlon=x1, urcrnrlat=y1)
a_subset = a_16w.extract_with_area(area, full_path=True)
m=a_subset.speed_radius.mean()
zonal_mean.loc[len(zonal_mean)] = ({'lat': y0, 'mean_amplitude': m})
Have a nice day !!
Hi, Another usage question- is there a way to calculate zonal/latitudinal means of eddy variables? I tried using grid_stat but it seems like you need at least two grids in longitude for the function to work.
This worked (but bot for any larger value than 179 that i tried)
However, is there a more clever already made function to calculate zonal/latitude means? I had a long look around the functions and could not see anything.
If there is no such function, how do you suggest going about calculating it?
Best, Stella