Replies: 2 comments 2 replies
-
Something you can try is to first query data from |
Beta Was this translation helpful? Give feedback.
-
Hi @Z-Richard, thanks for taking a look at this, I really appreciate it. I managed to get it to work ( I can't quite believe it given how long it took me 😄 ), with the following: u8 = data['u'].where((data['u'].lon>=0) & (data['u'].lon<=10) &(data['u'].lat>=45) & (data['u'].lat<=65), drop=True)
v8 = data['v'].where((data['v'].lon>=0) & (data['v'].lon<=10) &(data['v'].lat>=45) & (data['v'].lat<=65), drop=True)
h8 = data['gph'].where((data['gph'].lon>=0) & (data['gph'].lon<=10) &(data['gph'].lat>=45) & (data['gph'].lat<=65), drop=True)
pwat = data['pwat'].where((data['pwat'].lon>=0) & (data['pwat'].lon<=10) &(data['pwat'].lat>=45) & (data['pwat'].lat<=65), drop=True)
u8_t = data['u'].where((data['u'].lon>=345) & (data['u'].lon<=360) &(data['u'].lat>=45) & (data['u'].lat<=65), drop=True)
v8_t = data['v'].where((data['v'].lon>=345) & (data['v'].lon<=360) &(data['v'].lat>=45) & (data['v'].lat<=65), drop=True)
h8_t = data['gph'].where((data['gph'].lon>=345) & (data['gph'].lon<=360) &(data['gph'].lat>=45) & (data['gph'].lat<=65), drop=True)
pwat_t = data['pwat'].where((data['pwat'].lon>=345) & (data['pwat'].lon<=360) &(data['pwat'].lat>=45) & (data['pwat'].lat<=65), drop=True)
u8_t['lon'] = np.where(u8_t['lon'] > 180, u8_t['lon'] - 360, u8_t['lon'])
v8_t['lon'] = np.where(v8_t['lon'] > 180, v8_t['lon'] - 360, v8_t['lon'])
h8_t['lon'] = np.where(h8_t['lon'] > 180, h8_t['lon'] - 360, h8_t['lon'])
pwat_t['lon'] = np.where(pwat_t['lon'] > 180, pwat_t['lon'] - 360, pwat_t['lon'])
u8 = u8.combine_first(u8_t)
v8 = v8.combine_first(v8_t)
h8 = h8.combine_first(h8_t)
pwat = pwat.combine_first(pwat_t)
u8 = u8.metpy.sel(lev=850.0).squeeze()*1.94384449
v8 = v8.metpy.sel(lev=850.0).squeeze()*1.94384449
h8 = h8.metpy.sel(lev=850.0).squeeze()
pwat = pwat.metpy.sel().squeeze()*0.0393700787402 I think perhaps this can be simplified but at least it works. I would have expected there to be a nice in built option where you can convert all the lat lons together. Also I've had issues where sometimes it will fail to return the data, I'm not sure if the datasets are lazily loaded and when you filter the data and execute the query, it goes away and talks to the server to get the data you want. In some cases it seems to fail to execute if the lons span over the meridian. However the above seems to work fine. I would hope there is a cleaner solution however. This I have been using |
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm trying to follow the example here
But I can't seem to query over the prime meridian as the source data seems to run from lon 0 - 360.
Lets say I have the following:
That gives me:
If I change it so I have the following:
This completes, but, all the data west of the prime meridian is missing.
I'm sure this is pretty basic...... would someone please explain how I can display the data across the prime meridian?
Beta Was this translation helpful? Give feedback.
All reactions