Removing Temperature Outliers from CPC data using groupby and map for every lat, lon, and month separately #7728
Unanswered
bioinformike
asked this question in
Q&A
Replies: 1 comment
-
Seems like it. You can iterate over the groups to figure this out. See this tutorial |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I asked a question over on SO a while ago where I explained that I'm looking at the CPC tmax data which looks like what is in the screenshot below and I'm trying to remove outliers specifically looking at each longitude and latitude pair for each month. The answer was an adaptation of the code I had posted:
Then run:
masked = da.tmax.groupby('time.month').map(simple_out)
After looking at this some more, I'm questions if this is actually operating on each latitude and longitude separately for each month, or is this just working on each month separately across all latitudes and longitudes?
For example, I was hoping to have this function run separately on the following:
[89.75, 0.25, January]
[89.72, 0.25, February]
...
[89.25, 0.25, January]
[89.25, 0.25, February]
...
I have tried throwing 'lat' and 'lon' in the groupby but that gives an error:
I have looked into this error a bit more, but I guess I'm a bit stuck as far as what to do if I can't include multiple terms in the groupby, which seems to be the case with xarray. Does anyone have any ideas on how I can handle this?
Beta Was this translation helpful? Give feedback.
All reactions